editorconfig-vscode icon indicating copy to clipboard operation
editorconfig-vscode copied to clipboard

Add support for max_line_length

Open userlerueda opened this issue 5 years ago • 10 comments

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-extensions and 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 -g and ran editorconfig [file-in-question] and the configuration was what I expected. If not, please file on the editorconfig-core-js issue 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

userlerueda avatar Jun 01 '20 23:06 userlerueda

Have you tried installing Prettier? It extends EditorConfig and is better suited for that task, as it's syntax-specific.

jednano avatar Jun 01 '20 23:06 jednano

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.

YarnSphere avatar Jul 20 '20 15:07 YarnSphere

I submitted a vscode extension API request for the ability to do that.

https://github.com/microsoft/vscode/issues/111251

jednano avatar Nov 24 '20 20:11 jednano

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.

waldyrious avatar Nov 25 '20 10:11 waldyrious

FYI: https://github.com/microsoft/vscode/pull/124879 was recently approved. Hopefully it lands soon and this will be unblocked.

twelvelabs avatar Oct 17 '22 14:10 twelvelabs

Soon™️

ImUrX avatar Jan 20 '23 04:01 ImUrX

Soon™️

It seems like the rest reviewer (@alexdima) in on vacation (due to GH activity).

AlexWayfer avatar Jan 20 '23 06:01 AlexWayfer

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. 😞

dbarnett avatar Dec 29 '23 22:12 dbarnett

This is just sad.

cristian-eriomenco avatar Mar 27 '24 12:03 cristian-eriomenco

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.

viktorianer avatar Mar 27 '24 12:03 viktorianer