You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some experimentation however, it seems like .editorconfig settings aren't being passed through to analyzers, is that right? Using roslynator, omnisharp.json settings appear to be passed through to the analyzer and affect diagnostics and code actions, but not .editorconfig settings.
If I now Format Document, OmniSharp-roslyn correctly sets the indent to 3 (as specified by .editorconfig). However, if I move the cursor to the beginning of line 2 there is a "Fix formatting" code action available from roslynator, and running this sets the indent back to 2 (as specified by omnisharp.json).
Removing the "IndentationSize" line entirely from omnisharp.json results in roslynator using the default of 4.
Similar things occur with newlines, where roslynator applies omnisharp.json preferences and O#-roslyn applies .editorconfig preferences.
All the options are flown correctly to the analyzers but, basically, we run the editorconfig provider before the omnisharp.json-formatting provider which causes all formatting settings to be lost. This doesn't affect internal OmniSharp formatting endpoints, as on those endpoints editorconfig is re-applied again on invoke, but it affects "3rd party" formatting invokers like this code fix.
This only affects formatting rules, other editorconfig options such as naming conventions are not affected and a respected in analyzers, code fixes and refactorings correctly.
This is really great, thanks @filipw!
After some experimentation however, it seems like
.editorconfig
settings aren't being passed through to analyzers, is that right? Using roslynator,omnisharp.json
settings appear to be passed through to the analyzer and affect diagnostics and code actions, but not.editorconfig
settings.Example:
If I now
Format Document
, OmniSharp-roslyn correctly sets the indent to 3 (as specified by.editorconfig
). However, if I move the cursor to the beginning of line 2 there is a "Fix formatting" code action available from roslynator, and running this sets the indent back to 2 (as specified byomnisharp.json
).Removing the
"IndentationSize"
line entirely fromomnisharp.json
results in roslynator using the default of4
.Similar things occur with newlines, where roslynator applies
omnisharp.json
preferences and O#-roslyn applies.editorconfig
preferences.Originally posted by @nickspoons in #1526 (comment)
The text was updated successfully, but these errors were encountered: