Skip to content

Commit b2dff01

Browse files
authored
Merge branch 'microsoft:main' into justin/CodeActionMenu-Widget
2 parents 8884ca8 + 68cbaa7 commit b2dff01

File tree

44 files changed

+515
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+515
-221
lines changed

.github/commands.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"IllusionMH"
155155
],
156156
"action": "updateLabels",
157-
"addLabel": "~needs more info"
157+
"addLabel": "~info-needed"
158158
},
159159
{
160160
"type": "comment",
@@ -165,14 +165,14 @@
165165
"gjsjohnmurray",
166166
"IllusionMH"
167167
],
168-
"addLabel": "needs more info",
168+
"addLabel": "info-needed",
169169
"comment": "Thanks for creating this issue regarding performance! Please follow this guide to help us diagnose performance issues: https://github.com/microsoft/vscode/wiki/Performance-Issues \n\nHappy Coding!"
170170
},
171171
{
172172
"type": "comment",
173173
"name": "jsDebugLogs",
174174
"action": "updateLabels",
175-
"addLabel": "needs more info",
175+
"addLabel": "info-needed",
176176
"comment": "Please collect trace logs using the following instructions:\n\n> If you're able to, add `\"trace\": true` to your `launch.json` and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.\n>\n> ⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to [email protected]"
177177
},
178178
{
@@ -189,17 +189,17 @@
189189
},
190190
{
191191
"type": "label",
192-
"name": "~needs more info",
192+
"name": "~info-needed",
193193
"action": "updateLabels",
194-
"addLabel": "needs more info",
195-
"removeLabel": "~needs more info",
194+
"addLabel": "info-needed",
195+
"removeLabel": "~info-needed",
196196
"comment": "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting guidelines](https://aka.ms/vscodeissuereporting). Please take the time to review these and update the issue.\n\nHappy Coding!"
197197
},
198198
{
199199
"type": "label",
200200
"name": "~needs version info",
201201
"action": "updateLabels",
202-
"addLabel": "needs more info",
202+
"addLabel": "info-needed",
203203
"removeLabel": "~needs version info",
204204
"comment": "Thanks for creating this issue! We figured it's missing some basic information, such as a version number, or in some other way doesn't follow our [issue reporting guidelines](https://aka.ms/vscodeissuereporting). Please take the time to review these and update the issue.\n\nHappy Coding!"
205205
},
@@ -416,7 +416,7 @@
416416
"IllusionMH"
417417
],
418418
"action": "comment",
419-
"addLabel": "needs more info",
419+
"addLabel": "info-needed",
420420
"comment": "Thanks for reporting this issue! Unfortunately, it's hard for us to understand what issue you're seeing. Please help us out by providing a screen recording showing exactly what isn't working as expected. While we can work with most standard formats, `.gif` files are preferred as they are displayed inline on GitHub. You may find https://gifcap.dev helpful as a browser-based gif recording tool.\n\nIf the issue depends on keyboard input, you can help us by enabling screencast mode for the recording (`Developer: Toggle Screencast Mode` in the command palette).\n\nHappy coding!"
421421
},
422422
{

build/lib/compilation.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ class MonacoGenerator {
188188
}
189189
}
190190
function generateApiProposalNames() {
191+
let eol;
192+
try {
193+
const src = fs.readFileSync('src/vs/workbench/services/extensions/common/extensionsApiProposals.ts', 'utf-8');
194+
const match = /\r?\n/m.exec(src);
195+
eol = match ? match[0] : os.EOL;
196+
}
197+
catch {
198+
eol = os.EOL;
199+
}
191200
const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts$/;
192201
const proposalNames = new Set();
193202
const input = es.through();
@@ -214,7 +223,7 @@ function generateApiProposalNames() {
214223
'});',
215224
'export type ApiProposalName = keyof typeof allApiProposals;',
216225
'',
217-
].join(os.EOL);
226+
].join(eol);
218227
this.emit('data', new File({
219228
path: 'vs/workbench/services/extensions/common/extensionsApiProposals.ts',
220229
contents: Buffer.from(contents)

build/lib/compilation.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ class MonacoGenerator {
226226
}
227227

228228
function generateApiProposalNames() {
229+
let eol: string;
230+
231+
try {
232+
const src = fs.readFileSync('src/vs/workbench/services/extensions/common/extensionsApiProposals.ts', 'utf-8');
233+
const match = /\r?\n/m.exec(src);
234+
eol = match ? match[0] : os.EOL;
235+
} catch {
236+
eol = os.EOL;
237+
}
238+
229239
const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts$/;
230240
const proposalNames = new Set<string>();
231241

@@ -254,7 +264,7 @@ function generateApiProposalNames() {
254264
'});',
255265
'export type ApiProposalName = keyof typeof allApiProposals;',
256266
'',
257-
].join(os.EOL);
267+
].join(eol);
258268

259269
this.emit('data', new File({
260270
path: 'vs/workbench/services/extensions/common/extensionsApiProposals.ts',

extensions/ipynb/esbuild.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
//@ts-check
6+
7+
const path = require('path');
8+
const fse = require('fs-extra');
9+
const esbuild = require('esbuild');
10+
11+
const args = process.argv.slice(2);
12+
13+
const isWatch = args.indexOf('--watch') >= 0;
14+
15+
let outputRoot = __dirname;
16+
const outputRootIndex = args.indexOf('--outputRoot');
17+
if (outputRootIndex >= 0) {
18+
outputRoot = args[outputRootIndex + 1];
19+
}
20+
21+
const srcDir = path.join(__dirname, 'src');
22+
const outDir = path.join(outputRoot, 'out');
23+
24+
async function build() {
25+
await esbuild.build({
26+
entryPoints: [
27+
path.join(srcDir, 'cellAttachmentRenderer.ts'),
28+
],
29+
bundle: true,
30+
minify: false,
31+
sourcemap: false,
32+
format: 'esm',
33+
outdir: outDir,
34+
platform: 'browser',
35+
target: ['es2020'],
36+
});
37+
}
38+
39+
40+
build().catch(() => process.exit(1));
41+
42+
if (isWatch) {
43+
const watcher = require('@parcel/watcher');
44+
watcher.subscribe(srcDir, () => {
45+
return build();
46+
});
47+
}

extensions/ipynb/package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@
5151
"priority": "default"
5252
}
5353
],
54+
"notebookRenderer": [
55+
{
56+
"id": "vscode.markdown-it-cell-attachment-renderer",
57+
"displayName": "Markdown it ipynb Cell Attachment renderer",
58+
"entrypoint": {
59+
"extends": "vscode.markdown-it-renderer",
60+
"path": "./out/cellAttachmentRenderer.js"
61+
}
62+
}
63+
],
5464
"menus": {
5565
"file/newFile": [
5666
{
@@ -70,8 +80,9 @@
7080
}
7181
},
7282
"scripts": {
73-
"compile": "npx gulp compile-extension:ipynb",
74-
"watch": "npx gulp watch-extension:ipynb"
83+
"compile": "npx gulp compile-extension:ipynb && npm run build-notebook",
84+
"watch": "npx gulp watch-extension:ipynb",
85+
"build-notebook": "node ./esbuild"
7586
},
7687
"dependencies": {
7788
"@enonic/fnv-plus": "^1.3.0",
@@ -80,6 +91,7 @@
8091
},
8192
"devDependencies": {
8293
"@jupyterlab/nbformat": "^3.2.9",
94+
"@types/markdown-it": "12.2.3",
8395
"@types/uuid": "^8.3.1"
8496
},
8597
"repository": {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import type * as MarkdownIt from 'markdown-it';
7+
import type * as MarkdownItToken from 'markdown-it/lib/token';
8+
import type { RendererContext } from 'vscode-notebook-renderer';
9+
10+
interface MarkdownItRenderer {
11+
extendMarkdownIt(fn: (md: MarkdownIt) => void): void;
12+
}
13+
14+
export async function activate(ctx: RendererContext<void>) {
15+
const markdownItRenderer = (await ctx.getRenderer('vscode.markdown-it-renderer')) as MarkdownItRenderer | any;
16+
if (!markdownItRenderer) {
17+
throw new Error(`Could not load 'vscode.markdown-it-renderer'`);
18+
}
19+
20+
markdownItRenderer.extendMarkdownIt((md: MarkdownIt) => {
21+
const original = md.renderer.rules.image;
22+
md.renderer.rules.image = (tokens: MarkdownItToken[], idx: number, options, env, self) => {
23+
const token = tokens[idx];
24+
const src = token.attrGet('src');
25+
const attachments: Record<string, Record<string, string>> = env.outputItem.metadata?.custom?.attachments;
26+
if (attachments && src) {
27+
const [attachmentKey, attachmentVal] = Object.entries(attachments[src.replace('attachment:', '')])[0];
28+
const b64Markdown = 'data:' + attachmentKey + ';base64,' + attachmentVal;
29+
token.attrSet('src', b64Markdown);
30+
}
31+
32+
if (original) {
33+
return original(tokens, idx, options, env, self);
34+
} else {
35+
return self.renderToken(tokens, idx, options);
36+
}
37+
};
38+
});
39+
}

extensions/ipynb/yarn.lock

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,39 @@
88
integrity sha512-BCN9uNWH8AmiP7BXBJqEinUY9KXalmRzo+L0cB/mQsmFfzODxwQrbvxCHXUNH2iP+qKkWYtB4vyy8N62PViMFw==
99

1010
"@jupyterlab/nbformat@^3.2.9":
11-
version "3.2.9"
12-
resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-3.2.9.tgz#e7d854719612133498af4280d9a8caa0873205b0"
13-
integrity sha512-WSf9OQo8yfFjyodbXRdFoaNwMkaAL5jFZiD6V2f8HqI380ipansWrrV7R9CGzPfgKHpUGZMO1tYKmUwzMhvZ4w==
11+
version "3.4.3"
12+
resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-3.4.3.tgz#cbab1bf507677b7f0f309d8353fc83fe5a973c82"
13+
integrity sha512-i/yADrwhhAJJCUOTa+fEBMyJO7fvX9Y73I0B7V6dQhGcrmrEKLC3wk4yOo63+jRntd5+dupbiOtz3w1ncIXwIA==
1414
dependencies:
15-
"@lumino/coreutils" "^1.5.3"
15+
"@lumino/coreutils" "^1.11.0"
1616

17-
"@lumino/coreutils@^1.5.3":
17+
"@lumino/coreutils@^1.11.0":
1818
version "1.12.0"
1919
resolved "https://registry.yarnpkg.com/@lumino/coreutils/-/coreutils-1.12.0.tgz#fbdef760f736eaf2bd396a5c6fc3a68a4b449b15"
2020
integrity sha512-DSglh4ylmLi820CNx9soJmDJCpUgymckdWeGWuN0Ash5g60oQvrQDfosVxEhzmNvtvXv45WZEqSBzDP6E5SEmQ==
2121

22+
"@types/linkify-it@*":
23+
version "3.0.2"
24+
resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9"
25+
integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==
26+
27+
28+
version "12.2.3"
29+
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51"
30+
integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==
31+
dependencies:
32+
"@types/linkify-it" "*"
33+
"@types/mdurl" "*"
34+
35+
"@types/mdurl@*":
36+
version "1.0.2"
37+
resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9"
38+
integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==
39+
2240
"@types/uuid@^8.3.1":
23-
version "8.3.1"
24-
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f"
25-
integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==
41+
version "8.3.4"
42+
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc"
43+
integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==
2644

2745
detect-indent@^6.0.0:
2846
version "6.1.0"

extensions/markdown-language-features/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"vscode-languageserver": "^8.0.2-next.5`",
1414
"vscode-languageserver-textdocument": "^1.0.5",
1515
"vscode-languageserver-types": "^3.17.1",
16-
"vscode-markdown-languageservice": "^0.0.0-alpha.11",
16+
"vscode-markdown-languageservice": "^0.0.0-alpha.12",
1717
"vscode-uri": "^3.0.3"
1818
},
1919
"devDependencies": {

extensions/markdown-language-features/server/src/workspace.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export class VsCodeClientWorkspace implements md.IWorkspaceWithWatching {
6969
connection.onDidChangeWatchedFiles(async ({ changes }) => {
7070
for (const change of changes) {
7171
const resource = URI.parse(change.uri);
72+
this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace: onDidChangeWatchedFiles', `${change.type}: ${resource}`);
7273
switch (change.type) {
7374
case FileChangeType.Changed: {
7475
this._documentCache.delete(resource);
@@ -95,10 +96,13 @@ export class VsCodeClientWorkspace implements md.IWorkspaceWithWatching {
9596
});
9697

9798
connection.onRequest(protocol.fs_watcher_onChange, params => {
99+
this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace: fs_watcher_onChange', `${params.kind}: ${params.uri}`);
100+
98101
const watcher = this._watchers.get(params.id);
99102
if (!watcher) {
100103
return;
101104
}
105+
102106
switch (params.kind) {
103107
case 'create': watcher.onDidCreate.fire(URI.parse(params.uri)); return;
104108
case 'change': watcher.onDidChange.fire(URI.parse(params.uri)); return;
@@ -211,14 +215,16 @@ export class VsCodeClientWorkspace implements md.IWorkspaceWithWatching {
211215
}
212216

213217
watchFile(resource: URI, options: FileWatcherOptions): IFileSystemWatcher {
218+
const id = this._watcherPool++;
219+
this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace: watchFile', `(${id}) ${resource}`);
220+
214221
const entry = {
215222
resource,
216223
options,
217224
onDidCreate: new Emitter<URI>(),
218225
onDidChange: new Emitter<URI>(),
219226
onDidDelete: new Emitter<URI>(),
220227
};
221-
const id = this._watcherPool++;
222228
this._watchers.set(id, entry);
223229

224230
this.connection.sendRequest(protocol.fs_watcher_create, {
@@ -232,6 +238,7 @@ export class VsCodeClientWorkspace implements md.IWorkspaceWithWatching {
232238
onDidChange: entry.onDidChange.event,
233239
onDidDelete: entry.onDidDelete.event,
234240
dispose: () => {
241+
this.logger.log(md.LogLevel.Trace, 'VsCodeClientWorkspace: disposeWatcher', `(${id}) ${resource}`);
235242
this.connection.sendRequest(protocol.fs_watcher_delete, { id });
236243
this._watchers.delete(id);
237244
}

extensions/markdown-language-features/server/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ vscode-languageserver@^8.0.2-next.5`:
4747
dependencies:
4848
vscode-languageserver-protocol "3.17.2-next.6"
4949

50-
vscode-markdown-languageservice@^0.0.0-alpha.11:
51-
version "0.0.0-alpha.11"
52-
resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.0.0-alpha.11.tgz#9dcdfc23f9dcaeaca3b2a2c76fc504619eaeb284"
53-
integrity sha512-syFamf99xx+Q9DkA66+8fbSz2A2LJkyOV+nSziGgAzdDPv4jkb7eWF6l+nUteHTGbRLQ+q0tfkj0A7OovueCSQ==
50+
vscode-markdown-languageservice@^0.0.0-alpha.12:
51+
version "0.0.0-alpha.12"
52+
resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.0.0-alpha.12.tgz#5a3c7559969c3cb455d508d48129c8e221589630"
53+
integrity sha512-9dJ/GL6A9UUOcB1TpvgsbcwqsYjnxHx4jxDaqeZZEMWFSUySfp0PAn1ge2S2Qj00zypvsu0eCTGUNd56G1/BNQ==
5454
dependencies:
5555
picomatch "^2.3.1"
5656
vscode-languageserver-textdocument "^1.0.5"

0 commit comments

Comments
 (0)