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

Improved Completion #5728

Merged
merged 6 commits into from
Mar 10, 2023
Merged

Commits on Mar 9, 2023

  1. allow LSP insert text to replace non-matching prefixes (helix-editor#…

    …5469)
    
    Most LSPs will complete case-insensitive matches, particularly from
    lowercase to uppercase.  In some cases, notably Pyright, this is given
    as a simple insert text instead of TextEdit.  When this happens, the
    prefix text was left unedited.
    Taylor C. Richberger authored and pascalkuthe committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    fd9af64 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    83bdd48 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0e436a5 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2023

  1. Add API to create a Transaction from potentially overlapping changes

    This commit adds new functions to `Transaction` that allow creating
    edits that might potentially overlap. Any change that overlaps
    previous changes is ignored. Furthermore, a utility method is added
    that also drops selections associated with dropped changes (for
    transactions that are created from a selection).
    
    This is needed to avoid crashes when applying multicursor
    autocompletions, as the edit from a previous cursor may overlap
    with the next cursor/edit.
    pascalkuthe committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    96649ab View commit details
    Browse the repository at this point in the history
  2. fix snippet bugs and multicursor completion edgecases

    Multicursor completions may overlap and therefore overlapping
    completions must be dropped to avoid crashes. Furthermore, multicursor
    edits might simply be out of range if the word before/after the cursor
    is shorter. This currently leads to crashes, instead these selections
    are now also removed for completions.
    
    This commit also significantly refactors snippet transaction generation
    so that tabstops behave correctly with the above rules. Furthermore,
    snippet tabstops need to be carefully mapped to ensure their position
    is correct and consistent with our selection semantics. Finally,
    we now keep a partially updated Rope while creating snippet
    transactions so that we can fill information into snippets that
    depends on the position in the document.
    pascalkuthe committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    ecce1f7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3b88d74 View commit details
    Browse the repository at this point in the history