Use own version of toJson
This avoids having the uri transformed unexpectedly
This commit is contained in:
parent
5e96337121
commit
1cfd3a1b28
1 changed files with 11 additions and 2 deletions
|
@ -32,10 +32,19 @@ export class OpenDocumentLinkCommand implements Command {
|
|||
path: vscode.Uri,
|
||||
fragment: string,
|
||||
): vscode.Uri {
|
||||
const toJson = (uri: vscode.Uri) => {
|
||||
return {
|
||||
scheme: uri.scheme,
|
||||
authority: uri.authority,
|
||||
path: uri.path,
|
||||
fragment: uri.fragment,
|
||||
query: uri.query,
|
||||
};
|
||||
};
|
||||
return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify(<OpenDocumentLinkArgs>{
|
||||
path: path.toJSON(),
|
||||
path: toJson(path),
|
||||
fragment,
|
||||
fromResource: fromResource.toJSON(),
|
||||
fromResource: toJson(fromResource),
|
||||
}))}`);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue