Add support for most standard .editorconfig settings#7927
Merged
Conversation
indent_style, indent_size, and tab_size .editorconfig settings.editorconfig settings
sean-mcmanus
requested changes
Aug 6, 2021
Extension/src/LanguageServer/Providers/documentFormattingEditProvider.ts
Outdated
Show resolved
Hide resolved
| || editor.document.languageId === "cpp" | ||
| || editor.document.languageId === "cuda-cpp")) { | ||
| // If using vcFormat, check for a ".editorconfig" file, and apply those text options to the active document. | ||
| const settings: CppSettings = new CppSettings(); |
Contributor
There was a problem hiding this comment.
I believe you should be passing the rootUri here or else you might not get the settings for the current workspace folder.
Contributor
Author
There was a problem hiding this comment.
Hmm. I'm wondering if this is correct in a few other places. Should the existing occurrence in onDidChangeSettings() also use this.RootUri?
Contributor
There was a problem hiding this comment.
It's incorrect whenever a "resource" or "machine-overridable" scope setting is accessed, which is the case for "formatting" in onDidChangeSettings -- we could have other cases too.
…nto coleng/editorconfig_standard_settings1
sean-mcmanus
approved these changes
Aug 6, 2021
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Addresses: #7920
Adds support for:
indent_styleindent_sizetab_sizeend_of_line(applied any time the document is activated, as an unsaved edit. This is equivalent to selecting the newline mode from the menu at the bottom of the window).insert_final_newline(applied only when "Format Document" is used, so also on save if usingeditor.formatOnSave.)vcFormat appears to always do
trim_trailing_whitespace.That leaves
charset. Support for which appears to be blocked on: microsoft/vscode#824