mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 05:51:32 +01:00
web - change API to URI (from UriComponents)
This commit is contained in:
@@ -113,8 +113,8 @@ class PollingURLCallbackProvider extends Disposable implements IURLCallbackProvi
|
||||
FRAGMENT: 'vscode-fragment'
|
||||
};
|
||||
|
||||
private readonly _onCallback: Emitter<UriComponents> = this._register(new Emitter<UriComponents>());
|
||||
readonly onCallback: Event<UriComponents> = this._onCallback.event;
|
||||
private readonly _onCallback: Emitter<URI> = this._register(new Emitter<URI>());
|
||||
readonly onCallback: Event<URI> = this._onCallback.event;
|
||||
|
||||
create(options?: Partial<UriComponents>): URI {
|
||||
const queryValues: Map<string, string> = new Map();
|
||||
@@ -164,7 +164,7 @@ class PollingURLCallbackProvider extends Disposable implements IURLCallbackProvi
|
||||
const content = await streamToBuffer(result.stream);
|
||||
if (content.byteLength > 0) {
|
||||
try {
|
||||
this._onCallback.fire(JSON.parse(content.toString()));
|
||||
this._onCallback.fire(URI.revive(JSON.parse(content.toString())));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
@@ -201,4 +201,12 @@ const options: IWorkbenchConstructionOptions = JSON.parse(document.getElementByI
|
||||
options.urlCallbackProvider = new PollingURLCallbackProvider();
|
||||
options.credentialsProvider = new LocalStorageCredentialsProvider();
|
||||
|
||||
if (options.folderUri) {
|
||||
options.folderUri = URI.revive(options.folderUri);
|
||||
}
|
||||
|
||||
if (options.workspaceUri) {
|
||||
options.workspaceUri = URI.revive(options.workspaceUri);
|
||||
}
|
||||
|
||||
create(document.body, options);
|
||||
|
||||
Reference in New Issue
Block a user