Skip to content

Commit

Permalink
"Normalize" URI comparison between LSP/Code workspace edits.
Browse files Browse the repository at this point in the history
- 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 Oct 1, 2024
1 parent 0149fc7 commit 24147e2
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 24147e2

Please sign in to comment.