mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
[java] IDEA-190628 Disable spell checking for resolved Maven dependencies
GitOrigin-RevId: 40e59f0aebd77614cd7c8ffd76aa19e72f15c3a4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f4a5e969a6
commit
7e849e9dd3
@@ -6,7 +6,7 @@
|
||||
<extensionPoint name="spellchecker.bundledDictionaryProvider" interface="com.intellij.spellchecker.BundledDictionaryProvider" dynamic="true"/>
|
||||
<extensionPoint name="spellchecker.dictionary.customDictionaryProvider" interface="com.intellij.spellchecker.dictionary.CustomDictionaryProvider" dynamic="true"/>
|
||||
<extensionPoint name="spellchecker.dictionary.runtimeDictionaryProvider" interface="com.intellij.spellchecker.dictionary.RuntimeDictionaryProvider" dynamic="true"/>
|
||||
<extensionPoint name="spellchecker.dictionary.checker" interface="com.intellij.spellchecker.dictionary.DictionaryCheckerProvider" dynamic="true"/>
|
||||
<extensionPoint name="spellchecker.dictionary.checker" interface="com.intellij.spellchecker.dictionary.DictionaryChecker" dynamic="true"/>
|
||||
</extensionPoints>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
||||
@@ -62,15 +62,6 @@ class SpellCheckerManager(val project: Project) : Disposable {
|
||||
|
||||
private val userDictionaryListenerEventDispatcher = EventDispatcher.create(DictionaryStateListener::class.java)
|
||||
|
||||
@Volatile
|
||||
private var dictionaryCheckers: List<DictionaryChecker>? = null
|
||||
|
||||
init {
|
||||
DictionaryCheckerProvider.EP_NAME.addChangeListener(Runnable {
|
||||
dictionaryCheckers = null
|
||||
}, this)
|
||||
}
|
||||
|
||||
// used in Rider
|
||||
@get:Suppress("unused")
|
||||
var spellChecker: SpellCheckerEngine? = null
|
||||
@@ -243,13 +234,7 @@ class SpellCheckerManager(val project: Project) : Disposable {
|
||||
}
|
||||
|
||||
private fun isCorrectExtensionWord(word: String): Boolean {
|
||||
var currentCheckers = dictionaryCheckers
|
||||
if (currentCheckers == null) {
|
||||
currentCheckers = DictionaryCheckerProvider.EP_NAME.extensionList.map { it.getChecker(project) }
|
||||
dictionaryCheckers = currentCheckers
|
||||
}
|
||||
|
||||
return currentCheckers.any { it.isCorrect(word) }
|
||||
return DictionaryChecker.EP_NAME.extensionList.any { it.isCorrect(project, word) }
|
||||
}
|
||||
|
||||
fun acceptWordAsCorrect(word: String, project: Project) {
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.spellchecker.dictionary;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Checks if words are correct in the context of Project.
|
||||
*
|
||||
* @see DictionaryCheckerProvider
|
||||
*/
|
||||
public interface DictionaryChecker {
|
||||
boolean isCorrect(@NotNull String word);
|
||||
ExtensionPointName<DictionaryChecker> EP_NAME =
|
||||
new ExtensionPointName<>("com.intellij.spellchecker.dictionary.checker");
|
||||
|
||||
boolean isCorrect(@NotNull Project project, @NotNull String word);
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.spellchecker.dictionary;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Provides dictionaries that are always project-bound, e.g. provide names of libraries used in the Project.
|
||||
*/
|
||||
public interface DictionaryCheckerProvider {
|
||||
ExtensionPointName<DictionaryCheckerProvider> EP_NAME =
|
||||
new ExtensionPointName<>("com.intellij.spellchecker.dictionary.checker");
|
||||
|
||||
@NotNull DictionaryChecker getChecker(@NotNull Project project);
|
||||
}
|
||||
Reference in New Issue
Block a user