KEMBAR78
Fix ProtocolConverter#asWorkspaceEdit to correctly support workspace edits with snippets · Issue #1414 · microsoft/vscode-languageserver-node · GitHub
Skip to content

Fix ProtocolConverter#asWorkspaceEdit to correctly support workspace edits with snippets #1414

@dbaeumer

Description

@dbaeumer

VS Code version 1.86 support new API to correctly implement the Snippet suppport. Here is what needs to be done:

  • update grade to VS Code version 1.86 by adjusting the client\package.json. Things that need to be update are the engine property and the corresponding devDependencies/@types/vscode
  • in the client folder run npm run updateVSCodeVersion

Change the code in the protocol converter here as follows:

for (const edit of change.edits) {

  • instead of calling the replace on the result, construct VS Code text edits yourself, correctly converting LSP SnippetTextEdit into VS Code SnippetTextEdit.
  • if the edit as an annotation convert it as well
  • mained the converted edits in an array [TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata | undefined][]

When all edits are converted call result.set with this signature: https://github.com/microsoft/vscode/blob/56ed836ea9bae1602cf83bc286c7480b1370a99f/src/vscode-dts/vscode.d.ts#L3975

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions