mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-130964 Spell check in commit dialog only works if enabled in inspection
This commit is contained in:
+4
-1
@@ -150,6 +150,9 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
private boolean myAllowDirt;
|
||||
private boolean myCaresAboutInjection = true;
|
||||
|
||||
// this allows an inspection to be represented in profile, but to appear disabled
|
||||
public final Set<String> myDisabledInspections = new HashSet<String>();
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public CodeInsightTestFixtureImpl(@NotNull IdeaProjectTestFixture projectFixture, @NotNull TempDirTestFixture tempDirTestFixture) {
|
||||
myProjectFixture = projectFixture;
|
||||
@@ -1268,7 +1271,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
|
||||
@Override
|
||||
public boolean isToolEnabled(HighlightDisplayKey key, PsiElement element) {
|
||||
return key != null && key.toString() != null && myAvailableTools.containsKey(key.toString());
|
||||
return key != null && key.toString() != null && myAvailableTools.containsKey(key.toString()) && !myDisabledInspections.contains(key.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -154,7 +154,7 @@ public class SpellCheckingEditorCustomization extends SimpleEditorCustomization
|
||||
|
||||
@Override
|
||||
public boolean isToolEnabled(HighlightDisplayKey key, PsiElement element) {
|
||||
return myDelegate.isToolEnabled(key, element) && SPELL_CHECK_TOOLS.containsKey(key.toString()) && myUseSpellCheck;
|
||||
return SPELL_CHECK_TOOLS.containsKey(key.toString()) && myUseSpellCheck;
|
||||
}
|
||||
|
||||
public void setUseSpellCheck(boolean useSpellCheck) {
|
||||
|
||||
+6
@@ -20,6 +20,7 @@ import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.fileTypes.PlainTextFileType;
|
||||
import com.intellij.spellchecker.inspections.SpellCheckingInspection;
|
||||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
|
||||
import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;
|
||||
|
||||
public class SpellCheckingEditorCustomizationTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
public void testEnabled() throws Exception {
|
||||
@@ -30,6 +31,11 @@ public class SpellCheckingEditorCustomizationTest extends LightPlatformCodeInsig
|
||||
doTest(false, "missspelling");
|
||||
}
|
||||
|
||||
public void testEnabledEvenIfDisabledInMainProfile() throws Exception {
|
||||
((CodeInsightTestFixtureImpl)myFixture).myDisabledInspections.add(SpellCheckingInspection.SPELL_CHECKING_INSPECTION_TOOL_NAME);
|
||||
testEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isWriteActionRequired() {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user