vscode-elixir-ls
vscode-elixir-ls copied to clipboard
editor.tabSize not configurable
Removed this setting from the readme because having it there gives the impression the tabSize can be overridden, but it can't at the moment
It is overrideable and 2 is a sensible default, as this is what is used by the formatter, which is also enabled by default.
And not mentioning it in the section about the "defaults" might again be misleading, as 2 is set as the default, which differs from the default VScode in general.
@NobbZ i'm sure its not. I had an issue sometime ago with the configuration when i tried changing it to 4 but that was ineffective then i read to source file formatting.ex def format which uses Code.format_string! and tabsize doesn't seam to be a valid option and probably won't be anytime soon as pointed out in the docs
editor.tabSize is a standard VSCode setting that is overridable, however the elixir formatter doesn't support changing the indentation amount/tabSize, so if you customize editor.tabSize than I highly recommend that you do not use the Elixir Formatter, or the VSCode Format on Save feature. And because editor.tabSize is set by default and is overridable it should remain in the docs.
I am creating https://github.com/elixir-lsp/vscode-elixir-ls/pull/203 to make that more clear in the settings. Would that change have made the situation easier to understand?
@axelson if you insist editor.tabSize should be set then who does the formatting then?. VSCode will not format a file but rather provide indentation while typing, and even if you happen to use say the prettier plugin for formatting the elixir language server will forcefully format tabSize as of the current release so its not an opt out feature either. So anyone wanting to opt out of just tabSize is impossible, which leaves type inference, syntax highlighting and debugging only. and tabSize should be recommend by another plugin that actually does the formatting.
Since its a standard config and meaningless to the elixir language server it serves no point advertising the support or including it in the config.
@axelson if you insist editor.tabSize should be set then who does the formatting then?
If the user wants to use a custom editor.tabSize then it is up to the user to do the formatting in that case, either manually or with another extension.
the elixir language server will forcefully format tabSize as of the current release so its not an opt out feature either
This is not true because vscode-elixir-ls does not force you to use the formatter. It just means that if you want to use a tabSize that is not 2 then you cannot use the formatter.
Since its a standard config and meaningless to the elixir language server it serves no point advertising the support or including it in the config.
In my opinion it is important to include editor.tabSize in this configuration section because it is a VSCode configuration that vscode-elixir-ls is overriding, because it "... sets the following default settings for Elixir files". In case you haven't seen it, here is where vscode-elixir-ls is setting a default for editor.tabSize: https://github.com/elixir-lsp/vscode-elixir-ls/blob/e3d8d3bdbbd5aa9b78c33db4ff187d26f4cc60cc/package.json#L32
And the default of 2 is important so that by default when a user presses "tab" they will get 2 spaces, which is what the majority of users expect because they are indenting their code with 2 spaces.
If the user wants to use a custom editor.tabSize then it is up to the user to do the formatting in that case, either manually or with another extension.
rightly said, So let the user set the editor.tabSize or the formatting plugin advertise this feature not the language server/plugin.
This is not true because vscode-elixir-ls does not force you to use the formatter. It just means that if you want to use a tabSize that is not 2 then you cannot use the formatter.
What i meant was vscode-elixir-ls formatting for editor.tabSize is not an opt out feature which means by using the vscode-elixir-ls formatting tab sizes is fixed at 2
In my opinion it is important to include
editor.tabSizein this configuration section because it is a VSCode configuration that vscode-elixir-ls is overriding, because it "... sets the following default settings for Elixir files". In case you haven't seen it, here is where vscode-elixir-ls is setting a default foreditor.tabSize
By definition configuration means configurable if the plugin will automatically set the editor.tabSize=2 that's fine, but shouldn't that be in the documentation as a feature of the formatting done by the plugin not the configuration.
And the default of 2 is important so that by default when a user presses "tab" they will get 2 spaces, which is what the majority of users expect because they are indenting their code with 2 spaces.
Well i don't know what the majority of elixir devs expect but I can say i and a couple of friends switched our elixir code base to 4 spacing and we never looked back. Like everything else formatting, its a matter of personal preference. I'm comfortable working at both tab sizes but my preference is 4, i find an indentation of two mostly used by people who use IDE or some GUI text editors with a sidepane usually, again just my observation.
I don't fill that is needed