Skip to content

Commit

Permalink
Rewrote the compiler completion engine to support all target types.
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBishton committed Feb 1, 2017
1 parent f78a60b commit 906c752
Show file tree
Hide file tree
Showing 3 changed files with 393 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ public int getColumn() {
return column;
}

public boolean isInformationalMessage() {
return CompilerMessageCategory.INFORMATION.equals(category);
}

public boolean isErrorMessage() {
return CompilerMessageCategory.ERROR.equals(category);
}

public boolean isWarningMessage() {
return CompilerMessageCategory.WARNING.equals(category);
}

@Nullable
public static HaxeCompilerError create(@NotNull String rootPath, final String message) {
return create(rootPath, message, true);
Expand Down Expand Up @@ -116,7 +128,7 @@ else if ((m = pBareError.matcher(message)).matches()) {
// match the pattern.
else if ((m = pGenericError.matcher(message)).matches()) {
String error = m.group(1).trim();
if (isInformationalMessage(error)) {
if (matchesInformationalPattern(error)) {
return new HaxeCompilerError(CompilerMessageCategory.INFORMATION,
message.trim(), "", -1, -1);
}
Expand Down Expand Up @@ -188,7 +200,7 @@ private static String buildGenericErrorMessage(String error, String reason) {
return msg.toString();
}

private static boolean isInformationalMessage(String message) {
private static boolean matchesInformationalPattern(String message) {
Boolean isStatusMessage = pGeneratingStatusMessage.matcher(message).matches();
Boolean isInfoMessages = mInformationalMessages.contains(message);
Boolean isCompilingStatusMessage = pCompilingStatusMessage.matcher(message).matches();
Expand Down
9 changes: 8 additions & 1 deletion src/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<p>Documentation: http://github.com/HaxeFoundation/intellij-haxe/README.md.</p>
<p>Support: http://github.com/HaxeFoundation/intellij-haxe/issues.</p>
<p/>
<p>Unreleased:</p>
<ul>
<li>Reworked code completion using the compiler.</li>
</ul>
<p>0.10.1.1: (community release)</p)
<ul>
<li>Update compatibility for 2016.3.2</li>
Expand Down Expand Up @@ -690,11 +694,14 @@
<completion.contributor language="Haxe" implementationClass="com.intellij.plugins.haxe.ide.HaxeClassNameCompletionContributor"/>
<completion.contributor language="Haxe" implementationClass="com.intellij.plugins.haxe.ide.HaxeSmartCompletionContributor"/>
<completion.contributor language="Haxe" implementationClass="com.intellij.plugins.haxe.ide.HaxeMetaTagsCompletionContributor"/>
<completion.contributor language="Haxe" order="LAST" implementationClass="com.intellij.plugins.haxe.ide.HaxeCompilerCompletionContributor"/>
<completion.contributor language="HXML" implementationClass="com.intellij.plugins.haxe.ide.HXMLCompilerArgumentsCompletionContributor"/>
<completion.contributor language="HXML" implementationClass="com.intellij.plugins.haxe.ide.HXMLHaxelibCompletionContributor"/>
<completion.contributor language="HXML" implementationClass="com.intellij.plugins.haxe.ide.HXMLDefineCompletionContributor"/>
<completion.contributor language="XML" implementationClass="com.intellij.plugins.haxe.ide.XmlHaxelibCompletionContributor"/>
<!-- Keep the compiler contributor last because it is slow compared to the internal stuff.
Don't use order="LAST" because that puts it after the default contributor, which puts up the "No Suggestions"
box, and we want compiler error messages to be displayed instead. -->
<completion.contributor language="Haxe" implementationClass="com.intellij.plugins.haxe.ide.HaxeCompilerCompletionContributor"/>

<configurationType implementation="com.intellij.plugins.haxe.runner.HaxeRunConfigurationType"/>

Expand Down
Loading

0 comments on commit 906c752

Please sign in to comment.