Skip to content
Commit be71dd4b authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

lsp: Adjust completion range to replace based on server data

Some server send over completion's for a range whose start is before
the position we requested completion for e.g.,

import package:mypackage/[Cursor]

The server might send in a completion "package:mypackage..." for a
range that starts right after "import". With our current implementation
we end up having something like:

import package:mypackage/package:mypackage/somefile[Cursor]

If the server sent a CompletionItem.textEdit.range and that range's
start is different than what we have, perfer the server. This leads to
better completion because the server might be supplying items for a
bigger range than just the current word under cursor.

Tested with 2 servers dart and clangd and haven't noticed any odd
behaviour in the last 2 days.
parent 6b40b9ea
Pipeline #435334 passed with stages
in 8 minutes and 6 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment