Skip to content

Add support for most standard .editorconfig settings#7927

Merged
Colengms merged 5 commits intomainfrom
coleng/editorconfig_standard_settings1
Aug 7, 2021
Merged

Add support for most standard .editorconfig settings#7927
Colengms merged 5 commits intomainfrom
coleng/editorconfig_standard_settings1

Conversation

@Colengms
Copy link
Contributor

@Colengms Colengms commented Aug 6, 2021

Addresses: #7920

Adds support for:

  • indent_style
  • indent_size
  • tab_size
  • end_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 using editor.formatOnSave.)

vcFormat appears to always do trim_trailing_whitespace.

That leaves charset. Support for which appears to be blocked on: microsoft/vscode#824

@Colengms Colengms changed the title Add support for indent_style, indent_size, and tab_size .editorconfig settings Add support for most standard .editorconfig settings Aug 6, 2021
|| 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();
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you should be passing the rootUri here or else you might not get the settings for the current workspace folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. I'm wondering if this is correct in a few other places. Should the existing occurrence in onDidChangeSettings() also use this.RootUri?

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@Colengms Colengms merged commit ed64b7c into main Aug 7, 2021
@Colengms Colengms deleted the coleng/editorconfig_standard_settings1 branch August 7, 2021 02:57
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants