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

Documentation for usage of CompletionItem's range property #655

Open
manunamz opened this issue May 31, 2022 · 2 comments
Open

Documentation for usage of CompletionItem's range property #655

manunamz opened this issue May 31, 2022 · 2 comments
Assignees

Comments

@manunamz
Copy link

vscode's CompletionItem1 supports a range property which is (from the docs):

A range or a insert and replace range selecting the text that should be replaced by this completion item.

When omitted, the range of the current word is used as replace-range and as insert-range the start of the current word to the current position is used.

Note 1: A range must be a single line and it must contain the position at which completion has been requested. Note 2: A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.

Further documentation/an example illustrating how to use the range property would be incredibly useful.

Even better would be an example of how the trigger character(s) may be overwritten with either the insertText property or by some other method.

Footnotes

  1. Also wondering if this issue is related.

@devarmenchik1408
Copy link

vscode's CompletionItem1 supports a range property which is (from the docs):

A range or a insert and replace range selecting the text that should be replaced by this completion item.
When omitted, the range of the current word is used as replace-range and as insert-range the start of the current word to the current position is used.
Note 1: A range must be a single line and it must contain the position at which completion has been requested. Note 2: A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.

Further documentation/an example illustrating how to use the range property would be incredibly useful.

Even better would be an example of how the trigger character(s) may be overwritten with either the insertText property or by some other method.

Footnotes

  1. Also wondering if this issue is related.

``

@adegeo
Copy link

adegeo commented Sep 17, 2024

I can't figure this one out. Adding any range just kills my completion item.. ugh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants