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

[change] do not forward duplicate lines to bsp-client #209

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
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
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