Apply additionalTextEdits from completion items #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ondrejmirtes/lsp-client:additional-text-edits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Completion items can carry additionalTextEdits -- most commonly an auto-import
(a
usestatement that makes the inserted name valid). serverCompletionignored them, so accepting e.g. a class completion inside a namespace inserted a
bare name without its import.
This applies the additionalTextEdits along with the completion, remapping the
completion range through them so positions stay correct. Includes a test.
Note: this touches the same
applycode as the snippet-escapes PR, so it willconflict with that one -- happy to rebase whichever lands second.
We'll need to also implement
CompletionResult.mapfor this to be sound. If some change that doesn't affect the cursor or the text immediately around the selection comes in while a completion is active, it will be preserved, even though the document is no longer precisely what it was when the completion was queries. Same if such changes happen while the completion is being fetched.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.