[external annotations] don't ask the workspace model if no roots were declared

^KTIJ-34231 fixed

GitOrigin-RevId: 4a77f7be5b62c9ebd290d06c7151aaaa2e490039
This commit is contained in:
Anna Kozlova
2025-05-19 13:34:57 +00:00
committed by intellij-monorepo-bot
parent 5a1aad71d6
commit 3e81aae23a
@@ -46,6 +46,9 @@ public class ReadableExternalAnnotationsManager extends BaseExternalAnnotationsM
@Override
protected @NotNull List<VirtualFile> getExternalAnnotationsRoots(@NotNull VirtualFile libraryFile) {
if (!hasAnyAnnotationsRoots()) {
return Collections.emptyList();
}
ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myPsiManager.getProject()).getFileIndex();
Set<VirtualFile> result = new LinkedHashSet<>();
for (OrderEntry entry : fileIndex.getOrderEntriesForFile(libraryFile)) {