mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
Java: sort imports correctly when "Layout static imports separately" is disabled (IDEA-298584)
(cherry picked from commit 6656672e1ae56cffbc4f65cfbbd79d97004aef78) GitOrigin-RevId: a1065f373f4f8fa92e8f36564f6091fd99408e65
This commit is contained in:
committed by
intellij-monorepo-bot
parent
982a5b4d9c
commit
c82b457feb
@@ -175,7 +175,8 @@ public final class ImportHelper{
|
||||
PackageEntry[] entries = settings.IMPORT_LAYOUT_TABLE.getEntries();
|
||||
for (int i = 0; i < imports.size(); i++) {
|
||||
Import anImport = imports.get(i);
|
||||
entryForName[i] = findEntryIndex(ImportUtils.getPackageOrClassName(anImport.name()), anImport.isStatic(), entries);
|
||||
entryForName[i] = findEntryIndex(ImportUtils.getPackageOrClassName(anImport.name()),
|
||||
settings.LAYOUT_STATIC_IMPORTS_SEPARATELY && anImport.isStatic(), entries);
|
||||
}
|
||||
|
||||
List<Import> resultList = new ArrayList<>(imports.size());
|
||||
@@ -841,7 +842,9 @@ public final class ImportHelper{
|
||||
String className = ref.getCanonicalText();
|
||||
packageName = ImportUtils.getPackageOrClassName(className);
|
||||
}
|
||||
return findEntryIndex(packageName, statement instanceof PsiImportStaticStatement, mySettings.IMPORT_LAYOUT_TABLE.getEntries());
|
||||
return findEntryIndex(packageName,
|
||||
mySettings.LAYOUT_STATIC_IMPORTS_SEPARATELY && statement instanceof PsiImportStaticStatement,
|
||||
mySettings.IMPORT_LAYOUT_TABLE.getEntries());
|
||||
}
|
||||
|
||||
public static boolean hasConflictingOnDemandImport(@NotNull PsiJavaFile file, @NotNull PsiClass psiClass, @NotNull String referenceName) {
|
||||
|
||||
Reference in New Issue
Block a user