Skip to content

Commit 7737289

Browse files
committed
chore: fail fast when the toml file is not Cargo.toml
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent 376d0cd commit 7737289

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/org/jboss/tools/intellij/componentanalysis/cargo/CargoCAAnnotator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ protected String getInspectionShortName() {
7070

7171
@Override
7272
protected Map<Dependency, List<PsiElement>> getDependencies(PsiFile file) {
73+
if (!"Cargo.toml".equals(file.getName())) {
74+
return Map.of();
75+
}
76+
7377
Map<Dependency, List<PsiElement>> resultMap = new HashMap<>();
7478

7579
Set<String> commentIgnoredDeps = getIgnoredDependencies(file);
@@ -381,4 +385,4 @@ private void parseFlatDependencies(TomlTable table, Set<String> ignoredDeps, Map
381385
resultMap.computeIfAbsent(dp, k -> new LinkedList<>()).add(keyValue);
382386
}
383387
}
384-
}
388+
}

0 commit comments

Comments
 (0)