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.
11 months ago
..
doc_formatter Feat: LSP Type Hints (#5934) 2 years ago
increment Fix new clippy lints (#5892) 2 years ago
auto_pairs.rs Fix erroneous indent between closers of auto-pairs (#5330) 2 years ago
chars.rs Temporarily turn on unicode-lines 3 years ago
comment.rs Prevent a panic when uncommenting a line with only a comment token (#5933) 2 years ago
config.rs Add support for local language configuration (#1249) 3 years ago
diagnostic.rs make diagnostics stick to word boundaries 11 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) 2 years ago
fuzzy.rs Don't use word splitting during fuzzy matching (#8192) 1 year ago
graphemes.rs Prevent GraphemeStrs created from Strings from leaking (#7920) 1 year ago
history.rs Prefer RopeSlice to &Rope in helix_core::syntax 1 year ago
indent.rs fix `:indent-style` crash (#9087) 11 months ago
lib.rs transition to nucleo for fuzzy matching (#7814) 1 year 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) 1 year ago
movement.rs add node boundary movement 1 year 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) 1 year ago
position.rs Fix typos (#6643) 2 years ago
rope_reader.rs search buffer contents during global search (#5652) 1 year ago
search.rs Jump to the next number on the line before incrementing (#1778) 3 years ago
selection.rs Add '#' and '.' special registers 1 year ago
shellwords.rs Fix typos (#6643) 2 years ago
surround.rs Fix warnings from clippy (#7013) 2 years ago
syntax.rs Add config to mark diagnostic sources as persistent 11 months ago
test.rs fix test::plain 2 years ago
text_annotations.rs Fix typos (#6643) 2 years ago
textobject.rs fix test::plain 2 years ago
transaction.rs make diagnostics stick to word boundaries 11 months ago
wrap.rs don't break on hyphen with :reflow (#8569) 1 year ago