Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dbaeumer opened this issue Feb 2, 2024 · 2 comments
Assignees
Milestone

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Feb 2, 2024

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

@dbaeumer
Copy link
Member Author

dbaeumer commented Feb 2, 2024

@MariaSolOs do you want to give that a try?

@dbaeumer dbaeumer added this to the March 2024 milestone Feb 2, 2024
@dbaeumer dbaeumer self-assigned this Feb 2, 2024
@MariaSolOs
Copy link
Contributor

@MariaSolOs do you want to give that a try?

Yes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants