-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add replacementSpan for string completions #29270
Copy link
Copy link
Closed
Labels
Domain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorDomain: LS: TSServerIssues related to the TSServerIssues related to the TSServerExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Metadata
Metadata
Assignees
Labels
Domain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorDomain: LS: TSServerIssues related to the TSServerIssues related to the TSServerExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
TypeScript Version: 3.3.0-dev.2019010
From microsoft/vscode#53962
Search Terms:
Problem
For code such as:
Where a completion is being triggered at the
|in thefcall. VS code currently manually tries to compute the span to replace within the string. This is not very reliable because we are only have the text content of the document.Proposal:
For strings completions, it would be helpful if TS could return the entire range to be replaced with the
replacementSpanproperty on the completion item. This should be more reliable than having VS code try to compute it.In the above case, the replacement span would cover the range of
login.email