Add support for max_line_length
Please fill-in this template.
- [x] I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
- [ ] I tried running
code --disable-extensionsand the issue did NOT present itself.
Delete the following condition if it doesn't apply to your case:
If the extension is not picking up the expected configuration for a file:
- [ ] I tried
npm install editorconfig -gand raneditorconfig [file-in-question]and the configuration was what I expected. If not, please file on theeditorconfig-core-jsissue tracker.
Issue
| Visual Studio Code | editorconfig-vscode | |
|---|---|---|
| Version | 1.45.1 |
0.15.1 |
Root .editorconfig File
root = true
[*.rst]
indent_style = space
indent_size = 3
charset = utf-8
trim_trailing_whitespace = true
max_line_length = 80
insert_final_newline = true
Are there any other relevant .editorconfig files in your project? No
| Visual Studio Code Setting | Default | User | Workspace |
|---|---|---|---|
editor.insertSpaces |
true |
____ |
____ |
editor.tabSize |
4 |
_ |
_ |
editor.trimAutoWhitespace |
true |
____ |
____ |
files.autoSave |
"off" |
"___" |
"___" |
files.insertFinalNewline |
false |
_____ |
_____ |
files.trimTrailingWhitespace |
false |
_____ |
_____ |
File opened
./test.rst
this is a new test of the same thing that I said before it is missing a few words to be trimmed
Expected behavior
max_line_length = 80
Actual behavior
No line was split.
Additional comments or steps to reproduce
Have you tried installing Prettier? It extends EditorConfig and is better suited for that task, as it's syntax-specific.
I wouldn't expect max_line_length to cause this extension to forcefully auto-split my text.
What I would like, however, is for the extension to set the VSCode editor.rulers property so that a ruler would appear at the specified length.
My use-case: I juggle between projects using a maximum line length of 80, 100, and 120; they all use EditorConfig. It would be nice if the ruler was automatically set.
I submitted a vscode extension API request for the ability to do that.
https://github.com/microsoft/vscode/issues/111251
I submitted a vscode extension API request for the ability to do that.
Adding a note that the request will need 20 upvotes in the next 60 days to be included in the backlog; otherwise it will be closed.
/cc @userlerueda, @nunocastromartins, @jaileon, @nihaals, @micahjsmith, @peleteiro, @remcohaszing, @Deide, @malobre, @ducakar and @chrislloyd.
FYI: https://github.com/microsoft/vscode/pull/124879 was recently approved. Hopefully it lands soon and this will be unblocked.
Soon™️
Soon™️
It seems like the rest reviewer (@alexdima) in on vacation (due to GH activity).
It's not possible to somehow plumb the max_line_length value through to the vscodevim.vim extension in the meantime, is it? I noticed that whatever I configure max_line_length to, the Vim extension just uses a hard-coded global "vim.textwidth" value. 😞
This is just sad.
PS: The Shopify Ruby Extensions Pack for Visual Studio Code includes a notable setting for editor rulers. This setting configures the editor to display a ruler at the 120-character mark for Ruby files, aiming to encourage code clarity and maintainability by visually marking a recommended line length limit. More details and configurations can be found in the extension's GitHub repository.
Probably the easiest way to archive this, right now.