mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
IDEA-359853 deprecated constants in PsiKeyword
GitOrigin-RevId: 94f23984ad8f4f467fed1f01f47b2a9b46242cac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5e4396a97c
commit
0ce5d6986a
@@ -7,6 +7,7 @@ import com.intellij.codeInsight.template.TemplateContextType;
|
||||
import com.intellij.core.JavaPsiBundle;
|
||||
import com.intellij.dupLocator.iterators.NodeIterator;
|
||||
import com.intellij.ide.highlighter.JavaFileType;
|
||||
import com.intellij.java.syntax.parser.PsiKeywords;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.java.JavaLanguage;
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
@@ -57,10 +58,10 @@ public final class JavaStructuralSearchProfile extends StructuralSearchProfile {
|
||||
private static final List<PatternContext> PATTERN_CONTEXTS = List.of(DEFAULT_CONTEXT, MEMBER_CONTEXT);
|
||||
|
||||
private static final Set<String> PRIMITIVE_TYPES = Set.of(
|
||||
PsiKeyword.SHORT, PsiKeyword.BOOLEAN,
|
||||
PsiKeyword.DOUBLE, PsiKeyword.LONG,
|
||||
PsiKeyword.INT, PsiKeyword.FLOAT,
|
||||
PsiKeyword.CHAR, PsiKeyword.BYTE
|
||||
PsiKeywords.SHORT, PsiKeywords.BOOLEAN,
|
||||
PsiKeywords.DOUBLE, PsiKeywords.LONG,
|
||||
PsiKeywords.INT, PsiKeywords.FLOAT,
|
||||
PsiKeywords.CHAR, PsiKeywords.BYTE
|
||||
);
|
||||
|
||||
private static final Set<String> RESERVED_WORDS =
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.structuralsearch.impl.matcher.compiler;
|
||||
|
||||
import com.intellij.dupLocator.iterators.NodeIterator;
|
||||
import com.intellij.java.syntax.parser.PsiKeywords;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -42,8 +43,8 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
|
||||
private final @NotNull GlobalCompilingVisitor myCompilingVisitor;
|
||||
|
||||
private static final @NonNls Pattern COMMENT_PATTERN = Pattern.compile("__\\$_\\w+");
|
||||
private static final Set<String> excludedKeywords = ContainerUtil.newHashSet(PsiKeyword.CLASS, PsiKeyword.INTERFACE, PsiKeyword.ENUM,
|
||||
PsiKeyword.THROWS, PsiKeyword.EXTENDS, PsiKeyword.IMPLEMENTS);
|
||||
private static final Set<String> excludedKeywords = ContainerUtil.newHashSet(PsiKeywords.CLASS, PsiKeywords.INTERFACE, PsiKeywords.ENUM,
|
||||
PsiKeywords.THROWS, PsiKeywords.EXTENDS, PsiKeywords.IMPLEMENTS);
|
||||
|
||||
public JavaCompilingVisitor(@NotNull GlobalCompilingVisitor compilingVisitor) {
|
||||
myCompilingVisitor = compilingVisitor;
|
||||
@@ -122,19 +123,19 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
|
||||
final CompileContext context = myCompilingVisitor.getContext();
|
||||
if (!handleWord(aClass.getName(), CODE, context)) return;
|
||||
if (aClass.isInterface()) {
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeyword.INTERFACE, true, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeywords.INTERFACE, true, CODE, context);
|
||||
}
|
||||
else if (aClass.isEnum()) {
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeyword.ENUM, true, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeywords.ENUM, true, CODE, context);
|
||||
}
|
||||
else if (aClass.isRecord()) {
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeyword.RECORD, true, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeywords.RECORD, true, CODE, context);
|
||||
}
|
||||
else {
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeyword.INTERFACE, false, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeyword.ENUM, false, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeyword.RECORD, false, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeyword.CLASS, true, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeywords.INTERFACE, false, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeywords.ENUM, false, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeywords.RECORD, false, CODE, context);
|
||||
GlobalCompilingVisitor.addFilesToSearchForGivenWord(PsiKeywords.CLASS, true, CODE, context);
|
||||
}
|
||||
super.visitClass(aClass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user