Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report noDiagnostics if file doesn't exist #767

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions frontend/src/main/scala/bloop/reporter/BspProjectReporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,14 @@ final class BspProjectReporter(
currentAnalysis: Option[CompileAnalysis],
code: bsp.StatusCode
): Unit = {
val isNoOp = previousAnalysis match {
case Some(previous) =>
currentAnalysis match {
case Some(current) => current == previous
case None => false
}
case None => false
}

val clearedFiles = new mutable.HashSet[File]
previouslyReportedProblems.foreach { problem =>
InterfaceUtil.toOption(problem.position().sourceFile).foreach { source =>
if (reportAllPreviousProblems) logger
// Do nothing if problem maps to a file with problems, assume it's already reported
if (filesWithProblems.contains(source)) ()
else {
// Only log errors if it was a no-op (previous failed result could have logged errors)
if (isNoOp && !source.exists())
// Log no diagnostics for files that are gone
if (!source.exists())
logger.noDiagnostic(project, source)
else if (compiledFiles.contains(source)) {
// Log no diagnostic if there was a problem in a file that now compiled without problems
Expand Down