IJPL-797 intellij.platform.langInjection hide internal API

GitOrigin-RevId: f30dcc072a955a57cca7c1b93612975ff8027ef7
This commit is contained in:
Max Medvedev
2024-09-04 14:45:30 +02:00
committed by intellij-monorepo-bot
parent 1c8070a995
commit 276f5a8dd1
25 changed files with 74 additions and 206 deletions

View File

@@ -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
- <init>(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
- <init>():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
- <init>():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
- <init>():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
- <init>():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
- <init>():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
- <init>():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
- <init>():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
- <init>(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[]
- <init>(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
- <init>(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
- <init>(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
- <init>(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
- <init>():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
- <init>():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
- <init>():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
- <init>():V
- buildVisitor(com.intellij.codeInspection.ProblemsHolder,Z):com.intellij.psi.PsiElementVisitor
f:org.intellij.plugins.intelliLang.references.LanguageCommentFolding
- com.intellij.lang.folding.FoldingBuilderEx
- <init>():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
- <init>():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
- <init>():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

View File

@@ -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;

View File

@@ -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() {
}

View File

@@ -23,7 +23,7 @@
<extensionPoints>
<extensionPoint name="languageSupport" interface="org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport" dynamic="true"/>
<extensionPoint name="injectionConfig" beanClass="org.intellij.plugins.intelliLang.inject.LanguageInjectionConfigBean" dynamic="true"/>
<extensionPoint name="injectionConfig" beanClass="org.intellij.plugins.intelliLang.LanguageInjectionConfigBean" dynamic="true"/>
</extensionPoints>
<extensions defaultExtensionNs="com.intellij">

View File

@@ -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<Element>, ModificationTracker {
static final Logger LOG = Logger.getInstance(Configuration.class.getName());
private static final ExtensionPointName<LanguageInjectionConfigBean>
CONFIG_EP_NAME = ExtensionPointName.create("org.intellij.intelliLang.injectionConfig");
private static final Condition<BaseInjection> 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<BaseInjection> loadDefaultInjections() {
final List<Configuration> cfgList = new ArrayList<>();
final Set<Object> visited = new HashSet<>();
LanguageInjectionSupport.CONFIG_EP_NAME.processWithPluginDescriptor((configBean, pluginDescriptor) -> {
CONFIG_EP_NAME.processWithPluginDescriptor((configBean, pluginDescriptor) -> {
final ClassLoader loader = pluginDescriptor.getClassLoader();
try {
final Enumeration<URL> enumeration = loader.getResources(configBean.getConfigUrl());

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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) {

View File

@@ -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

View File

@@ -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());

View File

@@ -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<Processor<? super PsiLanguageInjectionHost>> 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();

View File

@@ -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;
}
}

View File

@@ -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<LanguageInjectionSupport> EP_NAME = ExtensionPointName.create("org.intellij.intelliLang.languageSupport");
public static final ExtensionPointName<LanguageInjectionConfigBean> CONFIG_EP_NAME = ExtensionPointName.create("org.intellij.intelliLang.injectionConfig");
public static final Key<InjectedLanguage> TEMPORARY_INJECTED_LANGUAGE = Key.create("TEMPORARY_INJECTED_LANGUAGE");
public static final Key<LanguageInjectionSupport> INJECTOR_SUPPORT = Key.create("INJECTOR_SUPPORT");

View File

@@ -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

View File

@@ -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) {

View File

@@ -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];

View File

@@ -24,7 +24,7 @@ import org.intellij.plugins.intelliLang.inject.config.BaseInjection;
import javax.swing.*;
public class AdvancedPanel extends AbstractInjectionPanel<BaseInjection> {
public final class AdvancedPanel extends AbstractInjectionPanel<BaseInjection> {
private JPanel myRoot;

View File

@@ -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<BaseInjection> {
public final class BaseInjectionPanel extends AbstractInjectionPanel<BaseInjection> {
// read by reflection
LanguagePanel myLanguagePanel;

View File

@@ -42,7 +42,7 @@ import java.awt.event.ItemListener;
import java.util.Arrays;
import java.util.Set;
public class LanguagePanel extends AbstractInjectionPanel<BaseInjection> {
public final class LanguagePanel extends AbstractInjectionPanel<BaseInjection> {
private JPanel myRoot;
private ComboBox<@Nls String> myLanguage;
private EditorTextField myPrefix;

View File

@@ -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<Boolean> KEY = Key.create("IS_VALUE_REGEXP");
static {

View File

@@ -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

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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<PsiSymbolReference> {
val psiComment = element.asSafely<PsiComment>() ?: return emptyList()
val languageRange = getLanguageRange(psiComment) ?: return emptyList()
@@ -65,7 +65,7 @@ private data class LanguageSymbol(val name: String) : Symbol, Pointer<LanguageSy
override fun dereference(): LanguageSymbol = this
}
class LanguageWordInCommentCompletionContributor : CompletionContributor() {
internal class LanguageWordInCommentCompletionContributor : CompletionContributor() {
init {
extend(CompletionType.BASIC, PlatformPatterns.psiComment(), object : CompletionProvider<CompletionParameters?>() {
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<FoldingDescriptor> {
return SmartList<FoldingDescriptor>().also { result ->
root.accept(object : PsiRecursiveElementWalkingVisitor() {