You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/helix-core/src
Pascal Kuthe 515ef17207 make diagnostics stick to word boundaries
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.
6 months ago
..
doc_formatter Feat: LSP Type Hints (#5934) 1 year ago
increment Fix new clippy lints (#5892) 1 year ago
auto_pairs.rs Fix erroneous indent between closers of auto-pairs (#5330) 2 years ago
chars.rs Temporarily turn on unicode-lines 2 years ago
comment.rs Prevent a panic when uncommenting a line with only a comment token (#5933) 1 year ago
config.rs Add support for local language configuration (#1249) 2 years ago
diagnostic.rs make diagnostics stick to word boundaries 6 months ago
diff.rs delete outdated reference to cessen/ropey#25 (#4928) 2 years ago
doc_formatter.rs rework positioning/rendering and enable softwrap/virtual text (#5420) 1 year ago
fuzzy.rs Don't use word splitting during fuzzy matching (#8192) 10 months ago
graphemes.rs Prevent GraphemeStrs created from Strings from leaking (#7920) 11 months ago
history.rs Prefer RopeSlice to &Rope in helix_core::syntax 11 months ago
indent.rs fix `:indent-style` crash (#9087) 7 months ago
lib.rs transition to nucleo for fuzzy matching (#7814) 10 months ago
line_ending.rs Add config for default line ending (#5621) 1 year ago
macros.rs Split parts of helix-term into helix-view. 4 years ago
match_brackets.rs Reformat with nightly rustfmt for better let-else formatting (#7721) 11 months ago
movement.rs add node boundary movement 11 months ago
object.rs Fix edge-case in tree-sitter expand_selection selection command (#2877) 2 years ago
path.rs Remove unnecessary `Err` from `get_canonicalized_path` (#8009) 11 months ago
position.rs Fix typos (#6643) 1 year ago
rope_reader.rs search buffer contents during global search (#5652) 12 months ago
search.rs Jump to the next number on the line before incrementing (#1778) 2 years ago
selection.rs Add '#' and '.' special registers 11 months ago
shellwords.rs Fix typos (#6643) 1 year ago
surround.rs Fix warnings from clippy (#7013) 1 year ago
syntax.rs Add config to mark diagnostic sources as persistent 6 months ago
test.rs fix test::plain 1 year ago
text_annotations.rs Fix typos (#6643) 1 year ago
textobject.rs fix test::plain 1 year ago
transaction.rs make diagnostics stick to word boundaries 6 months ago
wrap.rs don't break on hyphen with :reflow (#8569) 8 months ago