public static void createProblem(@NotNull PsiElement elt, @NotNull HighlightInfo info, TextRange range, @Nullable ProblemGroup problemGroup, @NotNull InspectionManager manager, @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor, @NotNull GlobalInspectionContext globalContext) { List<LocalQuickFix> fixes = new ArrayList<LocalQuickFix>(); if (info.quickFixActionRanges != null) { for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> actionRange : info.quickFixActionRanges) { final IntentionAction action = actionRange.getFirst().getAction(); if (action instanceof LocalQuickFix) { fixes.add((LocalQuickFix)action); } } } ProblemDescriptor descriptor = manager.createProblemDescriptor(elt, range, createInspectionMessage(StringUtil.notNullize(info.getDescription())), HighlightInfo.convertType(info.type), false, fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[fixes.size()])); descriptor.setProblemGroup(problemGroup); problemDescriptionsProcessor.addProblemElement( GlobalInspectionContextUtil.retrieveRefElement(elt, globalContext), descriptor ); }
public static void createProblem(PsiElement elt, @NotNull HighlightInfo info, TextRange range, @Nullable ProblemGroup problemGroup, @NotNull InspectionManager manager, @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor, @NotNull GlobalInspectionContext globalContext) { List<LocalQuickFix> fixes = new ArrayList<LocalQuickFix>(); if (info.quickFixActionRanges != null) { for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> actionRange : info.quickFixActionRanges) { final IntentionAction action = actionRange.getFirst().getAction(); if (action instanceof LocalQuickFix) { fixes.add((LocalQuickFix)action); } } } ProblemDescriptor descriptor = manager.createProblemDescriptor(elt, range, createInspectionMessage(StringUtil.notNullize(info.getDescription())), HighlightInfo.convertType(info.type), false, fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[fixes.size()])); descriptor.setProblemGroup(problemGroup); problemDescriptionsProcessor.addProblemElement( GlobalInspectionContextUtil.retrieveRefElement(elt, globalContext), descriptor ); }
public static void createProblem(@Nonnull PsiElement elt, @Nonnull HighlightInfo info, TextRange range, @Nullable ProblemGroup problemGroup, @Nonnull InspectionManager manager, @Nonnull ProblemDescriptionsProcessor problemDescriptionsProcessor, @Nonnull GlobalInspectionContext globalContext) { List<LocalQuickFix> fixes = new ArrayList<LocalQuickFix>(); if (info.quickFixActionRanges != null) { for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> actionRange : info.quickFixActionRanges) { final IntentionAction action = actionRange.getFirst().getAction(); if (action instanceof LocalQuickFix) { fixes.add((LocalQuickFix)action); } } } ProblemDescriptor descriptor = manager.createProblemDescriptor(elt, range, createInspectionMessage(StringUtil.notNullize(info.getDescription())), HighlightInfo.convertType(info.type), false, fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[fixes.size()])); descriptor.setProblemGroup(problemGroup); problemDescriptionsProcessor.addProblemElement( GlobalInspectionContextUtil.retrieveRefElement(elt, globalContext), descriptor ); }
HighlightInfo(@Nullable TextAttributes forcedTextAttributes, @Nullable TextAttributesKey forcedTextAttributesKey, @NotNull HighlightInfoType type, int startOffset, int endOffset, @Nullable String escapedDescription, @Nullable String escapedToolTip, @NotNull HighlightSeverity severity, boolean afterEndOfLine, @Nullable Boolean needsUpdateOnTyping, boolean isFileLevelAnnotation, int navigationShift, ProblemGroup problemGroup, GutterMark gutterIconRenderer) { if (startOffset < 0 || startOffset > endOffset) { LOG.error("Incorrect highlightInfo bounds. description="+escapedDescription+"; startOffset="+startOffset+"; endOffset="+endOffset+";type="+type); } this.forcedTextAttributes = forcedTextAttributes; this.forcedTextAttributesKey = forcedTextAttributesKey; this.type = type; this.startOffset = startOffset; this.endOffset = endOffset; fixStartOffset = startOffset; fixEndOffset = endOffset; description = escapedDescription; // optimisation: do not retain extra memory if can recompute toolTip = encodeTooltip(escapedToolTip, escapedDescription); this.severity = severity; setFlag(AFTER_END_OF_LINE_MASK, afterEndOfLine); setFlag(NEEDS_UPDATE_ON_TYPING_MASK, calcNeedUpdateOnTyping(needsUpdateOnTyping, type)); setFlag(FILE_LEVEL_ANNOTATION_MASK, isFileLevelAnnotation); this.navigationShift = navigationShift; myProblemGroup = problemGroup; this.gutterIconRenderer = gutterIconRenderer; }
private IntentionActionDescriptor(@NotNull IntentionAction action, @Nullable final List<IntentionAction> options, @Nullable final String displayName, @Nullable Icon icon, @Nullable HighlightDisplayKey key, @Nullable ProblemGroup problemGroup, @Nullable HighlightSeverity severity) { myAction = action; myOptions = options; myDisplayName = displayName; myIcon = icon; myKey = key; myProblemGroup = problemGroup; mySeverity = severity; }
public IntentionActionDescriptor(@NotNull IntentionAction action, @Nullable final List<IntentionAction> options, @Nullable final String displayName, @Nullable Icon icon, @Nullable HighlightDisplayKey key, @Nullable ProblemGroup problemGroup) { myAction = action; myOptions = options; myDisplayName = displayName; myIcon = icon; myKey = key; myProblemGroup = problemGroup; }
HighlightInfo(@Nullable TextAttributes forcedTextAttributes, @Nullable TextAttributesKey forcedTextAttributesKey, @Nonnull HighlightInfoType type, int startOffset, int endOffset, @Nullable String escapedDescription, @Nullable String escapedToolTip, @Nonnull HighlightSeverity severity, boolean afterEndOfLine, @Nullable Boolean needsUpdateOnTyping, boolean isFileLevelAnnotation, int navigationShift, ProblemGroup problemGroup, GutterMark gutterIconRenderer) { if (startOffset < 0 || startOffset > endOffset) { LOG.error("Incorrect highlightInfo bounds. description="+escapedDescription+"; startOffset="+startOffset+"; endOffset="+endOffset+";type="+type); } this.forcedTextAttributes = forcedTextAttributes; this.forcedTextAttributesKey = forcedTextAttributesKey; this.type = type; this.startOffset = startOffset; this.endOffset = endOffset; fixStartOffset = startOffset; fixEndOffset = endOffset; description = escapedDescription; // optimisation: do not retain extra memory if can recompute toolTip = encodeTooltip(escapedToolTip, escapedDescription); this.severity = severity; setFlag(AFTER_END_OF_LINE_MASK, afterEndOfLine); setFlag(NEEDS_UPDATE_ON_TYPING_MASK, calcNeedUpdateOnTyping(needsUpdateOnTyping, type)); setFlag(FILE_LEVEL_ANNOTATION_MASK, isFileLevelAnnotation); this.navigationShift = navigationShift; myProblemGroup = problemGroup; this.gutterIconRenderer = gutterIconRenderer; }
public IntentionActionDescriptor(@Nonnull IntentionAction action, @Nullable final List<IntentionAction> options, @Nullable final String displayName, @Nullable Icon icon, @Nullable HighlightDisplayKey key, @Nullable ProblemGroup problemGroup, @Nullable HighlightSeverity severity) { myAction = action; myOptions = options; myDisplayName = displayName; myIcon = icon; myKey = key; myProblemGroup = problemGroup; mySeverity = severity; }
@Override @Nullable public ProblemGroup getProblemGroup() { return myProblemGroup; }
@Override public void setProblemGroup(@Nullable ProblemGroup problemGroup) { myProblemGroup = problemGroup; }
@Nullable public ProblemGroup getProblemGroup() { return myProblemGroup; }
@Nullable @Override public ProblemGroup getProblemGroup() { return myGroup; }
@Override public void setProblemGroup(@Nullable ProblemGroup problemGroup) { myGroup = problemGroup; }
public void setProblemGroup(@Nullable ProblemGroup problemGroup) { myProblemGroup = problemGroup; }
/** * Gets the unique object, which has the same {@link com.intellij.lang.annotation.ProblemGroup#getProblemName()} for all of the problems of this group * * @return the problem group */ @Nullable ProblemGroup getProblemGroup();
/** * Sets the unique object, which has the same {@link com.intellij.lang.annotation.ProblemGroup#getProblemName()} for all of the problems of this group * * @param problemGroup the problemGroup */ void setProblemGroup(@Nullable ProblemGroup problemGroup);
/** * Gets the unique object, which is the same for all of the problems of this group * * @return the problem group */ @Nullable ProblemGroup getProblemGroup();
/** * Sets the unique object, which is the same for all of the problems of this group * * @param problemGroup the problemGroup */ void setProblemGroup(@Nullable ProblemGroup problemGroup);