diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-21 00:31:02 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-08-16 04:55:08 +0000 |
commit | 9cde0e3c015174898df8b8f3672185941fad4786 (patch) | |
tree | 80a55c7b59c38377216daaada4e8bc47b69ceb9a /spellchecker | |
parent | 3b37877a2561bf9fbe072253a18688807d523505 (diff) | |
parent | d76e3920c56d37c942092b7dca20fcaded81c0a5 (diff) | |
download | idea-9cde0e3c015174898df8b8f3672185941fad4786.tar.gz |
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'spellchecker')
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; } |