plexsystems / vscode-protolint

A protobuf linter for visual studio code
MIT License
52 stars 14 forks source link

Linting results aren't updated on changing active editor or running protolint.lint command #32

Open AlexCannonball opened 1 year ago

AlexCannonball commented 1 year ago

This is reproduced both in 0.7.0 and 0.8.0.

Steps:

  1. Open a protobuf file with some contents. Linting problems are displayed, if any.
  2. Make changes in the file, so that one linting problem is added or fixed.
  3. Change active vs code editor, then go back to the protobuf file. The linting problems are back to the state when we first opened the protobuf file.
  4. Similar happens when running protolint.lint command via the command palette (CTRL + SHIFT + P).

So now linting problems are only updated properly when opening or saving a protobuf file.

I've checked the code and it seems that the diagnosticCollection is not handled properly.

I've got an idea how to fix it and add the fix into #31 if it works.

Update: I've fixed the diagnosticCollection and disposables' related issues, however, the root cause is that we convey the file to protolint, so the text is obviously updated only after the file is saved. I'm going to figure out whether the binary accepts text via stdin.