Expose `completion`, `semanticTokens`, `documentColor`,
`linkedEditingRange`, `onTypeFormatting`, and `inlineCompletion`.
Each feature uses `enable` to opt into Nixvim management and `activate`
as the value passed to `vim.lsp.<feature>.enable()`. `activate` defaults
to true, preserving the existing `inlayHints` and `codelens` output.
Set `enable = true` and `activate = false` to disable semantic tokens
or document color, which Neovim enables by default.
A shared table generates the global feature options and Lua.
`documentColor` also accepts `settings` for its `opts` argument.
`enabledByDefault` limits disable guidance to Neovim defaults, while
`settingsExample` carries the document color example.
Because `vim.lsp.completion.enable()` takes a client id and buffer,
completion runs from `LspAttach` after `onAttach`. Neovim snapshots
`completionProvider.triggerCharacters` when completion is enabled, so
users must extend that list first. See `:h lsp-autocompletion`.
`supports_method` receives `bufnr` so dynamic registration checks the
attached buffer. User `onAttach` code runs in a function so `return`
cannot skip Nixvim setup.
`client/unregisterCapability` is not handled, so withdrawn support
leaves completion state until the client detaches. If `onAttach` calls
`completion.enable()` first, its buffer options remain because Neovim
keeps the options from the first call.
Similar to `plugins.lsp.onAttach`, implement a "global" equivalent to
the per-server `on_attach` callback.
This is implemented using a `LspAttach` autoCmd.
Initial LSP keymaps option, inspired by `keymapsOnEvent` and
`plugins.lsp.keymaps`.
Users can define `lspBufAction` instead of `action` if they wish to use
a `vim.lsp.buf.<action>` callback.
Introduce a bespoke `global-server.nix` module. This is less DRY, but
much simpler.
The `lsp.servers."*"` options are different enough from the other
`lsp.servers.<name>` options that it is simpler to just declare them
separately.
Now that we have a dedicated `global-server.nix` module, we no longer
need to split the normal server module into `server.nix`+`server-base.nix`
This partially reverts f2e96b67a3
`"*"` is effectively a meta server, where shared config/defaults can be
set.
It shouldn't have options like `activate` or `package` which relate to
"real" servers. Therefore, we'll use `server-base.nix` directly, instead
of the full `server.nix` module.
`config` is a loaded term within modules and options.
`settings` is the name usually used for freeform config in nixvim and
most other module configurations.
Convert the `attrsOf (servers.nix)` option to a freeform submodule.
Declare a `servers.nix` option for each lsp server listed in
`lsp-packages.nix` that has a known nixpkgs package.
A simplified replacement for `plugins.lsp`.
Eventually, once the `lsp` and `plugins.lspconfig` modules are mature,
`plugins.lsp` will be deprecated and/or aliased.
This allows users to override the name used for a given `lsp.servers.*`
entry. The default is still the attr-name.
This may be useful to inject raw lua, or to configure the same server in
different ways via different attrs.