Skip to content

Code Actions with snippets that contain "choices" are not handled correctly #3996

@DanTup

Description

@DanTup

Found by @bwilkerson:

image

image

This is likely because of this hack:

// HACK: This should be checking InsertTextFormat:
// https://github.com/microsoft/language-server-protocol/issues/724#issuecomment-800334721
const hasSnippet = /\$(\d+|\{\d+:([^}]*)\})/.test(textEdit.newText);
// if ((textEdit as any).insertTextFormat === InsertTextFormat.Snippet) {
if (hasSnippet) {

We should find a way to access insertTextFormat to make this reliable (but if it's not quick, we need to improve this regex to handle choices in the short-term).

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions