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
VS Code version 1.86 support new API to correctly implement the Snippet suppport. Here is what needs to be done:
client\package.json. Things that need to be update are theengineproperty and the correspondingdevDependencies/@types/vscodenpm run updateVSCodeVersionChange the code in the protocol converter here as follows:
vscode-languageserver-node/client/src/common/protocolConverter.ts
Line 1088 in 2d33852
replaceon the result, construct VS Code text edits yourself, correctly converting LSPSnippetTextEditinto VS CodeSnippetTextEdit.When all edits are converted call
result.setwith this signature: https://github.com/microsoft/vscode/blob/56ed836ea9bae1602cf83bc286c7480b1370a99f/src/vscode-dts/vscode.d.ts#L3975