Skip to content

Commit

Permalink
add golang support
Browse files Browse the repository at this point in the history
  • Loading branch information
swr1bm86 committed Mar 6, 2016
1 parent bd862da commit 89c97d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<annotator language="JavaScript" implementationClass="zjhmale.rainbow.RainbowHighliter"/>
<annotator language="Erlang" implementationClass="zjhmale.rainbow.RainbowHighliter"/>
<annotator language="Scala" implementationClass="zjhmale.rainbow.RainbowHighliter"/>
<annotator language="go" implementationClass="zjhmale.rainbow.RainbowHighliter"/>


<applicationConfigurable implementation="zjhmale.rainbow.setting.RainbowConfigurable"/>
<applicationService serviceInterface="zjhmale.rainbow.setting.RainbowSettings"
Expand Down
6 changes: 5 additions & 1 deletion src/zjhmale/rainbow/RainbowHighliter.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder hold
&& !t.startsWith("//")
&& !(t.startsWith("/*") && t.endsWith("*/"))
&& !scalaDocTokens.contains(type.toString());
boolean goPredicate = languageID.equals("go")
&& !t.startsWith("//")
&& !(t.startsWith("/*") && t.endsWith("*/"));

boolean isParentheses = delimitersList.contains(t);
boolean isString = (t.startsWith("\"") && t.endsWith("\"")) || (t.startsWith("\'") && t.endsWith("\'"));
Expand All @@ -159,7 +162,8 @@ public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder hold
|| rustPredicate
|| jsPredicate
|| erlangPredicate
|| scalaPredicate)
|| scalaPredicate
|| goPredicate)
&& !isParentheses
&& !isString) {
TextAttributes attrs = getIdentifierAttributes(t, backgroundColor);
Expand Down

0 comments on commit 89c97d7

Please sign in to comment.