Fix CodingConventions support in 17.10 #125
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the way we read Coding Conventions (from .editorconfig) for Dev 17.
We were previously using the Microsoft.VisualStudio.CodingConventions NuGet and assuming that the implementation assembly is installed with Visual Studio. However, that assembly has been removed in 17.10 preview 1 and we need to come up with an alternative.
I split the implementations between Dev 17 and previous versions (Dev 15 and Dev 16) by introducing my own CodingConventions helper class. Each VSIX has its own implementation. The down-level version just re-implements the existing code.
The new, Dev17 implementation, uses IEditorOptions to fetch the "CodingConventionsSnapshot" dictionary containing .editorconfig settings.
The CodingConventionsSnapshot was introduced in version 17.6 of Visual Studio 2022. I haven't changed the minimum install version of this extension, though. So, technically, the extension will install on, say 17.5, but .editorconfig support will be lacking.