[java-imports] IDEA-13817 Create "favorites" for static import and completion

GitOrigin-RevId: 786ff0d07a68ecb53f3c929600353bc28f483bf0
This commit is contained in:
Mikhail Pyltsin
2025-01-15 15:10:18 +01:00
committed by intellij-monorepo-bot
parent 2afb61710c
commit b1a1f903ba
30 changed files with 742 additions and 247 deletions

View File

@@ -24,6 +24,15 @@ public abstract class JavaCodeStyleManager {
public static final int DO_NOT_ADD_IMPORTS = 0x1000;
public static final int INCOMPLETE_CODE = 0x2000;
/**
* Determines whether the specified fully qualified name (FQN) represents
* a class that should be statically auto-imported in the context.
*
* @param fqn the fully qualified name of the target class, must not be null
* @return true if the class is configured to be statically auto-imported, false otherwise
*/
public abstract boolean isStaticAutoImportClass(@Nullable String fqn);
public abstract boolean addImport(@NotNull PsiJavaFile file, @NotNull PsiClass refClass);
public abstract @NotNull PsiElement shortenClassReferences(@NotNull PsiElement element,
@MagicConstant(flags = {DO_NOT_ADD_IMPORTS, INCOMPLETE_CODE}) int flags) throws IncorrectOperationException;