Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.editorconfig settings not passed to VS Code Language Server in Format Document request #319

Open
1 task done
davidmatson opened this issue Aug 4, 2021 · 1 comment

Comments

@davidmatson
Copy link

Please fill-in this template.

  • I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
  • [n/a] I tried running code --disable-extensions and the issue did NOT present itself.

Issue

Visual Studio Code editorconfig-vscode
Version 1.5.82 0.16.4

Root .editorconfig File

root = true

[*]
indent_style = tab
indent_size = 5
trim_trailing_whitespace = true
insert_final_newline = true

Are there any other relevant .editorconfig files in your project? No

Expected behavior

When issuing a Format Document command, the settings above all translate into FormattingOptions passed to a Language Server in VS Code.

Actual behavior

Only the following settings are passed through:

    "options": {
        "tabSize": 5,
        "insertSpaces": false
    }

Additional comments or steps to reproduce

See microsoft/vscode-languageserver-node#795 for additional context.

@nrayburn-tech
Copy link

I think that the primary issue is how this extension implements the formatting. The extension uses pre-save transformations, instead of being implemented as a formatter. The pre-save transformations do not communicate the additional FormattingOptions, which is why only the two that are part of the TextEditorOptions work.

I am not sure of the implications or feasibility of converting the extension to be used as a formatter instead of the current pre-save transformations. I am going to look into it some more, but I am not sure if it is possible or how long it would take to make the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants