| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Diagnostics are currently extended if text is inserted at their end. This is
desirable when inserting text after an identifier. For example consider:
let foo = 2;
--- unused variable
Renaming the identifier should extend the diagnostic:
let foobar = 2;
------ unused variable
This is currently implemented in helix but as a consequence adding whitespaces
or a type hint also extends the diagnostic:
let foo = 2;
-------- unused variable
let foo: Bar = 2;
-------- unused variable
In these cases the diagnostic should remain unchanged:
let foo = 2;
--- unused variable
let foo: Bar = 2;
--- unused variable
As a heuristic helix will now only extend diagnostics that end on a word char
if new chars are appended to the word (so not for punctuation/ whitespace).
The idea for this mapping was inspired for the word level tracking vscode uses
for many positions. While VSCode doesn't currently update diagnostics after
receiving publishDiagnostic it does use this system for inlay hints for example.
Similarly, the new association mechanism implemented here can be used for word
level tracking of inlay hints.
A similar mapping function is implemented for word starts. Together
these can be used to make a diagnostic stick to a word. If that word
is removed that diagnostic is automatically removed too. This is the exact
same behavior VSCode inlay hints eixibit.
|
| |
|
|
|
|
|
|
|
| |
* removing unreachable statement in `:indent-style`
* update checks when setting indent line and update docs
* `cargo xtask docgen`
|
|
|
|
|
| |
Increase hybrid indent heuristic attempt limit to 4.
Clarify the fallback logic in indent heuristic docs.
|
| |
|
|
|
|
| |
Add tests to ensure that relative & absolute indent computation are consistent.
|
|
|
|
|
| |
i.e. also take into account the indentation of a previous
line when computing the indentation for a new line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* rust-toolchain.toml: bump MSRV to 1.70.0
With Firefox 120 released on 21 November 2023, the MSRV is now 1.70.0.
* Fix cargo fmt with Rust 1.70.0
* Fix cargo clippy with Rust 1.70.0
* Fix cargo doc with Rust 1.70.0
* rust-toolchain.toml: add clippy component
* .github: bump dtolnay/rust-toolchain to 1.70
* helix-term: bump rust-version to 1.70
* helix-view/gutter: use checked_ilog10 to count digits
* helix-core/syntax: use MAIN_SEPARATOR_STR constant
* helix-view/handlers/dap: use Display impl for displaying process spawn error
* WIP: helix-term/commands: use checked math to assert ranges cannot overlap
|
|
|
|
|
|
|
| |
Previously roots needed to be specified by every language and `[]` was
used as an explicit default. Root files don't make sense for every
language (for example TOML) so I think we should allow languages to
not explicitly mention the key and have the `[]` default automatically.
|
|
|
| |
precedence when multiple occur on the same line in an indent query.
|
|
|
|
|
|
|
|
| |
We only reverted so that the latest release would use a stable
tree-sitter version hosted on crates.io. We do want the improvements
on nightly.
This reverts commit 2ebcc4dbeb306cc285d47bd1d21d72c7e57ecb72.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* transition to nucleo for fuzzy matching
* drop flakey test case
since the picker streams in results now any test that relies
on the picker containing results is potentially flakely
* use crates.io version of nucleo
* Fix typo in commands.rs
Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>
---------
Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>
|
|
|
|
| |
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
YAML indents queries are tweaked to fix auto indent behavior.
A new capture type `indent.always` is introduced to address use cases
where combining indent captures on a single line is desired.
Fixes #6661
|
| |
|
|
|
|
|
|
|
| |
This is an unfortunately noisy change: we need to update virtually all
callsites that access the registers. For reads this means passing in the
Editor and for writes this means handling potential failure when we
can't write to a clipboard register.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These come from Kakoune:
* '#' is the selection index register. It's read-only and produces the
selection index numbers, 1-indexed.
* '.' is the selection contents register. It is also read-only and
mirrors the contents of the current selections when read.
We switch the iterators returned from Selection's `fragments` and
`slices` methods to ExactSizeIterators because:
* The selection contents register can simply return the fragments
iterator.
* ExactSizeIterator is already implemented for iterators over Vecs, so
it's essentially free.
* The `len` method can be useful on its own.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pascal and I discussed this and we think it's generally better to
take a 'RopeSlice' rather than a '&Rope'. The code block rendering
function in the markdown component module is a good example for how
this can be useful: we can remove an allocation of a rope and instead
directly turn a '&str' into a 'RopeSlice' which is very cheap.
A change to prefer 'RopeSlice' to '&Rope' whenever the rope isn't
modified would be nice, but it would be a very large diff (around 500+
500-). Starting off with just the syntax functions seems like a nice
middle-ground, and we can remove a Rope allocation because of it.
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
|
|
|
|
| |
In the past we used two separate queries for combined and normal injections. There was no real reason for this (except historical/slightly easier implementation). Instead, we now use a single query and simply check if an injection corresponds to a combined injection or not.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* correctly map unsorted positions
* Fix typo
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
---------
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Call as bytes before slicing, that way you can take bytes that aren't
aligned to chars. Should technically also be slightly faster since you
don't have to check alignment...
|
| |
|
|
|
|
|
|
|
|
|
| |
* Fix next/prev tree-sitter inconsistency
Before there where different results going to next or previous due to
sorting not dealing with multiple captures that start/end at the same
pos. I chose to prefer longer matches.
* Revert unnecessary change
|
| |
|
| |
|
| |
|
|
|
| |
seperator -> separator
|
|
|
|
|
|
|
|
|
|
|
| |
* Add command for merging non-consecutive ranges
* Add `merge_selections` command to book
* Simplify `merge_ranges`
Heeded the advice of @the-mikedavis to stop iterating over all ranges and simply merge the first and the last range, as the invariants of `Selection` guarantee that the list of ranges is always sorted and never empty.
* Clarify doc comment of `merge_ranges`
|
|
|
|
| |
retain order
|
| |
|
|
|
|
|
|
| |
return an iterator and refactor LanguageServerFeature handling to a HashMap (language server name maps to features)
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
|
|
|
|
| |
Co-authored-by: Ivan Tham <pickfire@riseup.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Language Servers are now configured in a separate table in `languages.toml`:
```toml
[langauge-server.mylang-lsp]
command = "mylang-lsp"
args = ["--stdio"]
config = { provideFormatter = true }
[language-server.efm-lsp-prettier]
command = "efm-langserver"
[language-server.efm-lsp-prettier.config]
documentFormatting = true
languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${INPUT}", formatStdin = true } ] }
```
The language server for a language is configured like this (`typescript-language-server` is configured by default):
```toml
[[language]]
name = "typescript"
language-servers = [ { name = "efm-lsp-prettier", only-features = [ "format" ] }, "typescript-language-server" ]
```
or equivalent:
```toml
[[language]]
name = "typescript"
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ]
```
Each requested LSP feature is priorized in the order of the `language-servers` array.
For example the first `goto-definition` supported language server (in this case `typescript-language-server`) will be taken for the relevant LSP request (command `goto_definition`).
If no `except-features` or `only-features` is given all features for the language server are enabled, as long as the language server supports these. If it doesn't the next language server which supports the feature is tried.
The list of supported features are:
- `format`
- `goto-definition`
- `goto-declaration`
- `goto-type-definition`
- `goto-reference`
- `goto-implementation`
- `signature-help`
- `hover`
- `document-highlight`
- `completion`
- `code-action`
- `workspace-command`
- `document-symbols`
- `workspace-symbols`
- `diagnostics`
- `rename-symbol`
- `inlay-hints`
Another side-effect/difference that comes with this PR, is that only one language server instance is started if different languages use the same language server.
|