Skip to content

Commit

Permalink
Do not forward duplicate lines to bsp-client
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Wawrzyk committed Apr 4, 2022
1 parent f1939c4 commit 80649a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

### Changes 🔄

- Duplicate bazel output lines are not shown in bsp-client.
| [#209](https://github.com/JetBrains/bazel-bsp/pull/209)
- Project uses bazel `5.1.0`.
| [#208](https://github.com/JetBrains/bazel-bsp/pull/208)
- JUnit5!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ public void start(InputStream inputStream, OutputHandler... handlers) {
Runnable runnable =
() -> {
try (var reader = new BufferedReader(new InputStreamReader(inputStream))) {
String prevLine = null;
while (!Thread.currentThread().isInterrupted()) {
var line = reader.readLine();
if (line == null) return;
if (line.equals(prevLine)) continue;
prevLine = line;
Arrays.stream(handlers).forEach(h -> h.onNextLine(line));
}
} catch (IOException e) {
Expand Down

0 comments on commit 80649a4

Please sign in to comment.