Skip to content

"Normalize" URI comparison between LSP/Code workspace edits. #3792

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

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
"Normalize" URI comparison between LSP/Code workspace edits.
- On Windows, URI conversion (LSP -> Code) encodes certain characters
  (eg. ':') so that simple comparison will fail. Ensure URIs from the
  LSP get normalized as well

Signed-off-by: Roland Grunberg <[email protected]>
  • Loading branch information
rgrunber committed Sep 30, 2024
commit d1d38922157da869c4170fb4534cf12dea0f5be5
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
extractInterfaceSupport: true,
advancedUpgradeGradleSupport: true,
executeClientCommandSupport: true,
snippetEditSupport: false,
snippetEditSupport: true,
},
triggerFiles,
},
Expand Down Expand Up @@ -321,7 +321,7 @@ export async function activate(context: ExtensionContext): Promise<ExtensionAPI>
if ("textDocument" in docChange) {
for (const edit of docChange.edits) {
if ("snippet" in edit) {
documentUris.push(docChange.textDocument.uri);
documentUris.push(Uri.parse(docChange.textDocument.uri).toString());
snippetEdits.push(new SnippetTextEdit(client.protocol2CodeConverter.asRange((edit as any).range), new SnippetString((edit as any).snippet.value)));
}
}
Expand Down