Skip to content

Commit 970bc5d

Browse files
committed
Merge remote-tracking branch 'origin/main' into tyriar/161775
2 parents 2d6d6cd + c0f5b32 commit 970bc5d

File tree

4 files changed

+33
-22
lines changed

4 files changed

+33
-22
lines changed

src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class NotebookDiffOverviewRuler extends Themable {
6666
this._renderOverviewViewport();
6767
}));
6868

69-
this._register(DOM.addStandardDisposableListener(this._overviewViewportDomElement.domNode, DOM.EventType.POINTER_DOWN, (e) => {
69+
this._register(DOM.addStandardDisposableListener(container, DOM.EventType.POINTER_DOWN, (e) => {
7070
this.notebookEditor.delegateVerticalScrollbarPointerDown(e);
7171
}));
7272
}

src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,11 +1489,28 @@ async function webviewPreloads(ctx: PreloadContext) {
14891489
this._renderers.get(rendererId)?.disposeOutputItem(outputId);
14901490
}
14911491

1492-
public async render(info: rendererApi.OutputItem, element: HTMLElement, signal: AbortSignal): Promise<void> {
1493-
const renderers = Array.from(this._renderers.values())
1494-
.filter((renderer) => renderer.data.mimeTypes.includes(info.mime) && !renderer.data.extends);
1492+
public async render(info: rendererApi.OutputItem, preferredRendererId: string | undefined, element: HTMLElement, signal: AbortSignal): Promise<void> {
1493+
let renderer: Renderer | undefined;
14951494

1496-
if (!renderers.length) {
1495+
if (typeof preferredRendererId === 'string') {
1496+
renderer = Array.from(this._renderers.values())
1497+
.find((renderer) => renderer.data.id === preferredRendererId);
1498+
} else {
1499+
const renderers = Array.from(this._renderers.values())
1500+
.filter((renderer) => renderer.data.mimeTypes.includes(info.mime) && !renderer.data.extends);
1501+
1502+
if (renderers.length) {
1503+
// De-prioritize built-in renderers
1504+
renderers.sort((a, b) => +a.data.isBuiltin - +b.data.isBuiltin);
1505+
1506+
// Use first renderer we find in sorted list
1507+
renderer = renderers[0];
1508+
}
1509+
}
1510+
1511+
if (renderer) {
1512+
await renderer.renderOutputItem(info, element, signal);
1513+
} else {
14971514
const errorContainer = document.createElement('div');
14981515

14991516
const error = document.createElement('div');
@@ -1509,15 +1526,7 @@ async function webviewPreloads(ctx: PreloadContext) {
15091526

15101527
element.innerText = '';
15111528
element.appendChild(errorContainer);
1512-
1513-
return;
15141529
}
1515-
1516-
// De-prioritize built-in renderers
1517-
renderers.sort((a, b) => +a.data.isBuiltin - +b.data.isBuiltin);
1518-
1519-
// Use first renderer we find in sorted list
1520-
await renderers[0].renderOutputItem(info, element, signal);
15211530
}
15221531
}();
15231532

@@ -1874,7 +1883,7 @@ async function webviewPreloads(ctx: PreloadContext) {
18741883
const controller = new AbortController();
18751884
this.renderTaskAbort = controller;
18761885
try {
1877-
await renderers.render(this.outputItem, this.element, this.renderTaskAbort.signal);
1886+
await renderers.render(this.outputItem, undefined, this.element, this.renderTaskAbort.signal);
18781887
} finally {
18791888
if (this.renderTaskAbort === controller) {
18801889
this.renderTaskAbort = undefined;
@@ -2001,7 +2010,7 @@ async function webviewPreloads(ctx: PreloadContext) {
20012010

20022011
public async renderOutputElement(data: webviewMessages.ICreationRequestMessage, preloadErrors: ReadonlyArray<Error | undefined>, signal: AbortSignal) {
20032012
const outputElement = this.createOutputElement(data);
2004-
await outputElement.render(data.content, preloadErrors, signal);
2013+
await outputElement.render(data.content, data.rendererId, preloadErrors, signal);
20052014

20062015
// don't hide until after this step so that the height is right
20072016
outputElement.element.style.visibility = data.initiallyHidden ? 'hidden' : '';
@@ -2132,6 +2141,7 @@ async function webviewPreloads(ctx: PreloadContext) {
21322141
public readonly element: HTMLElement;
21332142
private _content?: {
21342143
readonly content: webviewMessages.ICreationContent;
2144+
readonly preferredRendererId: string | undefined;
21352145
readonly preloadErrors: ReadonlyArray<Error | undefined>;
21362146
};
21372147
private hasResizeObserver = false;
@@ -2164,11 +2174,11 @@ async function webviewPreloads(ctx: PreloadContext) {
21642174
this.renderTaskAbort = undefined;
21652175
}
21662176

2167-
public async render(content: webviewMessages.ICreationContent, preloadErrors: ReadonlyArray<Error | undefined>, signal?: AbortSignal) {
2177+
public async render(content: webviewMessages.ICreationContent, preferredRendererId: string | undefined, preloadErrors: ReadonlyArray<Error | undefined>, signal?: AbortSignal) {
21682178
this.renderTaskAbort?.abort();
21692179
this.renderTaskAbort = undefined;
21702180

2171-
this._content = { content, preloadErrors };
2181+
this._content = { content, preferredRendererId, preloadErrors };
21722182
if (content.type === 0 /* RenderOutputType.Html */) {
21732183
const trustedHtml = ttPolicy?.createHTML(content.htmlContent) ?? content.htmlContent;
21742184
this.element.innerHTML = trustedHtml as string;
@@ -2186,7 +2196,7 @@ async function webviewPreloads(ctx: PreloadContext) {
21862196
signal?.addEventListener('abort', () => controller.abort());
21872197

21882198
try {
2189-
await renderers.render(item, this.element, controller.signal);
2199+
await renderers.render(item, preferredRendererId, this.element, controller.signal);
21902200
} finally {
21912201
if (this.renderTaskAbort === controller) {
21922202
this.renderTaskAbort = undefined;
@@ -2229,13 +2239,13 @@ async function webviewPreloads(ctx: PreloadContext) {
22292239

22302240
public rerender() {
22312241
if (this._content) {
2232-
this.render(this._content.content, this._content.preloadErrors);
2242+
this.render(this._content.content, this._content.preferredRendererId, this._content.preloadErrors);
22332243
}
22342244
}
22352245

22362246
public updateAndRerender(content: webviewMessages.ICreationContent) {
22372247
if (this._content) {
2238-
this._content = { content, preloadErrors: this._content.preloadErrors };
2248+
this._content = { content, preferredRendererId: this._content.preferredRendererId, preloadErrors: this._content.preloadErrors };
22392249
this.rerender();
22402250
}
22412251
}

src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
178178
try {
179179
if (this._process?.freePortKillProcess) {
180180
const result = await this._process?.freePortKillProcess(port);
181-
this._notificationService.notify({ message: `Killed process w ID: ${result.processId} to free port ${result.port}`, severity: Severity.Info });
181+
this._notificationService.notify({ message: localize('killportsuccess', 'Killed process with PID {0} listening on port {1}', result.processId, result.port), severity: Severity.Info });
182182
}
183183
} catch (e) {
184-
this._notificationService.notify({ message: `Could not kill process for port ${port} wth error ${e}`, severity: Severity.Warning });
184+
this._notificationService.notify({ message: localize('killportfailure', 'Could not kill process listening on port {0}, command exited with error {1}', port, e), severity: Severity.Warning });
185185
}
186186
}
187187

src/vs/workbench/contrib/terminal/common/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ export const DEFAULT_COMMANDS_TO_SKIP_SHELL: string[] = [
615615
TerminalCommandId.New,
616616
TerminalCommandId.Paste,
617617
TerminalCommandId.PasteSelection,
618+
TerminalCommandId.QuickFix,
618619
TerminalCommandId.ResizePaneDown,
619620
TerminalCommandId.ResizePaneLeft,
620621
TerminalCommandId.ResizePaneRight,

0 commit comments

Comments
 (0)