Skip to content

Commit

Permalink
fixup! Added real-time scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
leinardi committed Aug 31, 2018
1 parent 811119c commit 27ddc75
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public ProblemDescriptor[] checkFile(@NotNull final PsiFile psiFile,

@Nullable
public List<Problem> inspectFile(@NotNull final PsiFile psiFile,
// @Nullable final Module module,
@NotNull final InspectionManager manager) {
LOG.debug("Inspection has been invoked.");

Expand All @@ -85,6 +84,9 @@ public List<Problem> inspectFile(@NotNull final PsiFile psiFile,
final List<ScannableFile> scannableFiles = new ArrayList<>();
try {
scannableFiles.addAll(ScannableFile.createAndValidate(singletonList(psiFile), plugin));
if (scannableFiles.isEmpty()) {
return NO_PROBLEMS_FOUND;
}
ScanFiles scanFiles = new ScanFiles(plugin, Collections.singletonList(psiFile.getVirtualFile()));
Map<PsiFile, List<Problem>> map = scanFiles.call();
if (map.isEmpty()) {
Expand Down Expand Up @@ -127,6 +129,6 @@ private ProblemDescriptor[] asProblemDescriptors(final List<Problem> results, fi
.map(problems -> problems.stream()
.map(problem -> problem.toProblemDescriptor(manager))
.toArray(ProblemDescriptor[]::new))
.orElseGet(() -> ProblemDescriptor.EMPTY_ARRAY);
.orElse(ProblemDescriptor.EMPTY_ARRAY);
}
}

0 comments on commit 27ddc75

Please sign in to comment.