Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
  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;
  }
Ejemplo n.º 3
0
 public void hidesOtherDeclaration(LfGlobalVariable variable) {
   holder
       .createWarningAnnotation(
           variable, TwelfBundle.message("warning.hides.other.declaration", variable.getName()))
       .setHighlightType(ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
 }