parent
c12c8c1a68
commit
a068ebee8d
|
@ -8,7 +8,6 @@
|
|||
"license": "MIT",
|
||||
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
|
||||
"enabledApiProposals": [
|
||||
"markdownStringBaseUri",
|
||||
"resolvers",
|
||||
"workspaceTrust"
|
||||
],
|
||||
|
|
|
@ -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",
|
||||
]
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
"findTextInFiles",
|
||||
"fsChunks",
|
||||
"inlineCompletions",
|
||||
"markdownStringBaseUri",
|
||||
"notebookCellExecutionState",
|
||||
"notebookConcatTextDocument",
|
||||
"notebookContentProvider",
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue