Honor scoped .editorconfig settings in Roslyn formatter requests#9402
Draft
Copilot wants to merge 2 commits into
Draft
Honor scoped .editorconfig settings in Roslyn formatter requests#9402Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix formatter issue with .editorconfig in v2.100.5 and v2.110.4
Honor scoped .editorconfig settings in Roslyn formatter requests
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Roslyn-formatting requests were ignoring document-scoped configuration, so
.editorconfigvalues such asindent_sizeandcsharp_new_line_before_open_bracewere not applied in newer extension versions. This updates the LSP configuration path to return per-document formatting settings instead of falling back to global defaults.Root cause
workspace/configurationrequests withscopeUriwere treated as unsupported in the Roslyn LSP middleware.nullfor document-scoped settings, bypassing.editorconfig-resolved values.Change
configurationMiddlewareto resolve settings with the request scope:{ languageId: 'csharp', uri }whenscopeUriis presentuniversalEditorConfigProviderto read fallback VS Code formatting settings from the same scope instead of an unscoped configuration object.Regression coverage
.editorconfig.editorconfigExample
With this change, formatting requests for that document now resolve options from the document scope, so output follows the file’s
.editorconfiginstead of extension/global defaults.