Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track long lived diagnostics inside helix #6447

Merged
merged 3 commits into from
Dec 27, 2023

Commits on Aug 1, 2023

  1. Configuration menu
    Copy the full SHA
    c65b0d9 View commit details
    Browse the repository at this point in the history
  2. 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.
    pascalkuthe committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    caeeaea View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6b6d96f View commit details
    Browse the repository at this point in the history