use of org.elixir_lang.annotator.Parameter in project intellij-elixir by KronicDeth.
the class Variable method icon.
@Contract(pure = true)
@Nullable
private Icon icon(@NotNull PsiElement element) {
Icon icon = null;
Parameter parameter = new Parameter(element);
Parameter.Type parameterType = Parameter.putParameterized(parameter).type;
if (parameterType != null) {
icon = Icons.PARAMETER;
} else {
icon = Icons.VARIABLE;
}
return icon;
}
use of org.elixir_lang.annotator.Parameter in project intellij-elixir by KronicDeth.
the class Variable method color.
/*
* Private Instance Methods
*/
@Contract(pure = true)
@NotNull
private Color color(@NotNull final PsiElement element) {
Color color = JBColor.foreground();
if (isIgnored(element)) {
color = ElixirSyntaxHighlighter.IGNORED_VARIABLE.getDefaultAttributes().getForegroundColor();
} else {
Parameter parameter = new Parameter(element);
Parameter.Type parameterType = Parameter.putParameterized(parameter).type;
if (parameterType != null) {
if (parameterType == Parameter.Type.VARIABLE) {
color = ElixirSyntaxHighlighter.PARAMETER.getDefaultAttributes().getForegroundColor();
}
} else if (isParameterWithDefault(element)) {
color = ElixirSyntaxHighlighter.PARAMETER.getDefaultAttributes().getForegroundColor();
} else if (isVariable(element)) {
color = ElixirSyntaxHighlighter.VARIABLE.getDefaultAttributes().getForegroundColor();
}
}
return color;
}