[javadoc] 'lang' attribute constant moved to PsiSnippetAttribute

GitOrigin-RevId: 41e07d777a03a745d91e8ddd036db7ab5adf17f6
This commit is contained in:
Tagir Valeev
2023-03-10 14:17:01 +00:00
committed by intellij-monorepo-bot
parent dc7673fbb9
commit d7ac37c2f9
2 changed files with 21 additions and 4 deletions
@@ -21,8 +21,6 @@ import java.util.List;
public class JavadocInjector implements MultiHostInjector {
private static final String LANG_ATTR_KEY = "lang";
@Override
public void getLanguagesToInject(@NotNull MultiHostRegistrar registrar,
@NotNull PsiElement context) {
@@ -47,7 +45,7 @@ public class JavadocInjector implements MultiHostInjector {
final PsiSnippetAttributeList attributeList = valueElement.getAttributeList();
for (PsiSnippetAttribute attribute : attributeList.getAttributes()) {
if (!LANG_ATTR_KEY.equals(attribute.getName())) continue;
if (!PsiSnippetAttribute.LANG_ATTRIBUTE.equals(attribute.getName())) continue;
final PsiElement langValue = attribute.getValue();
if (langValue == null) break;
@@ -2,7 +2,6 @@
package com.intellij.psi.javadoc;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiNamedElement;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -13,9 +12,29 @@ import org.jetbrains.annotations.Nullable;
*/
@ApiStatus.Experimental
public interface PsiSnippetAttribute extends PsiElement {
/**
* External class location (relative to {@link #SNIPPETS_FOLDER})
*/
String CLASS_ATTRIBUTE = "class";
/**
* External file path (relative to {@link #SNIPPETS_FOLDER})
*/
String FILE_ATTRIBUTE = "file";
/**
* Region to render
*/
String REGION_ATTRIBUTE = "region";
/**
* Language of the snippet
*/
String LANG_ATTRIBUTE = "lang";
/**
* Default folder name to contain external snippets
*/
String SNIPPETS_FOLDER = "snippet-files";
PsiSnippetAttribute[] EMPTY_ARRAY = new PsiSnippetAttribute[0];