`:lsp-stop` should consider only the set of active language servers for
a document. `:lsp-restart` though may be used to start up a language
server that crashed or was manually stopped, so it needs to consider the
language servers in config instead.
This change inlines the `valid_lang_servers` function into `:lsp-stop`
and `:lsp-restart` and changes `:lsp-restart` to check the doc's config
rather than active language servers. `:lsp-restart` now also does not
need to clone the language server names as strings since it borrows from
the config and arguments rather than `Document`. The completer has also
been split into two - one matching active language servers, used by
`:lsp-stop`, and the other matching configured language servers, used by
`:lsp-restart`.
This also removes the part of `:lsp-restart` which bailed if a language
server failed to be restarted (for example because it is not installed).
There might be multiple language servers configured for a language and
only one installed. In that case the `:lsp-restart` should be considered
successful even if not all servers could be started. Bailing prevented
any language servers which could start from being attached to the
document. Instead errors are collected and emitted at the end.
The clone of the hashmap can be avoided by passing a ref instead. This
commit also changes the `server_environment` type to match the bounds
expected by `Command::envs` - this will avoid future refactoring if the
underlying type changes (for example switching to `hashbrown::HashMap`).
Previously all register selection info boxes had "Registers" as the
title. That was particularly confusing for `copy_between_registers`
which presents two info boxes back-to-back.
The application held onto these since their introduction in ce97a2f0 but
the Arcs are duplicated between Application and Editor - we can store it
only on Editor without issue.
This is following `hashbrown`'s switch in v0.15 from ahash to foldhash
for its `default-haster` feature, applied only to helix-event for now.
I don't have a strong preference between the two. Benchmarks in
Spellbook, which is particularly sensitive to hashers and hash table
performance, show no perceptible difference. Foldhash is dependency-free
though.
Once we migrate to the new tree-sitter bindings and highlighter we
should be able to eliminate the remaining dependencies on ahash.
The dependabot file was matching on tree-sitter crates - that's a relic
from v0.6.0 and lower where grammars were regular dependencies.
The remaining changes are unused crates that were forgotten about during
shuffles like moving path canonicalization from helix-core to
helix-loader (and then again from helix-loader to helix-stdx).
Previously the `filter` caused the diagnostics to not be attached to the
document - which is good - but the out-of-date diagnostics were still
inserted into the global (editor-wide) diagnostic set. Instead we should
completely discard out-of-date diagnostics.
There is no functional change to the move - it's just moving the code
into helix-view under a new method `Editor::handle_lsp_diagnostics` -
thought there is a typo fix, the removal of an unnecessary clone (for
the document's language config) and the removal of some nesting.
Co-authored-by: Sofus Addington <sofus@addington.dk>
We do not highlight `(ERROR)` nodes since the highlighting is quite
noisy while typing. Also see todo comments in `syntax.rs` - we could
introduce configuration in the future to prepend `(ERROR)` to a
language's highlights query.
This matches <https://redirect.github.com/helix-editor/helix/pull/4852>
for the DAP transport: when there is a failure to receive a message from
the debugger we should drain all pending requests and respond to them
with the StreamClosed error.
This improves the behavior when a debugger fails to initialize, for
example starting debugpy without debugpy installed. Previously the UI
would freeze until the request timed out. Now it instantly prints a
statusline error saying that the debugger failed to start up.
`reader` is already a `BufReader` so there's no need to wrap it in
another `BufReader`. This is a typo/mistake made possible by the type
erasure (a `Box<BufReader<BufReader<T: Read>>>` is also a boxed reader).
By default this is `Stdio::inherit` which sends stderr from the child
process to Helix. Instead we should use `Stdio::piped` which allows us
to read the piped output.
We can also expect that the stderr opens now (it should similarly to
stdout), so that we always start a reader for stderr like the LSP
client.