Skip to content

Commit

Permalink
Add custom attribute highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkyenus committed Jul 27, 2016
1 parent 3e248a8 commit 61f7dbb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<change-notes><![CDATA[
<p>1.14</p>
<ul>
<li>Allow custom highlighting for uniforms and varyings</li>
<li>Allow custom highlighting for uniforms, varyings and attributes</li>
</ul>
<p>1.13</p>
Expand Down
1 change: 1 addition & 0 deletions src/glslplugin/GLSLColorAndFontsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class GLSLColorAndFontsPage implements ColorSettingsPage {
new AttributesDescriptor("Identifiers",GLSLHighlighter.GLSL_IDENTIFIER[0]),
new AttributesDescriptor("Identifiers of Uniforms",GLSLHighlighter.GLSL_IDENTIFIER_UNIFORM[0]),
new AttributesDescriptor("Identifiers of Varyings",GLSLHighlighter.GLSL_IDENTIFIER_VARYING[0]),
new AttributesDescriptor("Identifiers of Attributes",GLSLHighlighter.GLSL_IDENTIFIER_ATTRIBUTE[0]),
new AttributesDescriptor("Text",GLSLHighlighter.GLSL_TEXT[0]),
new AttributesDescriptor("Directives",GLSLHighlighter.GLSL_PREPROCESSOR_DIRECTIVE[0])
};
Expand Down
2 changes: 2 additions & 0 deletions src/glslplugin/GLSLHighlighter.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public class GLSLHighlighter extends SyntaxHighlighterBase {
{ TextAttributesKey.createTextAttributesKey("GLSL.IDENTIFIER.UNIFORM", GLSL_IDENTIFIER[0]) };
public static final TextAttributesKey[] GLSL_IDENTIFIER_VARYING =
{ TextAttributesKey.createTextAttributesKey("GLSL.IDENTIFIER.VARYING", GLSL_IDENTIFIER[0]) };
public static final TextAttributesKey[] GLSL_IDENTIFIER_ATTRIBUTE =
{ TextAttributesKey.createTextAttributesKey("GLSL.IDENTIFIER.ATTRIBUTE", GLSL_IDENTIFIER[0]) };
static final TextAttributesKey[] GLSL_PREPROCESSOR_DIRECTIVE =
{ TextAttributesKey.createTextAttributesKey("GLSL.PREPROCESSOR_DIRECTIVE", DefaultLanguageHighlighterColors.METADATA) };
public static final TextAttributesKey[] GLSL_REDEFINED_TOKEN =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public void annotate(GLSLIdentifierExpression expr, AnnotationHolder holder) {
} else if (qualifiedType.hasQualifier(GLSLQualifier.Qualifier.VARYING)) {
Annotation annotation = holder.createAnnotation(HighlightSeverity.INFORMATION, expr.getTextRange(), null);
annotation.setTextAttributes(GLSLHighlighter.GLSL_IDENTIFIER_VARYING[0]);
} else if (qualifiedType.hasQualifier(GLSLQualifier.Qualifier.ATTRIBUTE)) {
Annotation annotation = holder.createAnnotation(HighlightSeverity.INFORMATION, expr.getTextRange(), null);
annotation.setTextAttributes(GLSLHighlighter.GLSL_IDENTIFIER_ATTRIBUTE[0]);
}
}

Expand Down

0 comments on commit 61f7dbb

Please sign in to comment.