helix-mods/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.
2023-12-27 15:28:14 +09:00
..
doc_formatter Feat: LSP Type Hints (#5934) 2023-03-11 11:32:14 +09:00
increment Fix new clippy lints (#5892) 2023-02-09 16:27:08 -06:00
auto_pairs.rs Fix erroneous indent between closers of auto-pairs (#5330) 2022-12-29 09:23:40 -06:00
chars.rs Temporarily turn on unicode-lines 2022-03-17 10:53:50 +09:00
comment.rs Prevent a panic when uncommenting a line with only a comment token (#5933) 2023-02-12 13:13:22 -06:00
config.rs Add support for local language configuration (#1249) 2022-04-18 12:10:51 +09:00
diagnostic.rs make diagnostics stick to word boundaries 2023-12-27 15:28:14 +09:00
diff.rs delete outdated reference to cessen/ropey#25 (#4928) 2022-11-28 19:07:47 -06:00
doc_formatter.rs rework positioning/rendering and enable softwrap/virtual text (#5420) 2023-02-01 02:03:19 +09:00
fuzzy.rs Don't use word splitting during fuzzy matching (#8192) 2023-09-06 23:03:48 +09:00
graphemes.rs Prevent GraphemeStrs created from Strings from leaking (#7920) 2023-08-12 20:13:06 -05:00
history.rs Prefer RopeSlice to &Rope in helix_core::syntax 2023-07-27 11:50:19 +09:00
indent.rs fix :indent-style crash (#9087) 2023-12-15 19:05:04 +01:00
lib.rs transition to nucleo for fuzzy matching (#7814) 2023-08-30 13:26:21 +09:00
line_ending.rs Add config for default line ending (#5621) 2023-06-16 12:02:15 -05:00
macros.rs Split parts of helix-term into helix-view. 2020-09-21 18:24:16 +09:00
match_brackets.rs Reformat with nightly rustfmt for better let-else formatting (#7721) 2023-07-27 11:57:19 +09:00
movement.rs add node boundary movement 2023-08-01 09:41:42 -05:00
object.rs Fix edge-case in tree-sitter expand_selection selection command (#2877) 2022-06-25 13:12:30 -05:00
path.rs Remove unnecessary Err from get_canonicalized_path (#8009) 2023-08-20 21:11:32 +02:00
position.rs Fix typos (#6643) 2023-04-07 23:10:38 +08:00
rope_reader.rs search buffer contents during global search (#5652) 2023-07-11 21:26:11 +09:00
search.rs Jump to the next number on the line before incrementing (#1778) 2022-04-01 22:14:37 +09:00
selection.rs Add '#' and '.' special registers 2023-07-31 15:05:38 +09:00
shellwords.rs Fix typos (#6643) 2023-04-07 23:10:38 +08:00
surround.rs Fix warnings from clippy (#7013) 2023-05-11 14:44:52 +09:00
syntax.rs Add config to mark diagnostic sources as persistent 2023-12-27 15:28:14 +09:00
test.rs fix test::plain 2023-03-20 18:34:40 -05:00
text_annotations.rs Fix typos (#6643) 2023-04-07 23:10:38 +08:00
textobject.rs fix test::plain 2023-03-20 18:34:40 -05:00
transaction.rs make diagnostics stick to word boundaries 2023-12-27 15:28:14 +09:00
wrap.rs don't break on hyphen with :reflow (#8569) 2023-10-21 07:58:36 -05:00