elixir-lsp / vscode-elixir-ls

Elixir language support and debugger for VS Code, powered by ElixirLS.
https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls
MIT License
545 stars 105 forks source link

Honor .formatter.exs line_length in editor.ruler #395

Closed TheFirstAvenger closed 12 months ago

TheFirstAvenger commented 1 year ago

Is it possible to read the .formatter.exs line_length property and use that to override the edtior.rulers value in VSCode for that project, making the vertical line length indicator always accurate to the current project? If it is not present in that file, then the formatter default of 98 should be applied.

lukaszsamson commented 12 months ago

Interesting idea. This would require evaluating Mix.Tasks.Format.formatter_for_file for each file but we can add a custom LSP command doing that. Do you know which vscode API can override edtior.rulers?

TheFirstAvenger commented 12 months ago

Hmmm... upon further digging, it looks like there is an open PR for VSCode to support this.

lukaszsamson commented 12 months ago

Given that the PR is > 2y old and the issue https://github.com/microsoft/vscode/issues/111251 is > 3y old I'm not optimistic this is going to be supported soon

TheFirstAvenger commented 12 months ago

Yeah that makes sense. I will keep an eye on those PRs and if they happen to merge I will revisit this.