public void hidesOtherDeclaration(LfGlobalVariable variable, TwelfConfigFile linkedVia) { // todo not allowed holder .createWarningAnnotation( variable, TwelfBundle.message( "warning.hides.other.declaration.linked", variable.getName(), linkedVia.getName())) .setHighlightType(ProblemHighlightType.GENERIC_ERROR_OR_WARNING); }
private Map<String, LfGlobalVariable> findGlobalVariablesBefore() { Map<String, LfGlobalVariable> globalVariablesBefore = new LinkedHashMap<String, LfGlobalVariable>(); PsiElement element = this; do { element = element.getPrevSibling(); if (element instanceof GlobalVariableBinder) { LfGlobalVariable declaration = ((GlobalVariableBinder) element).getDeclaration(); globalVariablesBefore.put(declaration.getName(), declaration); } if (element instanceof TwelfStatement) { // short circuiting for TwelfStatement as an optimization globalVariablesBefore.putAll(((TwelfStatement) element).getGlobalVariablesBefore()); return globalVariablesBefore; } } while (element != null); return globalVariablesBefore; }
public void hidesOtherDeclaration(LfGlobalVariable variable) { holder .createWarningAnnotation( variable, TwelfBundle.message("warning.hides.other.declaration", variable.getName())) .setHighlightType(ProblemHighlightType.GENERIC_ERROR_OR_WARNING); }