Do we need a setup wizard?
Most language server don't ask you to run a setup before using them. Why should ZLS? I think we have (mostly) chosen reasonable defaults for these configuration options or the user already has these options configured through their editor.
If the user is unhappy with the way ZLS is configured, these options are still available in the zls.json and this may even inform the user about further options, we chose not to include in the setup wizard.
I do not propose to remove these options, just to remove the need to go through zls --config because the default configuration is 'good enough' for most users.
ZLS should not be where users should configure their editor experience. We provide capabilities and the editor will request them based on how the user has configured their editor.
Ast check
Who doesn't want to see these compile errors without needing to compile?
And also, not everyone knows about zig ast-check and may think this option is about something different than just seeing more compile errors while editing.
Autofix
In the LSP specification you can specify 'Fix all' code actions by setting CodeActionKind to SourceFixAll.
The current implementation of autofix in ZLS does not use SourceFixAll but instead uses workspace/applyEdit or textDocument/willSaveWaitUntil which is kind of hacky. ZLS should use SourceFixAll so that this feature can instead be controlled by the editor/client.
@import/@embedFile argument path completion
Initially this feature's implementation had a bug that made it unstable, which is why this was disabled by default. This issue has already been resolved in a0723dbffd48abe65df7fec830058499a29ad5d5.
Semantic Tokens
This capability can already be configured through most editors/clients that support it. NOTE: some clients also provide options for disabling highlighting on certain elements (e.g. operators, strings).
Inlay hints
This capability can already be configured through most editors/clients that support it.
Operator completions
I can't think of any reason why you wouldn't want this, because the alternative is having no or useless completions.
The only remaining config options are snippet completions and style warnings. I don't this its necessary to keep a config wizard just for these two options.
I absolutely agree with you - in-editor configuration accounts for everything we need to configure and the rest should just be based on capabilities. I think @truemedian brought this up / made a PR for this a while back too.
Do you mean this PR #632?
Yep, I've definitely reconsidered my stance since then - most editors support just disabling LSP features you don't want to use at an editor or language level via capabilities, so we shouldn't double it up. :)
I agree with what truemedian said, but i don't think we should remove our config options. What if your editor doesn't have options to enable/disable a feature.
And also, if we want users to only need to configure a features in their editor, then we to enable most options by default. Which means setting enable_snippets enable_autofix enable_import_embedfile_argument_completions and enable_inlay_hints to true by default.
You're definitely right about editor support, "most editors" to me is just VSCode and Neovim :P
This all sounds good to me - time to nuke the setup wizard and get some better defaults I guess :)) Feel free to assign me or yourself to take this on.
I will take this on. Any thoughts on if we should also enable warn_style by default?
I don't think so, it's a bit too opiniated / inaccurate in my opinion.
I don't think so, it's a bit too opiniated / inaccurate in my opinion.
Good that ZLS doesn't have to be Opinionated, but make sure Andrew doesn't hear of this or he gonna make us to enforce warnings on misspelled variables. \j