Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Wawrzyk committed Apr 21, 2022
1 parent 93b7c35 commit 4865078
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

### Features 🎉

- New implementation of diagnostics extraction. It collects
both warnings and errors, doesn't show irrelevant errors
in BUILD files, shows line and character position and does
not run bazel query before each build anymore.
| [#225](https://github.com/JetBrains/bazel-bsp/pull/225)
- `build_flags` support in project view.
| [#194](https://github.com/JetBrains/bazel-bsp/pull/194)
- New installer - it is possible to specify installation directory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jetbrains.bsp.bazel.server.diagnostics

object BazelRootMessageParser : Parser {
private const val TargetLabel = """(//[\w/.-]+:[\w/.-]+)"""
private const val TargetLabel = """(//[\w/.-]*:[\w/.-]+)"""

override fun tryParse(output: Output): List<Diagnostic> =
findErrorInBUILD(output) ?: findWarningsInInfoMessage(output) ?: emptyList()
Expand All @@ -27,12 +27,8 @@ object BazelRootMessageParser : Parser {
return output.tryTake(ErrorInBUILD)
?.let { match ->
val targetLabel = match.groupValues[4].ifEmpty { null }
val compilerDiagnostics = collectCompilerDiagnostics(output, targetLabel)
if (compilerDiagnostics.isEmpty()) {
return listOf(createError(match, targetLabel))
} else {
return compilerDiagnostics
}
return collectCompilerDiagnostics(output, targetLabel)
.ifEmpty { listOf(createError(match, targetLabel)) }
}
}

Expand Down

0 comments on commit 4865078

Please sign in to comment.