diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index c6d2722d421..d5b9bb4df3c 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -8,7 +8,6 @@ "license": "MIT", "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", "enabledApiProposals": [ - "markdownStringBaseUri", "resolvers", "workspaceTrust" ], diff --git a/extensions/typescript-language-features/tsconfig.json b/extensions/typescript-language-features/tsconfig.json index 883b4b81749..07d4066f89b 100644 --- a/extensions/typescript-language-features/tsconfig.json +++ b/extensions/typescript-language-features/tsconfig.json @@ -12,7 +12,6 @@ "../../src/vscode-dts/vscode.d.ts", "../../src/vscode-dts/vscode.proposed.inlayHints.d.ts", "../../src/vscode-dts/vscode.proposed.languageStatus.d.ts", - "../../src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts", "../../src/vscode-dts/vscode.proposed.resolvers.d.ts", "../../src/vscode-dts/vscode.proposed.workspaceTrust.d.ts", ] diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index 9ea109c5afc..2d0e6e7df14 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -17,7 +17,6 @@ "findTextInFiles", "fsChunks", "inlineCompletions", - "markdownStringBaseUri", "notebookCellExecutionState", "notebookConcatTextDocument", "notebookContentProvider", diff --git a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts index caac26cff71..62b43285f2e 100644 --- a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts +++ b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts @@ -25,7 +25,6 @@ export const allApiProposals = Object.freeze({ idToken: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts', inlineCompletions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletions.d.ts', ipc: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts', - markdownStringBaseUri: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts', notebookCellExecutionState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts', notebookConcatTextDocument: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookConcatTextDocument.d.ts', notebookContentProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookContentProvider.d.ts', diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 11868ce6243..c8dc07c81c2 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -2660,6 +2660,27 @@ declare module 'vscode' { */ supportHtml?: boolean; + /** + * Uri that relative paths are resolved relative to. + * + * If the `baseUri` ends with `/`, it is considered a directory and relative paths in the markdown are resolved relative to that directory: + * + * ```ts + * const md = new vscode.MarkdownString(`[link](./file.js)`); + * md.baseUri = vscode.Uri.file('/path/to/dir/'); + * // Here 'link' in the rendered markdown resolves to '/path/to/dir/file.js' + * ``` + * + * If the `baseUri` is a file, relative paths in the markdown are resolved relative to the parent dir of that file: + * + * ```ts + * const md = new vscode.MarkdownString(`[link](./file.js)`); + * md.baseUri = vscode.Uri.file('/path/to/otherFile.js'); + * // Here 'link' in the rendered markdown resolves to '/path/to/file.js' + * ``` + */ + baseUri?: Uri; + /** * Creates a new markdown string with the given value. * diff --git a/src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts b/src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts deleted file mode 100644 index 19a85286f67..00000000000 --- a/src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'vscode' { - - // https://github.com/microsoft/vscode/issues/142051 - - interface MarkdownString { - /** - * Uri that relative paths are resolved relative to. - * - * If the `baseUri` ends with `/`, it is considered a directory and relative paths in the markdown are resolved relative to that directory: - * - * ```ts - * const md = new vscode.MarkdownString(`[link](./file.js)`); - * md.baseUri = vscode.Uri.file('/path/to/dir/'); - * // Here 'link' in the rendered markdown resolves to '/path/to/dir/file.js' - * ``` - * - * If the `baseUri` is a file, relative paths in the markdown are resolved relative to the parent dir of that file: - * - * ```ts - * const md = new vscode.MarkdownString(`[link](./file.js)`); - * md.baseUri = vscode.Uri.file('/path/to/otherFile.js'); - * // Here 'link' in the rendered markdown resolves to '/path/to/file.js' - * ``` - */ - baseUri?: Uri; - } -}