mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
[injections] IJPL-211956 IJ-CR-178552 renamed extension point to fallbackInjectorSuppressor
(cherry picked from commit ad16471c0fa380476e181c218d7dff285b17904c) IJ-CR-180155 GitOrigin-RevId: 0a5f0009afde76f24d47d5e2ef988e2c147f5f16
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9c9c1ae725
commit
1e016f4bf5
@@ -1,4 +1,4 @@
|
||||
*:org.intellij.plugins.intelliLang.inject.DefaultInjectorSuppressor
|
||||
*:org.intellij.plugins.intelliLang.inject.FallbackInjectorSuppressor
|
||||
- a:isSuppressedFor(com.intellij.psi.PsiElement):Z
|
||||
f:org.intellij.plugins.intelliLang.references.LanguageInjectionUtil
|
||||
- *f:commentBody(com.intellij.psi.PsiComment):java.lang.String
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
interface="org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport" dynamic="true"/>
|
||||
<extensionPoint qualifiedName="org.intellij.intelliLang.injectionConfig"
|
||||
beanClass="org.intellij.plugins.intelliLang.LanguageInjectionConfigBean" dynamic="true"/>
|
||||
<extensionPoint qualifiedName="org.intellij.intelliLang.defaultInjectorSuppressor"
|
||||
<extensionPoint qualifiedName="org.intellij.intelliLang.fallbackInjectorSuppressor"
|
||||
beanClass="com.intellij.openapi.util.ClassExtensionPoint"
|
||||
dynamic="true">
|
||||
<with attribute="implementationClass"
|
||||
implements="org.intellij.plugins.intelliLang.inject.DefaultInjectorSuppressor"/>
|
||||
implements="org.intellij.plugins.intelliLang.inject.FallbackInjectorSuppressor"/>
|
||||
</extensionPoint>
|
||||
</extensionPoints>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ final class DefaultLanguageInjectionPerformer implements FallbackInjectionPerfor
|
||||
public boolean performInjection(@NotNull MultiHostRegistrar registrar,
|
||||
@NotNull Injection injection,
|
||||
@NotNull PsiElement context) {
|
||||
if (!(context instanceof PsiLanguageInjectionHost host) || !host.isValidHost() || DefaultInjectorSuppressorKt.isSuppressedFor(host)) {
|
||||
if (!(context instanceof PsiLanguageInjectionHost host) || !host.isValidHost() || FallbackInjectorSuppressorKt.isSuppressedFor(host)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ import com.intellij.lang.LanguageExtension
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
private val EP = LanguageExtension<DefaultInjectorSuppressor>("org.intellij.intelliLang.defaultInjectorSuppressor")
|
||||
private val EP = LanguageExtension<FallbackInjectorSuppressor>("org.intellij.intelliLang.fallbackInjectorSuppressor")
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun isSuppressedFor(contextElement: PsiElement): Boolean = EP.allForLanguage(contextElement.language).any { it.isSuppressedFor(contextElement) }
|
||||
|
||||
/**
|
||||
* This extension allows you to suppress injections by [DefaultLanguageInjector].
|
||||
* This extension allows you to suppress injections by [DefaultLanguageInjectionPerformer] in [DefaultLanguageInjector].
|
||||
*
|
||||
* Possible use case:
|
||||
*
|
||||
@@ -24,6 +24,6 @@ fun isSuppressedFor(contextElement: PsiElement): Boolean = EP.allForLanguage(con
|
||||
* tasks to the backend. Note that this approach may introduce latency depending on network conditions.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
interface DefaultInjectorSuppressor {
|
||||
interface FallbackInjectorSuppressor {
|
||||
fun isSuppressedFor(contextElement: PsiElement): Boolean
|
||||
}
|
||||
Reference in New Issue
Block a user