use of com.intellij.codeInspection.SuppressableProblemGroup in project kotlin by JetBrains.
the class AbstractQuickFixTest method findActionWithText.
@Override
protected IntentionAction findActionWithText(String text) {
IntentionAction intention = super.findActionWithText(text);
if (intention != null)
return intention;
// Support warning suppression
int caretOffset = myEditor.getCaretModel().getOffset();
for (HighlightInfo highlight : doHighlighting()) {
if (highlight.startOffset <= caretOffset && caretOffset <= highlight.endOffset) {
ProblemGroup group = highlight.getProblemGroup();
if (group instanceof SuppressableProblemGroup) {
SuppressableProblemGroup problemGroup = (SuppressableProblemGroup) group;
PsiElement at = getFile().findElementAt(highlight.getActualStartOffset());
SuppressIntentionAction[] actions = problemGroup.getSuppressActions(at);
for (SuppressIntentionAction action : actions) {
if (action.getText().equals(text)) {
return action;
}
}
}
}
}
return null;
}
Aggregations