Skip to content

Commit 3422d28

Browse files
author
Benjamin Pasero
committed
web api - use URIComponents
1 parent f8effd5 commit 3422d28

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/vs/code/browser/workbench/workbench.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class PollingURLCallbackProvider extends Disposable implements IURLCallbackProvi
117117
FRAGMENT: 'vscode-fragment'
118118
};
119119

120-
private readonly _onCallback: Emitter<URI> = this._register(new Emitter<URI>());
121-
readonly onCallback: Event<URI> = this._onCallback.event;
120+
private readonly _onCallback: Emitter<UriComponents> = this._register(new Emitter<UriComponents>());
121+
readonly onCallback: Event<UriComponents> = this._onCallback.event;
122122

123123
create(options?: Partial<UriComponents>): URI {
124124
const queryValues: Map<string, string> = new Map();
@@ -168,7 +168,7 @@ class PollingURLCallbackProvider extends Disposable implements IURLCallbackProvi
168168
const content = await streamToBuffer(result.stream);
169169
if (content.byteLength > 0) {
170170
try {
171-
this._onCallback.fire(URI.revive(JSON.parse(content.toString())));
171+
this._onCallback.fire(JSON.parse(content.toString()));
172172
} catch (error) {
173173
console.error(error);
174174
}

src/vs/workbench/services/url/browser/urlService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface IURLCallbackProvider {
1616
* Indicates that a Uri has been opened outside of VSCode. The Uri
1717
* will be forwarded to all installed Uri handlers in the system.
1818
*/
19-
readonly onCallback: Event<URI>;
19+
readonly onCallback: Event<UriComponents>;
2020

2121
/**
2222
* Creates a Uri that - if opened in a browser - must result in
@@ -54,7 +54,7 @@ export class BrowserURLService extends AbstractURLService {
5454

5555
private registerListeners(): void {
5656
if (this.provider) {
57-
this._register(this.provider.onCallback(uri => this.open(uri)));
57+
this._register(this.provider.onCallback(uri => this.open(URI.revive(uri))));
5858
}
5959
}
6060

0 commit comments

Comments
 (0)