mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
first cut proposed api for vscode.open, #66741
This commit is contained in:
@@ -497,6 +497,9 @@ export function createApiFactory(
|
||||
createInputBox(): vscode.InputBox {
|
||||
return extHostQuickOpen.createInputBox(extension.identifier);
|
||||
},
|
||||
open: proposedApiFunction(extension, (uri: URI) => {
|
||||
return extHostWindow.openUri(uri);
|
||||
})
|
||||
};
|
||||
|
||||
// namespace: workspace
|
||||
|
||||
@@ -621,6 +621,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
|
||||
|
||||
export interface MainThreadWindowShape extends IDisposable {
|
||||
$getWindowVisibility(): Promise<boolean>;
|
||||
$openUri(uri: UriComponents): Promise<any>;
|
||||
}
|
||||
|
||||
// -- extension host
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ExtHostWindowShape, MainContext, MainThreadWindowShape, IMainContext } from './extHost.protocol';
|
||||
import { WindowState } from 'vscode';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export class ExtHostWindow implements ExtHostWindowShape {
|
||||
|
||||
@@ -34,4 +35,8 @@ export class ExtHostWindow implements ExtHostWindowShape {
|
||||
this._state = { ...this._state, focused };
|
||||
this._onDidChangeWindowState.fire(this._state);
|
||||
}
|
||||
|
||||
openUri(uri: URI): Promise<boolean> {
|
||||
return this._proxy.$openUri(uri);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user