diff options
Diffstat (limited to 'spellchecker/src/com/intellij')
4 files changed, 8 insertions, 22 deletions
diff --git a/spellchecker/src/com/intellij/spellchecker/inspections/SpellCheckingInspection.java b/spellchecker/src/com/intellij/spellchecker/inspections/SpellCheckingInspection.java index 1f2244995f68..e932a002beb1 100644 --- a/spellchecker/src/com/intellij/spellchecker/inspections/SpellCheckingInspection.java +++ b/spellchecker/src/com/intellij/spellchecker/inspections/SpellCheckingInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ import javax.swing.*; import java.awt.*; import java.util.Set; - public class SpellCheckingInspection extends LocalInspectionTool { public static final String SPELL_CHECKING_INSPECTION_TOOL_NAME = "SpellCheckingInspection"; @@ -161,14 +160,9 @@ public class SpellCheckingInspection extends LocalInspectionTool { tokenizer.tokenize(element, consumer); } - private static void addBatchDescriptor(PsiElement element, int offset, @NotNull TextRange textRange, @NotNull ProblemsHolder holder) { - final SpellcheckingStrategy strategy = getSpellcheckingStrategy(element, element.getLanguage()); - - SpellCheckerQuickFix[] fixes = strategy != null - ? strategy.getBatchFixes(element, offset, textRange) - : SpellcheckingStrategy.getDefaultBatchFixes(); - final ProblemDescriptor problemDescriptor = createProblemDescriptor(element, offset, textRange, holder, fixes, false); + SpellCheckerQuickFix[] fixes = SpellcheckingStrategy.getDefaultBatchFixes(); + ProblemDescriptor problemDescriptor = createProblemDescriptor(element, offset, textRange, holder, fixes, false); holder.registerProblem(problemDescriptor); } @@ -221,7 +215,6 @@ public class SpellCheckingInspection extends LocalInspectionTool { final JPanel panel = new JPanel(new BorderLayout()); panel.add(verticalBox, BorderLayout.NORTH); return panel; - } private static class MyTokenConsumer extends TokenConsumer implements Consumer<TextRange> { diff --git a/spellchecker/src/com/intellij/spellchecker/jetbrains.dic b/spellchecker/src/com/intellij/spellchecker/jetbrains.dic index bb2388b83709..45610cdbdf1c 100644 --- a/spellchecker/src/com/intellij/spellchecker/jetbrains.dic +++ b/spellchecker/src/com/intellij/spellchecker/jetbrains.dic @@ -96,6 +96,7 @@ dbcp dealloc deallocate deannotate +debuggable decompile decompiled decompiler diff --git a/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java b/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java index 206a5f9510e2..ad742c5a1510 100644 --- a/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java +++ b/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,11 +102,7 @@ public class RenameTo extends ShowSuggestions implements SpellCheckerQuickFix { } else if (ApplicationManager.getApplication().isUnitTestMode()) { // TextEditorComponent / FiledEditorManagerImpl give away the data in real life map.put( CommonDataKeys.PSI_ELEMENT.getName(), - new TextEditorPsiDataProvider().getData( - CommonDataKeys.PSI_ELEMENT.getName(), - editor, - containingFile.getVirtualFile() - ) + new TextEditorPsiDataProvider().getData(CommonDataKeys.PSI_ELEMENT.getName(), editor, editor.getCaretModel().getCurrentCaret()) ); } diff --git a/spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java b/spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java index 95cd1e0f0f4c..6d28563e062c 100644 --- a/spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java +++ b/spellchecker/src/com/intellij/spellchecker/tokenizer/SpellcheckingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,15 +72,11 @@ public class SpellcheckingStrategy { public static SpellCheckerQuickFix[] getDefaultRegularFixes(boolean useRename, String wordWithTypo) { return new SpellCheckerQuickFix[]{ - (useRename ? new RenameTo(wordWithTypo) : new ChangeTo(wordWithTypo)), + useRename ? new RenameTo(wordWithTypo) : new ChangeTo(wordWithTypo), new AcceptWordAsCorrect(wordWithTypo) }; } - public SpellCheckerQuickFix[] getBatchFixes(PsiElement element, int offset, @NotNull TextRange textRange) { - return getDefaultBatchFixes(); - } - public static SpellCheckerQuickFix[] getDefaultBatchFixes() { return BATCH_FIXES; } |