microsoft / microsoft/vscode-extension-samples

Documentation for usage of CompletionItem's range property

Open
#655 2 comments 0 reactions 1 assignee View on GitHub

@jrieken is already working on this.

Since May 31, 2022.

feature-request
Dominant language
TypeScript
Stars
10.2k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

vscode's CompletionItem[^1] 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.

[^1]: Also wondering if this issue is related.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.