diff --git a/plugins/IntelliLang/api-dump-unreviewed.txt b/plugins/IntelliLang/api-dump-unreviewed.txt index abbdefa1b3f0..9cd4349ffd20 100644 --- a/plugins/IntelliLang/api-dump-unreviewed.txt +++ b/plugins/IntelliLang/api-dump-unreviewed.txt @@ -80,18 +80,6 @@ c:org.intellij.plugins.intelliLang.Configuration$Prj - getParentConfiguration():org.intellij.plugins.intelliLang.Configuration - p:invokeAfterReload(java.lang.Runnable):V - replaceInjections(java.util.List,java.util.List,Z):Z -f:org.intellij.plugins.intelliLang.InjectionsSettingsUI -- com.intellij.openapi.options.SearchableConfigurable$Parent$Abstract -- com.intellij.openapi.options.Configurable$NoScroll -- (com.intellij.openapi.project.Project):V -- apply():V -- createComponent():javax.swing.JComponent -- getDisplayName():java.lang.String -- getHelpTopic():java.lang.String -- getId():java.lang.String -- hasOwnContent():Z -- isModified():Z -- reset():V f:org.intellij.plugins.intelliLang.IntelliLangBundle - s:message(java.lang.String,java.lang.Object[]):java.lang.String - s:messagePointer(java.lang.String,java.lang.Object[]):java.util.function.Supplier @@ -118,30 +106,7 @@ a:org.intellij.plugins.intelliLang.inject.AbstractLanguageInjectionSupport - ps:showEditInjectionDialog(com.intellij.openapi.project.Project,org.intellij.plugins.intelliLang.inject.config.ui.AbstractInjectionPanel,java.lang.String,java.lang.String):Z - useDefaultCommentInjector():Z - useDefaultInjector(com.intellij.psi.PsiLanguageInjectionHost):Z -c:org.intellij.plugins.intelliLang.inject.CommentLanguageInjector -- com.intellij.lang.injection.general.LanguageInjectionContributor -- ():V -- getInjection(com.intellij.psi.PsiElement):com.intellij.lang.injection.general.Injection -f:org.intellij.plugins.intelliLang.inject.DefaultLanguageInjector -- com.intellij.lang.injection.general.LanguageInjectionContributor -- ():V -- getInjection(com.intellij.psi.PsiElement):com.intellij.lang.injection.general.Injection -c:org.intellij.plugins.intelliLang.inject.EditInjectionSettingsAction -- com.intellij.codeInsight.intention.IntentionAction -- com.intellij.codeInsight.intention.LowPriorityAction -- ():V -- getFamilyName():java.lang.String -- getText():java.lang.String -- invoke(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):V -- isAvailable(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):Z -- startInWriteAction():Z -c:org.intellij.plugins.intelliLang.inject.FrankensteinErrorFilter -- com.intellij.codeInsight.highlighting.HighlightErrorFilter -- com.intellij.codeInsight.daemon.impl.HighlightInfoFilter -- ():V -- accept(com.intellij.codeInsight.daemon.impl.HighlightInfo,com.intellij.psi.PsiFile):Z -- shouldHighlightErrorElement(com.intellij.psi.PsiErrorElement):Z -c:org.intellij.plugins.intelliLang.inject.InjectLanguageAction +f:org.intellij.plugins.intelliLang.inject.InjectLanguageAction - com.intellij.codeInsight.intention.IntentionAction - com.intellij.codeInsight.intention.LowPriorityAction - sf:FIX_KEY:com.intellij.openapi.util.Key @@ -149,7 +114,6 @@ c:org.intellij.plugins.intelliLang.inject.InjectLanguageAction - ():V - s:addFixer(com.intellij.psi.PsiLanguageInjectionHost,com.intellij.util.Processor,java.lang.String):V - s:doChooseLanguageToInject(com.intellij.openapi.editor.Editor,com.intellij.util.Processor):Z -- ps:findInjectionHost(com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):com.intellij.psi.PsiLanguageInjectionHost - generatePreview(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):com.intellij.codeInsight.intention.preview.IntentionPreviewInfo - s:getAllInjectables():java.util.List - getFamilyName():java.lang.String @@ -209,13 +173,7 @@ f:org.intellij.plugins.intelliLang.inject.InjectorUtils$InjectionInfo - host():com.intellij.psi.PsiLanguageInjectionHost - language():org.intellij.plugins.intelliLang.inject.InjectedLanguage - range():com.intellij.openapi.util.TextRange -f:org.intellij.plugins.intelliLang.inject.LanguageInjectionConfigBean -- myConfigUrl:java.lang.String -- ():V -- getConfigUrl():java.lang.String a:org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport -- sf:CONFIG_EP_NAME:com.intellij.openapi.extensions.ExtensionPointName -- sf:EP_NAME:com.intellij.openapi.extensions.ExtensionPointName - sf:INJECTOR_SUPPORT:com.intellij.openapi.util.Key - sf:SETTINGS_EDITOR:com.intellij.openapi.util.Key - sf:TEMPORARY_INJECTED_LANGUAGE:com.intellij.openapi.util.Key @@ -235,10 +193,6 @@ a:org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport - a:setupPresentation(org.intellij.plugins.intelliLang.inject.config.BaseInjection,com.intellij.ui.SimpleColoredText,Z):V - a:useDefaultCommentInjector():Z - a:useDefaultInjector(com.intellij.psi.PsiLanguageInjectionHost):Z -f:org.intellij.plugins.intelliLang.inject.TemporaryPlacesInjector -- com.intellij.lang.injection.general.LanguageInjectionContributor -- ():V -- getInjection(com.intellij.psi.PsiElement):com.intellij.lang.injection.general.Injection f:org.intellij.plugins.intelliLang.inject.TemporaryPlacesRegistry - sf:SUPPORT_ID:java.lang.String - (com.intellij.openapi.project.Project):V @@ -310,7 +264,7 @@ org.intellij.plugins.intelliLang.inject.config.Injection - a:acceptsPsiElement(com.intellij.psi.PsiElement):Z - a:getDisplayName():java.lang.String - a:getInjectedArea(com.intellij.psi.PsiElement):java.util.List -c:org.intellij.plugins.intelliLang.inject.config.InjectionPlace +f:org.intellij.plugins.intelliLang.inject.config.InjectionPlace - sf:ARRAY_FACTORY:com.intellij.util.ArrayFactory - sf:EMPTY_ARRAY:org.intellij.plugins.intelliLang.inject.config.InjectionPlace[] - (com.intellij.patterns.ElementPattern,Z):V @@ -338,20 +292,16 @@ a:org.intellij.plugins.intelliLang.inject.config.ui.AbstractInjectionPanel - f:reset():V - pa:resetImpl():V - p:updateTree():V -c:org.intellij.plugins.intelliLang.inject.config.ui.AdvancedPanel +f:org.intellij.plugins.intelliLang.inject.config.ui.AdvancedPanel - org.intellij.plugins.intelliLang.inject.config.ui.AbstractInjectionPanel - b:$$$getRootComponent$$$():javax.swing.JComponent - (com.intellij.openapi.project.Project,org.intellij.plugins.intelliLang.inject.config.BaseInjection):V -- p:apply(org.intellij.plugins.intelliLang.inject.config.BaseInjection):V - getComponent():javax.swing.JPanel -- p:resetImpl():V -c:org.intellij.plugins.intelliLang.inject.config.ui.BaseInjectionPanel +f:org.intellij.plugins.intelliLang.inject.config.ui.BaseInjectionPanel - org.intellij.plugins.intelliLang.inject.config.ui.AbstractInjectionPanel - b:$$$getRootComponent$$$():javax.swing.JComponent - (org.intellij.plugins.intelliLang.inject.config.BaseInjection,com.intellij.openapi.project.Project):V -- p:apply(org.intellij.plugins.intelliLang.inject.config.BaseInjection):V - getComponent():javax.swing.JPanel -- p:resetImpl():V org.intellij.plugins.intelliLang.inject.config.ui.InjectionPanel - a:addUpdater(java.lang.Runnable):V - a:apply():V @@ -360,56 +310,38 @@ org.intellij.plugins.intelliLang.inject.config.ui.InjectionPanel - a:init(org.intellij.plugins.intelliLang.inject.config.Injection):V - a:isModified():Z - a:reset():V -c:org.intellij.plugins.intelliLang.inject.config.ui.LanguagePanel +f:org.intellij.plugins.intelliLang.inject.config.ui.LanguagePanel - org.intellij.plugins.intelliLang.inject.config.ui.AbstractInjectionPanel - b:$$$getRootComponent$$$():javax.swing.JComponent - (com.intellij.openapi.project.Project,org.intellij.plugins.intelliLang.inject.config.BaseInjection):V -- p:apply(org.intellij.plugins.intelliLang.inject.config.BaseInjection):V - getComponent():javax.swing.JPanel - getLanguage():java.lang.String - getPrefix():java.lang.String - getSuffix():java.lang.String -- p:resetImpl():V - setLanguage(java.lang.String):V - setPrefix(java.lang.String):V - setSuffix(java.lang.String):V -c:org.intellij.plugins.intelliLang.inject.config.ui.ValueRegExpAnnotator +f:org.intellij.plugins.intelliLang.inject.config.ui.ValueRegExpAnnotator - com.intellij.lang.annotation.Annotator - sf:KEY:com.intellij.openapi.util.Key - ():V - annotate(com.intellij.psi.PsiElement,com.intellij.lang.annotation.AnnotationHolder):V -c:org.intellij.plugins.intelliLang.references.FileReferenceInjector +f:org.intellij.plugins.intelliLang.references.FileReferenceInjector - com.intellij.psi.injection.ReferenceInjector - ():V - getDisplayName():java.lang.String - getId():java.lang.String - getReferences(com.intellij.psi.PsiElement,com.intellij.util.ProcessingContext,com.intellij.openapi.util.TextRange):com.intellij.psi.PsiReference[] -c:org.intellij.plugins.intelliLang.references.InjectedReferencesContributor +f:org.intellij.plugins.intelliLang.references.InjectedReferencesContributor - com.intellij.psi.PsiReferenceContributor - ():V - s:getInjectedReferences(com.intellij.psi.PsiElement):com.intellij.psi.PsiReference[] - s:isInjected(com.intellij.psi.PsiReference):Z - registerReferenceProviders(com.intellij.psi.PsiReferenceRegistrar):V -c:org.intellij.plugins.intelliLang.references.InjectedReferencesInspection +f:org.intellij.plugins.intelliLang.references.InjectedReferencesInspection - com.intellij.codeInspection.LocalInspectionTool - ():V - buildVisitor(com.intellij.codeInspection.ProblemsHolder,Z):com.intellij.psi.PsiElementVisitor -f:org.intellij.plugins.intelliLang.references.LanguageCommentFolding -- com.intellij.lang.folding.FoldingBuilderEx -- ():V -- buildFoldRegions(com.intellij.psi.PsiElement,com.intellij.openapi.editor.Document,Z):com.intellij.lang.folding.FoldingDescriptor[] -- getPlaceholderText(com.intellij.lang.ASTNode):java.lang.String -- isCollapsedByDefault(com.intellij.lang.ASTNode):Z -f:org.intellij.plugins.intelliLang.references.LanguageReferenceContributor -- com.intellij.model.psi.PsiSymbolReferenceProvider -- ():V -- getReferences(com.intellij.model.psi.PsiExternalReferenceHost,com.intellij.model.psi.PsiSymbolReferenceHints):java.util.Collection -- getSearchRequests(com.intellij.openapi.project.Project,com.intellij.model.Symbol):java.util.Collection -f:org.intellij.plugins.intelliLang.references.LanguageWordInCommentCompletionContributor -- com.intellij.codeInsight.completion.CompletionContributor -- ():V -f:org.intellij.plugins.intelliLang.util.RegExpUtil -- s:getEnumValues(com.intellij.openapi.project.Project,java.lang.String):java.util.Set a:org.intellij.plugins.intelliLang.util.StringMatcher - sf:ANY:org.intellij.plugins.intelliLang.util.StringMatcher - sf:ANY_PATTERN:org.intellij.plugins.intelliLang.util.StringMatcher diff --git a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java index de4570977bb9..0f2657a6b172 100644 --- a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java +++ b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/RegExpEnumReference.java @@ -22,7 +22,6 @@ import com.intellij.psi.PsiLiteralExpression; import com.intellij.util.ArrayUtilRt; import com.intellij.util.PlatformIcons; import com.intellij.util.containers.ContainerUtil; -import org.intellij.plugins.intelliLang.util.RegExpUtil; import org.intellij.plugins.intelliLang.util.StringLiteralReference; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/RegExpUtil.java b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/RegExpUtil.java similarity index 96% rename from plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/RegExpUtil.java rename to plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/RegExpUtil.java index 1266f0d0ce4f..893a3f003ed4 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/RegExpUtil.java +++ b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/RegExpUtil.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.intellij.plugins.intelliLang.util; +package org.intellij.plugins.intelliLang.inject.java; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiFile; @@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable; import java.util.HashSet; import java.util.Set; -public final class RegExpUtil { +final class RegExpUtil { private RegExpUtil() { } diff --git a/plugins/IntelliLang/resources/META-INF/plugin.xml b/plugins/IntelliLang/resources/META-INF/plugin.xml index abc60c19fffe..f261e8607649 100644 --- a/plugins/IntelliLang/resources/META-INF/plugin.xml +++ b/plugins/IntelliLang/resources/META-INF/plugin.xml @@ -23,7 +23,7 @@ - + diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java index 0369ca377e97..68e5222b2600 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java @@ -28,6 +28,7 @@ import com.intellij.openapi.components.SettingsCategory; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.*; @@ -74,11 +75,15 @@ import java.util.*; */ public class Configuration extends SimpleModificationTracker implements PersistentStateComponent, ModificationTracker { static final Logger LOG = Logger.getInstance(Configuration.class.getName()); + + private static final ExtensionPointName + CONFIG_EP_NAME = ExtensionPointName.create("org.intellij.intelliLang.injectionConfig"); + private static final Condition LANGUAGE_INJECTION_CONDITION = o -> Language.findLanguageByID(o.getInjectedLanguageId()) != null; { - LanguageInjectionSupport.CONFIG_EP_NAME.addChangeListener(this::reloadInjections, null); + CONFIG_EP_NAME.addChangeListener(this::reloadInjections, null); LanguageInjectionSupport.EP_NAME.addChangeListener(this::reloadInjections, null); } @@ -331,7 +336,7 @@ public class Configuration extends SimpleModificationTracker implements Persiste private static List loadDefaultInjections() { final List cfgList = new ArrayList<>(); final Set visited = new HashSet<>(); - LanguageInjectionSupport.CONFIG_EP_NAME.processWithPluginDescriptor((configBean, pluginDescriptor) -> { + CONFIG_EP_NAME.processWithPluginDescriptor((configBean, pluginDescriptor) -> { final ClassLoader loader = pluginDescriptor.getClassLoader(); try { final Enumeration enumeration = loader.getResources(configBean.getConfigUrl()); diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/InjectionsSettingsUI.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/InjectionsSettingsUI.java index a1f728ba1795..450c921f84eb 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/InjectionsSettingsUI.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/InjectionsSettingsUI.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang; import com.intellij.icons.AllIcons; @@ -46,6 +46,7 @@ import org.intellij.plugins.intelliLang.inject.InjectorUtils; import org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport; import org.intellij.plugins.intelliLang.inject.config.BaseInjection; import org.intellij.plugins.intelliLang.inject.config.InjectionPlace; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -65,6 +66,7 @@ import java.util.function.Supplier; /** * @author Gregory.Shrago */ +@ApiStatus.Internal public final class InjectionsSettingsUI extends SearchableConfigurable.Parent.Abstract implements Configurable.NoScroll { private final Project myProject; private final CfgInfo[] myInfos; diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/LanguageInjectionConfigBean.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/LanguageInjectionConfigBean.java new file mode 100644 index 000000000000..cd8722e4823b --- /dev/null +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/LanguageInjectionConfigBean.java @@ -0,0 +1,17 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package org.intellij.plugins.intelliLang; + +import com.intellij.util.xmlb.annotations.Attribute; + +/** + * @author gregsh + */ +final class LanguageInjectionConfigBean { + @Attribute("config") + public String myConfigUrl; + + public String getConfigUrl() { + return myConfigUrl; + } +} + diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/CommentLanguageInjector.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/CommentLanguageInjector.java index d30193da6788..9a7a42c7631d 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/CommentLanguageInjector.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/CommentLanguageInjector.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject; import com.intellij.lang.injection.general.Injection; @@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; /** * @author gregsh */ -public class CommentLanguageInjector implements LanguageInjectionContributor { +final class CommentLanguageInjector implements LanguageInjectionContributor { @Nullable @Override diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjector.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjector.java index e0c997d4978d..bfaf6d7fc500 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjector.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjector.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject; @@ -10,7 +10,7 @@ import org.intellij.plugins.intelliLang.Configuration; import org.intellij.plugins.intelliLang.inject.config.BaseInjection; import org.jetbrains.annotations.NotNull; -public final class DefaultLanguageInjector implements LanguageInjectionContributor { +final class DefaultLanguageInjector implements LanguageInjectionContributor { @Override public Injection getInjection(@NotNull PsiElement context) { diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/EditInjectionSettingsAction.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/EditInjectionSettingsAction.java index d42c0d649b4e..99382f95600a 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/EditInjectionSettingsAction.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/EditInjectionSettingsAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject; @@ -23,7 +23,7 @@ import java.util.Collections; /** * @author Gregory.Shrago */ -public class EditInjectionSettingsAction implements IntentionAction, LowPriorityAction { +final class EditInjectionSettingsAction implements IntentionAction, LowPriorityAction { @Override @NotNull diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/FrankensteinErrorFilter.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/FrankensteinErrorFilter.java index 29727282c751..dd2cc247a904 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/FrankensteinErrorFilter.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/FrankensteinErrorFilter.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject; import com.intellij.codeInsight.daemon.impl.HighlightInfo; @@ -28,7 +14,7 @@ import org.jetbrains.annotations.Nullable; /** * @author Gregory.Shrago */ -public class FrankensteinErrorFilter extends HighlightErrorFilter implements HighlightInfoFilter { +final class FrankensteinErrorFilter extends HighlightErrorFilter implements HighlightInfoFilter { @Override public boolean shouldHighlightErrorElement(@NotNull PsiErrorElement element) { return !isFrankenstein(element.getContainingFile()); diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java index b4e0dd9b420e..721ae2cdec8d 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java @@ -63,7 +63,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class InjectLanguageAction implements IntentionAction, LowPriorityAction { +public final class InjectLanguageAction implements IntentionAction, LowPriorityAction { public static final String LAST_INJECTED_LANGUAGE = "LAST_INJECTED_LANGUAGE"; public static final Key> FIX_KEY = Key.create("inject fix key"); @@ -124,8 +124,8 @@ public class InjectLanguageAction implements IntentionAction, LowPriorityAction } @Nullable - protected static PsiLanguageInjectionHost findInjectionHost(@NotNull Editor editor, - @NotNull PsiFile file) { + private static PsiLanguageInjectionHost findInjectionHost(@NotNull Editor editor, + @NotNull PsiFile file) { if (editor instanceof EditorWindow) return null; int offset = editor.getCaretModel().getOffset(); diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/LanguageInjectionConfigBean.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/LanguageInjectionConfigBean.java deleted file mode 100644 index 1342530fb6b4..000000000000 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/LanguageInjectionConfigBean.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -package org.intellij.plugins.intelliLang.inject; - -import com.intellij.util.xmlb.annotations.Attribute; - -/** - * @author gregsh - */ -public final class LanguageInjectionConfigBean { - @Attribute("config") - public String myConfigUrl; - - public String getConfigUrl() { - return myConfigUrl; - } -} - diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/LanguageInjectionSupport.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/LanguageInjectionSupport.java index 5a67241db71e..3d89e3eea204 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/LanguageInjectionSupport.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/LanguageInjectionSupport.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject; import com.intellij.lang.Language; @@ -18,6 +18,7 @@ import com.intellij.util.Consumer; import org.intellij.plugins.intelliLang.Configuration; import org.intellij.plugins.intelliLang.inject.config.BaseInjection; import org.jdom.Element; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -31,8 +32,8 @@ import org.jetbrains.annotations.Nullable; * @see Configuration */ public abstract class LanguageInjectionSupport { + @ApiStatus.Internal public static final ExtensionPointName EP_NAME = ExtensionPointName.create("org.intellij.intelliLang.languageSupport"); - public static final ExtensionPointName CONFIG_EP_NAME = ExtensionPointName.create("org.intellij.intelliLang.injectionConfig"); public static final Key TEMPORARY_INJECTED_LANGUAGE = Key.create("TEMPORARY_INJECTED_LANGUAGE"); public static final Key INJECTOR_SUPPORT = Key.create("INJECTOR_SUPPORT"); diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryLanguageInjectionSupport.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryLanguageInjectionSupport.java index 32ef0b15d1ea..7f6de2019eb8 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryLanguageInjectionSupport.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryLanguageInjectionSupport.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject; import com.intellij.lang.Language; @@ -6,8 +6,7 @@ import com.intellij.psi.PsiLanguageInjectionHost; import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; - -class TemporaryLanguageInjectionSupport extends AbstractLanguageInjectionSupport { +final class TemporaryLanguageInjectionSupport extends AbstractLanguageInjectionSupport { @NotNull @Override diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryPlacesInjector.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryPlacesInjector.java index b858406098bc..c8ae57cc6893 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryPlacesInjector.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/TemporaryPlacesInjector.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject; import com.intellij.lang.Language; @@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable; /** * @author Gregory.Shrago */ -public final class TemporaryPlacesInjector implements LanguageInjectionContributor { +final class TemporaryPlacesInjector implements LanguageInjectionContributor { @Override public @Nullable Injection getInjection(@NotNull PsiElement context) { diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/InjectionPlace.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/InjectionPlace.java index 668f5d71ebf5..ab13dc12b29b 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/InjectionPlace.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/InjectionPlace.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject.config; @@ -24,7 +10,7 @@ import com.intellij.util.ArrayFactory; * @author Gregory.Shrago */ // todo inline class -public class InjectionPlace { +public final class InjectionPlace { public static final InjectionPlace[] EMPTY_ARRAY = new InjectionPlace[0]; diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/AdvancedPanel.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/AdvancedPanel.java index ecd8a41dfe7b..e0f36bfc3706 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/AdvancedPanel.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/AdvancedPanel.java @@ -24,7 +24,7 @@ import org.intellij.plugins.intelliLang.inject.config.BaseInjection; import javax.swing.*; -public class AdvancedPanel extends AbstractInjectionPanel { +public final class AdvancedPanel extends AbstractInjectionPanel { private JPanel myRoot; diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/BaseInjectionPanel.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/BaseInjectionPanel.java index 54e19348dd1a..9918310e430a 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/BaseInjectionPanel.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/BaseInjectionPanel.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2010 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject.config.ui; import com.intellij.openapi.editor.Document; @@ -42,7 +28,7 @@ import java.util.ArrayList; /** * @author Gregory.Shrago */ -public class BaseInjectionPanel extends AbstractInjectionPanel { +public final class BaseInjectionPanel extends AbstractInjectionPanel { // read by reflection LanguagePanel myLanguagePanel; diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/LanguagePanel.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/LanguagePanel.java index b5129a03666f..c02477e06c3f 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/LanguagePanel.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/LanguagePanel.java @@ -42,7 +42,7 @@ import java.awt.event.ItemListener; import java.util.Arrays; import java.util.Set; -public class LanguagePanel extends AbstractInjectionPanel { +public final class LanguagePanel extends AbstractInjectionPanel { private JPanel myRoot; private ComboBox<@Nls String> myLanguage; private EditorTextField myPrefix; diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/ValueRegExpAnnotator.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/ValueRegExpAnnotator.java index b5a590952410..771fd925d5d4 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/ValueRegExpAnnotator.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/config/ui/ValueRegExpAnnotator.java @@ -34,7 +34,7 @@ import org.jetbrains.annotations.NotNull; * Annotator that is used to validate the "Value-Pattern" textfield: The regex entered there should contain exactly * one capturing group that determines the text-range the configured language will be injected into. */ -public class ValueRegExpAnnotator implements Annotator { +public final class ValueRegExpAnnotator implements Annotator { public static final Key KEY = Key.create("IS_VALUE_REGEXP"); static { diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/FileReferenceInjector.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/FileReferenceInjector.java index a62e4f714781..1b8a1ad460b4 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/FileReferenceInjector.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/FileReferenceInjector.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2013 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.references; import com.intellij.openapi.util.TextRange; @@ -27,7 +13,7 @@ import org.jetbrains.annotations.NotNull; /** * @author Dmitry Avdeev */ -public class FileReferenceInjector extends ReferenceInjector { +public final class FileReferenceInjector extends ReferenceInjector { @NotNull @Override diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesContributor.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesContributor.java index e2ec2ea1428d..7b49e2eab846 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesContributor.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesContributor.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.references; import com.intellij.lang.injection.InjectedLanguageManager; @@ -31,7 +31,7 @@ import java.util.List; /** * @author Dmitry Avdeev */ -public class InjectedReferencesContributor extends PsiReferenceContributor { +public final class InjectedReferencesContributor extends PsiReferenceContributor { public static boolean isInjected(@Nullable PsiReference reference) { if (reference == null) return false; diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesInspection.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesInspection.java index 8f55d5789836..9bca1b60d6f4 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesInspection.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesInspection.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2013 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.references; import com.intellij.codeInspection.LocalInspectionTool; @@ -27,7 +13,7 @@ import java.util.List; /** * @author Dmitry Avdeev */ -public class InjectedReferencesInspection extends LocalInspectionTool { +public final class InjectedReferencesInspection extends LocalInspectionTool { @NotNull @Override public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) { diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/LanguageReferenceContributor.kt b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/LanguageReferenceContributor.kt index 26e1d0a554ca..26549ed0d970 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/LanguageReferenceContributor.kt +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/LanguageReferenceContributor.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.references import com.intellij.codeInsight.completion.* @@ -27,7 +27,7 @@ import com.intellij.util.text.findTextRange import org.intellij.plugins.intelliLang.inject.InjectLanguageAction import org.intellij.plugins.intelliLang.inject.InjectorUtils -class LanguageReferenceContributor : PsiSymbolReferenceProvider { +internal class LanguageReferenceContributor : PsiSymbolReferenceProvider { override fun getReferences(element: PsiExternalReferenceHost, hints: PsiSymbolReferenceHints): Collection { val psiComment = element.asSafely() ?: return emptyList() val languageRange = getLanguageRange(psiComment) ?: return emptyList() @@ -65,7 +65,7 @@ private data class LanguageSymbol(val name: String) : Symbol, Pointer() { override fun addCompletions(parameters: CompletionParameters, context: ProcessingContext, result: CompletionResultSet) { @@ -82,7 +82,7 @@ class LanguageWordInCommentCompletionContributor : CompletionContributor() { } } -class LanguageCommentFolding : FoldingBuilderEx() { +internal class LanguageCommentFolding : FoldingBuilderEx() { override fun buildFoldRegions(root: PsiElement, document: Document, quick: Boolean): Array { return SmartList().also { result -> root.accept(object : PsiRecursiveElementWalkingVisitor() {