If you configure a subset of severities to show in the workspace
diagnostics statusline element you can see the 'W' (and surrounding
space) without any diagnostic indicators. This is the case by default
as it's configured to show warnings and errors only - if you have only
hints in your workspace like if you open `application.rs` in Helix for
example then you would see the 'W' and no indicators.
This change checks that any of the configured diagnostics are non-zero
and bails early if there are none.
The switch to tree-house accidentally dropped some shebang parsing code
from the loader's function to detect by shebang. This change restores
that. The new code is slightly different as it's using a `regex_cursor`
regex on the Rope rather than eagerly converting the text to a
`Cow<str>` and running a regular regex across it.
This type also exists on `Editor`. This change brings it to the
`Document` as well because the replacement for `Syntax` in the child
commits will eliminate `Syntax`'s copy of `syn_loader`. `Syntax` will
also be responsible for returning the highlighter and query iterators
(which will borrow the loader), so the loader must be separated from
that type.
In the long run, when we make a larger refactor to have
`Document::apply` be a function of the `Editor` instead of the
`Document`, we will be able to drop this field on `Document` - it is
currently only necessary for `Document::apply`. Once we make that
refactor, we will be able to eliminate the surrounding `Arc` in
`Arc<ArcSwap<syntax::Loader>>` and use the `ArcSwap` directly instead.
This is for convenience when testing a few languages or themes, for
example while updating a language's parser and queries. query-check in
particular can take a while since parser initialization and query
analysis can each take some time and there are now many many languages.
Specifying the exact language makes the feedback loop much faster.
* Other languages use `comment.unused` instead of `comment.discard`.
* Fix the precedence of discarded variables - previously the parameter
highlight was higher precedence so discarded variables in the
parameter list were highlighted as parameters instead of
`comment.unused`.
The old check would allow sending textDocument/documentColor requests
when the server declared `{"colorProvider": false}` in its capabilities
as this was `Some`:
Some(ColorProviderCapability::Simple(false))
The Julia language server sets this explicitly to `false` in the wild.