Skip to content

TSServer: snippet completions #25207

Closed
Closed
@mjbvz

Description

@mjbvz

Provide a generic, cross editor snippet type that can be used to express complex text insertion operations. At a minimum, these snippets should include placeholder values and indicate where the cursor should end up.

For example, snippets could fill in function call arguments with placeholders. If the user completes ad to add here:

function add(x, y) { return x + y; }

ad|

The inserted snippet would be:

function add(x, y) { return x + y; }

add(«x», «y»)

Where the user can tab from the placeholder values «x» to «y».

Use Cases

Why is this needed
Snippets speed up coding and provide additional hints while writing code. VS Code already tries to convert TS's existing response types to snippets but fails to handle many edge cases. In order to improve reliability and support more advanced used cases such as microsoft/vscode#48562, I believe that TS needs to start generating these snippets directly

Metadata

Metadata

Assignees

Labels

Domain: TSServerIssues related to the TSServerIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions