diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index a3743d7eeb44093a036f53345165092ba11d8b76..67b899a4313058bb1602d64151b474317fdc41a2 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -7539,6 +7539,37 @@ declare module 'vscode' { */ export const name: string | undefined; + /** + * The location of the workspace file, for example: + * + * `file:///Users/name/Development/myProject.code-workspace` + * + * or + * + * `untitled:1555503116870` + * + * for a workspace that is untitled and not yet saved. + * + * Depending on the workspace that is opened, the value will be: + * * `undefined` when no workspace or a single folder is opened + * * the path of the workspace file as `Uri` otherwise. if the workspace + * is untitled, the returned URI will use the `untitled:` scheme + * + * The location can e.g. be used with the `vscode.openFolder` command to + * open the workspace again after it has been closed. + * + * **Example:** + * ```typescript + * vscode.commands.executeCommand('vscode.openFolder', uriOfWorkspace); + * ``` + * + * **Note:** it is not advised to use `workspace.workspaceFile` to write + * configuration data into the file. You can use `workspace.getConfiguration().update()` + * for that purpose which will work both when a single folder is opened as + * well as an untitled or saved workspace. + */ + export const workspaceFile: Uri | undefined; + /** * An event that is emitted when a workspace folder is added or removed. */ diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 9fec616de5a1c9a65ab7d968b166ecc0f2649168..8bdccfcb63fb2859adafb688120681bf3fb56a47 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1385,44 +1385,6 @@ declare module 'vscode' { } //#endregion - //#region Workspace URI Ben - - export namespace workspace { - - /** - * The location of the workspace file, for example: - * - * `file:///Users/name/Development/myProject.code-workspace` - * - * or - * - * `untitled:1555503116870` - * - * for a workspace that is untitled and not yet saved. - * - * Depending on the workspace that is opened, the value will be: - * * `undefined` when no workspace or a single folder is opened - * * the path of the workspace file as `Uri` otherwise. if the workspace - * is untitled, the returned URI will use the `untitled:` scheme - * - * The location can e.g. be used with the `vscode.openFolder` command to - * open the workspace again after it has been closed. - * - * **Example:** - * ```typescript - * vscode.commands.executeCommand('vscode.openFolder', uriOfWorkspace); - * ``` - * - * **Note:** it is not advised to use `workspace.workspaceFile` to write - * configuration data into the file. You can use `workspace.getConfiguration().update()` - * for that purpose which will work both when a single folder is opened as - * well as an untitled or saved workspace. - */ - export const workspaceFile: Uri | undefined; - } - - //#endregion - // #region Ben - status bar item with ID and Name export namespace window {