Search in sources :

Example 6 with SpellCheckingInspection

use of com.intellij.spellchecker.inspections.SpellCheckingInspection in project intellij-plugins by JetBrains.

the class ActionScriptHighlightingTest method runRenameSpellcheckerFixWithChooseVariant.

private void runRenameSpellcheckerFixWithChooseVariant(String variantName) throws Exception {
    TemplateManagerImpl.setTemplateTesting(getProject(), getTestRootDisposable());
    enableInspectionTool(new SpellCheckingInspection());
    doSimpleHighlightingWithInvokeFixAndCheckResult("Typo: Rename to...");
    final LookupEx lookup = LookupManager.getActiveLookup(myEditor);
    assertNotNull(lookup);
    boolean selected = false;
    for (LookupElement l : lookup.getItems()) {
        if (variantName.equals(l.getLookupString())) {
            selected = true;
            ((LookupImpl) lookup).finishLookup(Lookup.AUTO_INSERT_SELECT_CHAR, l);
        }
    }
    assertTrue(selected);
    LookupManager.getInstance(myProject).hideActiveLookup();
    checkResultByFile(BASE_PATH + getTestName(false) + "_after2.js2");
}
Also used : LookupImpl(com.intellij.codeInsight.lookup.impl.LookupImpl) SpellCheckingInspection(com.intellij.spellchecker.inspections.SpellCheckingInspection) LookupEx(com.intellij.codeInsight.lookup.LookupEx) LookupElement(com.intellij.codeInsight.lookup.LookupElement)

Example 7 with SpellCheckingInspection

use of com.intellij.spellchecker.inspections.SpellCheckingInspection in project intellij-plugins by JetBrains.

the class FlexHighlightingTest method testSpellChecker.

@JSTestOptions(JSTestOption.WithFlexSdk)
public void testSpellChecker() throws Exception {
    enableInspectionTool(new SpellCheckingInspection());
    configureByFile(getBasePath() + "/" + getTestName(false) + ".mxml");
    ExpectedHighlightingData expectedHighlightingData = new ExpectedHighlightingData(myEditor.getDocument(), true, true, false, myFile);
    Collection<HighlightInfo> infoCollection = checkHighlighting(expectedHighlightingData);
    assertEquals(1, countNonInformationHighlights(infoCollection));
    findAndInvokeActionWithExpectedCheck("Typo: Rename to...", "mxml", infoCollection);
}
Also used : SpellCheckingInspection(com.intellij.spellchecker.inspections.SpellCheckingInspection) ExpectedHighlightingData(com.intellij.testFramework.ExpectedHighlightingData) HighlightInfo(com.intellij.codeInsight.daemon.impl.HighlightInfo)

Example 8 with SpellCheckingInspection

use of com.intellij.spellchecker.inspections.SpellCheckingInspection in project intellij-community by JetBrains.

the class PropertiesSpellcheckingTest method testPropertiesSpellcheckingStrategy.

public void testPropertiesSpellcheckingStrategy() {
    myFixture.enableInspections(new SpellCheckingInspection());
    myFixture.configureByText("test.properties", "valid.key=value\n" + "# comment is <TYPO descr=\"Typo: In word 'cheked'\">cheked</TYPO>\n" + "validWord<TYPO descr=\"Typo: In word 'Buuundary'\">Buuundary</TYPO>=value\n" + "i3<TYPO descr=\"Typo: In word 'nvalid'\">nvalid</TYPO>.key=i3<TYPO descr=\"Typo: In word 'nvalid'\">nvalid</TYPO>Value");
    myFixture.testHighlighting();
}
Also used : SpellCheckingInspection(com.intellij.spellchecker.inspections.SpellCheckingInspection)

Aggregations

SpellCheckingInspection (com.intellij.spellchecker.inspections.SpellCheckingInspection)8 HighlightInfo (com.intellij.codeInsight.daemon.impl.HighlightInfo)1 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1 LookupEx (com.intellij.codeInsight.lookup.LookupEx)1 LookupImpl (com.intellij.codeInsight.lookup.impl.LookupImpl)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ExpectedHighlightingData (com.intellij.testFramework.ExpectedHighlightingData)1 EditorCustomization (com.intellij.ui.EditorCustomization)1