Skip to content

Commit a068ebe

Browse files
committed
Finalize markdownstring.baseUri
Fixes microsoft#142051
1 parent c12c8c1 commit a068ebe

6 files changed

Lines changed: 21 additions & 36 deletions

File tree

extensions/typescript-language-features/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"license": "MIT",
99
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
1010
"enabledApiProposals": [
11-
"markdownStringBaseUri",
1211
"resolvers",
1312
"workspaceTrust"
1413
],

extensions/typescript-language-features/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"../../src/vscode-dts/vscode.d.ts",
1313
"../../src/vscode-dts/vscode.proposed.inlayHints.d.ts",
1414
"../../src/vscode-dts/vscode.proposed.languageStatus.d.ts",
15-
"../../src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts",
1615
"../../src/vscode-dts/vscode.proposed.resolvers.d.ts",
1716
"../../src/vscode-dts/vscode.proposed.workspaceTrust.d.ts",
1817
]

extensions/vscode-api-tests/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"findTextInFiles",
1818
"fsChunks",
1919
"inlineCompletions",
20-
"markdownStringBaseUri",
2120
"notebookCellExecutionState",
2221
"notebookConcatTextDocument",
2322
"notebookContentProvider",

src/vs/workbench/services/extensions/common/extensionsApiProposals.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export const allApiProposals = Object.freeze({
2525
idToken: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts',
2626
inlineCompletions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletions.d.ts',
2727
ipc: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts',
28-
markdownStringBaseUri: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts',
2928
notebookCellExecutionState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts',
3029
notebookConcatTextDocument: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookConcatTextDocument.d.ts',
3130
notebookContentProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookContentProvider.d.ts',

src/vscode-dts/vscode.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,6 +2660,27 @@ declare module 'vscode' {
26602660
*/
26612661
supportHtml?: boolean;
26622662

2663+
/**
2664+
* Uri that relative paths are resolved relative to.
2665+
*
2666+
* If the `baseUri` ends with `/`, it is considered a directory and relative paths in the markdown are resolved relative to that directory:
2667+
*
2668+
* ```ts
2669+
* const md = new vscode.MarkdownString(`[link](./file.js)`);
2670+
* md.baseUri = vscode.Uri.file('/path/to/dir/');
2671+
* // Here 'link' in the rendered markdown resolves to '/path/to/dir/file.js'
2672+
* ```
2673+
*
2674+
* If the `baseUri` is a file, relative paths in the markdown are resolved relative to the parent dir of that file:
2675+
*
2676+
* ```ts
2677+
* const md = new vscode.MarkdownString(`[link](./file.js)`);
2678+
* md.baseUri = vscode.Uri.file('/path/to/otherFile.js');
2679+
* // Here 'link' in the rendered markdown resolves to '/path/to/file.js'
2680+
* ```
2681+
*/
2682+
baseUri?: Uri;
2683+
26632684
/**
26642685
* Creates a new markdown string with the given value.
26652686
*

src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)