Skip to content

Commit

Permalink
entrypoint linemarker should be on file scope only
Browse files Browse the repository at this point in the history
  • Loading branch information
Haehnchen committed Feb 25, 2024
1 parent 3ab0600 commit 96aa0ae
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ public void collectSlowLineMarkers(@NotNull List<? extends PsiElement> psiElemen
return;
}

PsiElement psiElement = psiElements.get(0);
VueFile vueFile = (VueFile) psiElement.getContainingFile();
if (vueFile.getName().endsWith(".vue")) {
String filenameWithoutExtension = vueFile.getName().substring(0, vueFile.getName().length() - 4);
if (FileBasedIndex.getInstance().getContainingFiles(AppEntrypointIndex.KEY, filenameWithoutExtension, GlobalSearchScope.allScope(psiElement.getProject())).isEmpty()) {
return;
}
for (PsiElement psiElement : psiElements) {
if (psiElement instanceof VueFile vueFile && vueFile.getName().endsWith(".vue")) {
String filenameWithoutExtension = vueFile.getName().substring(0, vueFile.getName().length() - 4);
if (FileBasedIndex.getInstance().getContainingFiles(AppEntrypointIndex.KEY, filenameWithoutExtension, GlobalSearchScope.allScope(psiElement.getProject())).isEmpty()) {
return;
}

if (getTargets(filenameWithoutExtension, psiElement, vueFile).isEmpty()) {
return;
}
if (getTargets(filenameWithoutExtension, psiElement, vueFile).isEmpty()) {
return;
}

NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(AllIcons.Nodes.Plugin)
.setTooltipText("Vue.js Toolbox: Navigate to initialization")
.setTargets(NotNullLazyValue.lazy(() -> new ArrayList<>(
getTargets(filenameWithoutExtension, psiElement, vueFile)
)));
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(AllIcons.Nodes.Plugin)
.setTooltipText("Vue.js Toolbox: Navigate to initialization")
.setTargets(NotNullLazyValue.lazy(() -> new ArrayList<>(
getTargets(filenameWithoutExtension, psiElement, vueFile)
)));

lineMarkerInfos.add(builder.createLineMarkerInfo(psiElement));
lineMarkerInfos.add(builder.createLineMarkerInfo(psiElement));
}
}
}

Expand Down

0 comments on commit 96aa0ae

Please sign in to comment.