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

Editorconfig improvements - do not lose state, trigger re-analysis on change #2028

Merged
merged 9 commits into from
Dec 1, 2020

Conversation

filipw
Copy link
Member

@filipw filipw commented Nov 24, 2020

  1. at the moment we set brand new CompilationOptions based on the csproj file when a project update is triggered (e.g. rebuild, change in csproj). This causes us to lose the editorconfig state because it is kept in SyntaxTreeOptionsProvider which gets reset then. The PR ensures the new compilation options are created only when necessary, and also derived from the previous ones.
  1. when editorconfig file changes, even though we watch for changes, there is currently no event raised that would trigger a re-analysis. This PR introduces new targeted handling of editorconfig - if an editorconfig file changes, we raise a relevant workspace event (AnalyzerConfigDocumentChanged) which is now newly handled to trigger re-analysis.

@ffMathy
Copy link

ffMathy commented Nov 26, 2020

Wow, this is great! Can't wait until this is released. Nicely done!

@filipw
Copy link
Member Author

filipw commented Nov 27, 2020

this PR requires this change to ship with the C# Extension dotnet/vscode-csharp#4230
I merged it already but just for the record some cases may not work (e.g. using pre-release OmniSharp server with a current version of the extension)

Copy link
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JoeRobich JoeRobich merged commit 495bcc2 into master Dec 1, 2020
@filipw filipw deleted the bugfix/editorconfig branch December 1, 2020 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants