Problem:
version fails for jdtls
Solution:
Try `-version` (one hyphen). Drop `-v`, it's probably not useful. Also
drop `-h` because it is unlikely to work if `--help` didn't work.
TODO: make a smarter guess about the actual "argv0" of `cmd`.
Problem:
debug.info() is useless for some functions because they point to util.lua
Solution:
Provide a path to the source code instead of trying to inline the source
code.
The configuration for the Ada Language Server was first added in #171 and
removed in #3310. The removal happened due to misunderstandings, it was thought
at the time that the default language server configuration could not work on its
own (#1683), it turns out that this was actually caused by a bug in the ALS that
was fixed a long time ago. This means the default ALS configuration can be
re-introduced.
However, in the meantime, a new neovim plugin for Ada was created and the name
"als" was borrowed, thus we have to use a new name, ada_ls, in order to avoid
breaking this plugin.
This reverts commit 7b8b0b3ddd.
Problem:
`cmd` may be a random function instead of an executable command.
ERROR Failed to run healthcheck for "lspconfig" plugin. Exception:
.../lua/lspconfig/health.lua:127: attempt to index field 'cmd' (a function value)
Solution:
Skip attempt to invoke `<cmd> --version` if `cmd` is a function.
- improve version handling: try --version, -v, etc.
- avoid hanging commands (timeout after 1s).
- also collect stderr.
- show "Tried: ..." on failure.
- omit "custom handlers" if none found.
Problem:
`config.lspinfo` is an undocumented feature that allows extending the
info shown in `:LspInfo` (`:checkhealth lspconfig`).
This feature is unwanted because:
- it's undocumented
- it adds a maintenance burden
- it provides info that should be derived from the LSP protocol itself.
Solution:
Remove support for `config.lspinfo`.
Instead, `:LspInfo` (`:checkhealth lspconfig`) should be enhanced to
automatically gather this kind of extra info from the server response.
## Problem
The current `LspStop` behavior is confusing and wrong:
**Server name:**
- If the server with the given `server_name` is **not attached**:
- No notification is shown, and **all** LSP servers are stopped.
- If the server with the given `server_name` is **attached**:
- **Incorrectly** closes all LSP servers.
- If no servers are attached:
- `server_name` is notified as missing.
**Server ID:**
- If the server with the given `server_id` is **not attached**:
- Uses `get_managed_clients()` function 541f3a2781/plugin/lspconfig.lua (L45-L47) Which doesn't return all servers (e.g., `null-ls`), so it doesn't close all LSP clients.
- If the server with the given `server_id` is **attached**:
- The correct LSP server is stopped (including `null-ls`).
**No arguments:**
- If servers are **attached**:
- Stops all servers.
- If no servers are attached:
- **Incorrectly** notifies the user with: `config "" not found`.
## Solution
**Server name:**
- If the server with the given `server_name` is **not attached**:
- Notify the user, but **do not close** any servers.
- If the server with the given `server_name` is **attached**:
- Close the specified server.
**Server ID:**
- If the server with the given `server_id` is **not attached**:
- Notify the user, but **do not close** any servers.
- If the server with the given `server_id` is **attached**:
- Close the specified server.
**No arguments:**
- If servers are **attached**:
- Stops all servers.
- If no servers are attached:
- No-op.