Examples of registerFix()


Examples of com.intellij.lang.annotation.Annotation.registerFix()

        annotation.setEnforcedTextAttributes(new TextAttributes(null, null, JBColor.MAGENTA, EffectType.WAVE_UNDERSCORE, Font.PLAIN));

        annotation.registerFix(new SuppressReportBugIntentionAction(problemDescriptor), textRange);
        annotation.registerFix(new SuppressReportBugForClassIntentionAction(problemDescriptor), textRange);
        annotation.registerFix(new ClearBugIntentionAction(problemDescriptor), textRange);
        annotation.registerFix(new ClearAndSuppressBugIntentionAction(problemDescriptor), textRange);

        break;
      default:
        throw new IllegalArgumentException("Unknown bugInstance.getPriority() == " + priority);
    }
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

      final TextRange range = new TextRange(absoluteOffset, absoluteOffset + word.length());
      final Annotation annotation = holder.createInfoAnnotation(range, null);
      final String attributeName = definitions.contains(word) ? HaxeSyntaxHighlighterColors.HAXE_DEFINED_VAR
                                                              : HaxeSyntaxHighlighterColors.HAXE_UNDEFINED_VAR;
      annotation.setTextAttributes(TextAttributesKey.find(attributeName));
      annotation.registerFix(new HaxeDefineIntention(word, definitions.contains(word)), range);
    }
  }

  private static boolean isNewOperator(PsiElement element) {
    return HaxeTokenTypes.ONEW.toString().equals(element.getText()) &&
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

        // clean warning; we dont want tooltip, but popover menu entry; @TODO: direct call possible?
        annotationHolder.setHighlightType(ProblemHighlightType.INFORMATION);
        annotationHolder.setTooltip(null);

        for(PhpClass phpClass: phpClasses) {
            annotationHolder.registerFix(new CreatePropertyQuickFix(phpDocTag, "\\" + phpClass.getPresentableFQN()));
        }

    }

    private static class CreatePropertyQuickFix extends BaseIntentionAction {
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

        String closeBlockName = closeBlockMustacheName.getName();
        if (!openBlockName.equals(closeBlockName)) {
          Annotation openBlockAnnotation
            = holder.createErrorAnnotation(openBlockMustacheName,
                                           HbBundle.message("hb.block.mismatch.inspection.open.block", openBlockName, closeBlockName));
          openBlockAnnotation.registerFix(new HbBlockMismatchFix(closeBlockName, openBlockName, true));
          openBlockAnnotation.registerFix(new HbBlockMismatchFix(openBlockName, closeBlockName, false));

          Annotation closeBlockAnnotation
            = holder.createErrorAnnotation(closeBlockMustacheName,
                                           HbBundle.message("hb.block.mismatch.inspection.close.block", openBlockName, closeBlockName));
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

        if (!openBlockName.equals(closeBlockName)) {
          Annotation openBlockAnnotation
            = holder.createErrorAnnotation(openBlockMustacheName,
                                           HbBundle.message("hb.block.mismatch.inspection.open.block", openBlockName, closeBlockName));
          openBlockAnnotation.registerFix(new HbBlockMismatchFix(closeBlockName, openBlockName, true));
          openBlockAnnotation.registerFix(new HbBlockMismatchFix(openBlockName, closeBlockName, false));

          Annotation closeBlockAnnotation
            = holder.createErrorAnnotation(closeBlockMustacheName,
                                           HbBundle.message("hb.block.mismatch.inspection.close.block", openBlockName, closeBlockName));
          closeBlockAnnotation.registerFix(new HbBlockMismatchFix(openBlockName, closeBlockName, false));
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

          openBlockAnnotation.registerFix(new HbBlockMismatchFix(openBlockName, closeBlockName, false));

          Annotation closeBlockAnnotation
            = holder.createErrorAnnotation(closeBlockMustacheName,
                                           HbBundle.message("hb.block.mismatch.inspection.close.block", openBlockName, closeBlockName));
          closeBlockAnnotation.registerFix(new HbBlockMismatchFix(openBlockName, closeBlockName, false));
          closeBlockAnnotation.registerFix(new HbBlockMismatchFix(closeBlockName, openBlockName, true));
        }
      }
      else {
        holder.createErrorAnnotation(openBlockMustacheName,
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

          Annotation closeBlockAnnotation
            = holder.createErrorAnnotation(closeBlockMustacheName,
                                           HbBundle.message("hb.block.mismatch.inspection.close.block", openBlockName, closeBlockName));
          closeBlockAnnotation.registerFix(new HbBlockMismatchFix(openBlockName, closeBlockName, false));
          closeBlockAnnotation.registerFix(new HbBlockMismatchFix(closeBlockName, openBlockName, true));
        }
      }
      else {
        holder.createErrorAnnotation(openBlockMustacheName,
                                     HbBundle.message("hb.block.mismatch.inspection.missing.end.block", openBlockMustache.getName()));
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

                                     StrutsBundle.message("annotators.fileset.no.file.sets"));
    annotation.setFileLevelAnnotation(true);

    if (fileSetAvailable) {
      final AddToFileSetFix addToFileSetFix = new AddToFileSetFix(xmlFile.getName());
      annotation.registerFix(addToFileSetFix);
    }
    else {
      annotation.registerFix(new IntentionAction() {
        @NotNull
        public String getText() {
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

    if (fileSetAvailable) {
      final AddToFileSetFix addToFileSetFix = new AddToFileSetFix(xmlFile.getName());
      annotation.registerFix(addToFileSetFix);
    }
    else {
      annotation.registerFix(new IntentionAction() {
        @NotNull
        public String getText() {
          return StrutsBundle.message("annotators.fileset.edit.facet.settings");
        }
View Full Code Here

Examples of com.intellij.lang.annotation.Annotation.registerFix()

        annotateKeyValueWithInnerFileSequence(keyValue, holder, basePathInfo.getBasePath());
      }
    }
    if (!visitedKeys.contains("test")) {
      Annotation annotation = holder.createWeakWarningAnnotation(yamlDocument, "JsTestDriver configuration file should have 'test:' section");
      annotation.registerFix(new AddTestSectionAction());
    }
  }

  private static void markStrangeSymbols(@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) {
    TextRange textRange = psiElement.getTextRange();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.