excluded unused intentions/inspections from doctest dialect

PY-8939 redundant inspections in doctests
This commit is contained in:
Ekaterina Tuzova
2013-02-20 14:30:30 +04:00
parent 2815efb76e
commit 925853fade
3 changed files with 6 additions and 1 deletions
@@ -2,6 +2,7 @@ package com.jetbrains.python.codeInsight.intentions;
import com.intellij.codeInsight.CodeInsightUtilBase;
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
import com.intellij.injected.editor.EditorWindow;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
@@ -36,6 +37,7 @@ public class PyGenerateDocstringIntention extends BaseIntentionAction {
}
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
if (editor instanceof EditorWindow) return false;
PsiElement elementAt = PyUtil.findNonWhitespaceAtOffset(file, editor.getCaretModel().getOffset());
if (elementAt == null) {
return false;
@@ -1,6 +1,7 @@
package com.jetbrains.python.codeInsight.intentions;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.injected.editor.EditorWindow;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -25,6 +26,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class TypeIntention implements IntentionAction {
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
if (editor instanceof EditorWindow) return false;
updateText(false);
PsiElement elementAt = PyUtil.findNonWhitespaceAtOffset(file, editor.getCaretModel().getOffset());
@@ -26,7 +26,8 @@ public class PyDocstringVisitorFilter implements PythonVisitorFilter {
visitorClass == PyUnboundLocalVariableInspection.class || visitorClass == PyUnnecessaryBackslashInspection.class ||
visitorClass == PyByteLiteralInspection.class || visitorClass == PyNonAsciiCharInspection.class ||
visitorClass == PyPackageRequirementsInspection.class || visitorClass == PyMandatoryEncodingInspection.class ||
visitorClass == PyInterpreterInspection.class) {
visitorClass == PyInterpreterInspection.class || visitorClass == PyDocstringTypesInspection.class ||
visitorClass == PySingleQuotedDocstringInspection.class) {
return false;
}
//annotators