diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index ca87d5f7227..f109d0b1aba 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5629,6 +5629,20 @@ declare module 'vscode' { */ asAbsolutePath(relativePath: string): string; + /** + * The uri of a workspace specific directory in which the extension + * can store private state. The directory might not exist and creation is + * up to the extension. However, the parent directory is guaranteed to be existent. + * The value is `undefined` when no workspace nor folder has been opened. + * + * Use [`workspaceState`](#ExtensionContext.workspaceState) or + * [`globalState`](#ExtensionContext.globalState) to store key value data. + * + * @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from + * an uri. + */ + readonly storageUri: Uri | undefined; + /** * An absolute file path of a workspace specific directory in which the extension * can store private state. The directory might not exist on disk and creation is @@ -5636,22 +5650,50 @@ declare module 'vscode' { * * Use [`workspaceState`](#ExtensionContext.workspaceState) or * [`globalState`](#ExtensionContext.globalState) to store key value data. + * + * @deprecated Use [storagePath](#ExtensionContent.storageUri) instead. */ readonly storagePath: string | undefined; + /** + * The uri of a directory in which the extension can store global state. + * The directory might not exist on disk and creation is + * up to the extension. However, the parent directory is guaranteed to be existent. + * + * Use [`globalState`](#ExtensionContext.globalState) to store key value data. + * + * @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from + * an uri. + */ + readonly globalStorageUri: Uri; + /** * An absolute file path in which the extension can store global state. * The directory might not exist on disk and creation is * up to the extension. However, the parent directory is guaranteed to be existent. * * Use [`globalState`](#ExtensionContext.globalState) to store key value data. + * + * @deprecated Use [globalStoragePath](#ExtensionContent.globalStorageUri) instead. */ readonly globalStoragePath: string; + /** + * The uri of a directory in which the extension can create log files. + * The directory might not exist on disk and creation is up to the extension. However, + * the parent directory is guaranteed to be existent. + * + * @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from + * an uri. + */ + readonly logUri: Uri; + /** * An absolute file path of a directory in which the extension can create log files. * The directory might not exist on disk and creation is up to the extension. However, * the parent directory is guaranteed to be existent. + * + * @deprecated Use [logUri](#ExtensionContext.logUri) instead. */ readonly logPath: string; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 843913db162..f04bacd67c2 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1960,61 +1960,6 @@ declare module 'vscode' { readonly contextValue?: string; } - //#endregion - //#region https://github.com/microsoft/vscode/issues/101857 - - export interface ExtensionContext { - - /** - * The uri of a directory in which the extension can create log files. - * The directory might not exist on disk and creation is up to the extension. However, - * the parent directory is guaranteed to be existent. - * - * @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from - * an uri. - */ - readonly logUri: Uri; - - /** - * The uri of a workspace specific directory in which the extension - * can store private state. The directory might not exist and creation is - * up to the extension. However, the parent directory is guaranteed to be existent. - * The value is `undefined` when no workspace nor folder has been opened. - * - * Use [`workspaceState`](#ExtensionContext.workspaceState) or - * [`globalState`](#ExtensionContext.globalState) to store key value data. - * - * @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from - * an uri. - */ - readonly storageUri: Uri | undefined; - - /** - * The uri of a directory in which the extension can store global state. - * The directory might not exist on disk and creation is - * up to the extension. However, the parent directory is guaranteed to be existent. - * - * Use [`globalState`](#ExtensionContext.globalState) to store key value data. - * - * @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from - * an uri. - */ - readonly globalStorageUri: Uri; - - /** - * @deprecated Use [logUri](#ExtensionContext.logUri) instead. - */ - readonly logPath: string; - /** - * @deprecated Use [storagePath](#ExtensionContent.storageUri) instead. - */ - readonly storagePath: string | undefined; - /** - * @deprecated Use [globalStoragePath](#ExtensionContent.globalStorageUri) instead. - */ - readonly globalStoragePath: string; - } - //#endregion //#region https://github.com/microsoft/vscode/issues/104436 diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts index 18600b6fff5..6c5dcf97dad 100644 --- a/src/vs/workbench/api/common/extHostExtensionService.ts +++ b/src/vs/workbench/api/common/extHostExtensionService.ts @@ -396,18 +396,9 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme get storagePath() { return that._storagePath.workspaceValue(extensionDescription)?.fsPath; }, get globalStoragePath() { return that._storagePath.globalValue(extensionDescription).fsPath; }, get logPath() { return path.join(that._initData.logsLocation.fsPath, extensionDescription.identifier.value); }, - get logUri() { - checkProposedApiEnabled(extensionDescription); - return URI.joinPath(that._initData.logsLocation, extensionDescription.identifier.value); - }, - get storageUri() { - checkProposedApiEnabled(extensionDescription); - return that._storagePath.workspaceValue(extensionDescription); - }, - get globalStorageUri() { - checkProposedApiEnabled(extensionDescription); - return that._storagePath.globalValue(extensionDescription); - }, + get logUri() { return URI.joinPath(that._initData.logsLocation, extensionDescription.identifier.value); }, + get storageUri() { return that._storagePath.workspaceValue(extensionDescription); }, + get globalStorageUri() { return that._storagePath.globalValue(extensionDescription); }, get extensionMode() { return extensionMode; }, get extensionRuntime() { checkProposedApiEnabled(extensionDescription);