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

Once a rule is suppressed, it remains as shown in current document #142

Open
gep13 opened this issue Mar 4, 2019 · 6 comments
Open

Once a rule is suppressed, it remains as shown in current document #142

gep13 opened this issue Mar 4, 2019 · 6 comments

Comments

@gep13
Copy link
Member

gep13 commented Mar 4, 2019

Steps to reproduce:

  1. Open document with all rules active
  2. Open settings and suppress a rule, for example CHOCO0001
  3. Notice that squiggly line for that rule is still present
  4. Close/open VSCode again, and rule violation will no longer be shown

As a result of changing suppressed rules, I think we need to clear the current diagnostics, and resubmit them. There is code for doing this in @tintoy repository for MSBuild Diagnostic Handler, so may be able to lean on what was done there.

@tintoy
Copy link

tintoy commented Mar 4, 2019

Hi - I’m about to go to bed (am in Australia), but will have a proper look at this tomorrow morning :)

@tintoy
Copy link

tintoy commented Mar 4, 2019

From what I remember, you send all diagnostics for a given document each time. So all diagnostics for a given document URI replace any existing diagnostics for that document URI. Does that help?

@tintoy
Copy link

tintoy commented Mar 4, 2019

(i.e. if there are no no diagnostics, send an empty list of diagnostics for that document)

@AdmiringWorm
Copy link
Member

@tintoy I would say that the problem is more on how to get the diagnostics check to run again for the opened documents after the settings have been saved.

@gep13
Copy link
Member Author

gep13 commented Mar 6, 2019

@AdmiringWorm this is sort of where I thought this would come in:

https://github.com/tintoy/msbuild-project-tools-server/blob/dbc74e841eb660826088e9cf94edb63f01631dd7/src/LanguageServer.Engine/Documents/Workspace.cs#L286-L298

i.e. once we know that the suppression rules have changed, clear the diagnostics out, and then run the checks again.

@tintoy
Copy link

tintoy commented Mar 6, 2019

@tintoy I would say that the problem is more on how to get the diagnostics check to run again for the opened documents after the settings have been saved.

My configuration handler has a hookable event which various other bits and pieces use to react to configuration changes. That might give you what you're after :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants