Skip to content

Commit dfc6bf7

Browse files
authored
Merge branch 'master' into connor4312/fix-js-debug-web-ext-host
2 parents 4c0dd4a + e5ff305 commit dfc6bf7

File tree

26 files changed

+231
-76
lines changed

26 files changed

+231
-76
lines changed

extensions/configuration-editing/schemas/attachContainer.schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@
4545
"pattern": "^([a-z0-9A-Z][a-z0-9\\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\\-A-Z]*)$",
4646
"errorMessage": "Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."
4747
}
48+
},
49+
"postAttachCommand": {
50+
"type": [
51+
"string",
52+
"array"
53+
],
54+
"description": "A command to run after attaching to the container. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
55+
"items": {
56+
"type": "string"
57+
}
4858
}
4959
}
5060
}

extensions/configuration-editing/schemas/devContainer.schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,33 @@
6868
"type": "string"
6969
}
7070
},
71+
"postStartCommand": {
72+
"type": [
73+
"string",
74+
"array"
75+
],
76+
"description": "A command to run after starting the container. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
77+
"items": {
78+
"type": "string"
79+
}
80+
},
81+
"postAttachCommand": {
82+
"type": [
83+
"string",
84+
"array"
85+
],
86+
"description": "A command to run after attaching to the container. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
87+
"items": {
88+
"type": "string"
89+
}
90+
},
7191
"devPort": {
7292
"type": "integer",
7393
"description": "The port VS Code can use to connect to its backend."
94+
},
95+
"codespaces": {
96+
"type": "object",
97+
"description": "Codespaces-specific configuration."
7498
}
7599
}
76100
},

extensions/vscode-notebook-tests/src/notebook.test.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,12 @@ suite('API tests', () => {
212212
}
213213
]
214214
});
215+
216+
await vscode.commands.executeCommand('workbench.action.files.save');
217+
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
215218
});
216219

217-
test('notebook editor active/visible', async function () {
220+
test.skip('notebook editor active/visible', async function () {
218221
const resource = vscode.Uri.file(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
219222
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
220223
const firstEditor = vscode.notebook.activeNotebookEditor;
@@ -230,6 +233,7 @@ suite('API tests', () => {
230233
assert.equal(vscode.notebook.visibleNotebookEditors.length, 2);
231234

232235
await vscode.commands.executeCommand('workbench.action.files.newUntitledFile');
236+
// TODO@rebornix, this is not safe, we might need to listen to visible editor change event.
233237
assert.equal(firstEditor?.visible, true);
234238
assert.equal(firstEditor?.active, false);
235239
assert.equal(secondEditor?.visible, false);
@@ -594,7 +598,8 @@ suite('notebook working copy', () => {
594598
assert.deepEqual(vscode.notebook.activeNotebookEditor?.document.cells.length, 1);
595599
assert.equal(vscode.notebook.activeNotebookEditor?.selection?.source, 'test');
596600

597-
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
601+
await vscode.commands.executeCommand('workbench.action.files.saveAll');
602+
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
598603
});
599604

600605
test('multiple tabs: dirty + clean', async function () {
@@ -754,18 +759,18 @@ suite('regression', () => {
754759

755760
suite('webview', () => {
756761
// for web, `asWebUri` gets `https`?
757-
test('asWebviewUri', async function () {
758-
if (vscode.env.uiKind === vscode.UIKind.Web) {
759-
return;
760-
}
762+
// test('asWebviewUri', async function () {
763+
// if (vscode.env.uiKind === vscode.UIKind.Web) {
764+
// return;
765+
// }
761766

762-
const resource = vscode.Uri.file(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
763-
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
764-
assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');
765-
const uri = vscode.notebook.activeNotebookEditor!.asWebviewUri(vscode.Uri.file('./hello.png'));
766-
assert.equal(uri.scheme, 'vscode-resource');
767-
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
768-
});
767+
// const resource = vscode.Uri.file(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
768+
// await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
769+
// assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');
770+
// const uri = vscode.notebook.activeNotebookEditor!.asWebviewUri(vscode.Uri.file('./hello.png'));
771+
// assert.equal(uri.scheme, 'vscode-resource');
772+
// await vscode.commands.executeCommand('workbench.action.closeAllEditors');
773+
// });
769774

770775

771776
// 404 on web

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.46.0",
4-
"distro": "df59b25a868325db7f34a57b3f86dd5950661544",
4+
"distro": "ebf621f403497559e97da316516d55d16e4bf964",
55
"author": {
66
"name": "Microsoft Corporation"
77
},
@@ -181,4 +181,4 @@
181181
"windows-mutex": "0.3.0",
182182
"windows-process-tree": "0.2.4"
183183
}
184-
}
184+
}

product.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
},
9191
{
9292
"name": "ms-vscode.js-debug-nightly",
93-
"version": "2020.5.2717",
93+
"version": "2020.6.208",
9494
"repo": "https://github.com/Microsoft/vscode-js-debug",
9595
"metadata": {
9696
"id": "7acbb4ce-c85a-49d4-8d95-a8054406ae97",
@@ -105,7 +105,7 @@
105105
},
106106
{
107107
"name": "ms-vscode.vscode-js-profile-table",
108-
"version": "0.0.4",
108+
"version": "0.0.5",
109109
"repo": "https://github.com/Microsoft/vscode-js-debug",
110110
"metadata": {
111111
"id": "7e52b41b-71ad-457b-ab7e-0620f1fc4feb",

resources/win32/bin/code.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
if [ "$VSCODE_WSL_DEBUG_INFO" = true ]; then
6+
set -x
7+
fi
8+
59
COMMIT="@@COMMIT@@"
610
APP_NAME="@@APPNAME@@"
711
QUALITY="@@QUALITY@@"
@@ -11,7 +15,7 @@ VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
1115
ELECTRON="$VSCODE_PATH/$NAME.exe"
1216
if grep -qi Microsoft /proc/version; then
1317
# in a wsl shell
14-
WSL_BUILD=$(uname -r | sed -E 's/^[0-9.]+-([0-9]+)-Microsoft|([0-9]+).([0-9]+).([0-9]+)-microsoft-standard|.*/\1\2\3\4/')
18+
WSL_BUILD=$(uname -r | sed -E 's/^[0-9.]+-([0-9]+)-Microsoft.*|([0-9]+).([0-9]+).([0-9]+)-microsoft-standard.*|.*/\1\2\3\4/')
1519
if [ -z "$WSL_BUILD" ]; then
1620
WSL_BUILD=0
1721
fi

src/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ protocol.registerSchemesAsPrivileged([
8989
scheme: 'vscode-resource',
9090
privileges: {
9191
secure: true,
92-
standard: true,
9392
supportFetchAPI: true,
9493
corsEnabled: true,
9594
}

src/vs/base/parts/quickinput/browser/quickInput.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,13 +719,13 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
719719

720720
break;
721721
case KeyCode.Home:
722-
if (event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) {
722+
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey) {
723723
this.ui.list.focus(QuickInputListFocus.First);
724724
dom.EventHelper.stop(event, true);
725725
}
726726
break;
727727
case KeyCode.End:
728-
if (event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) {
728+
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey) {
729729
this.ui.list.focus(QuickInputListFocus.Last);
730730
dom.EventHelper.stop(event, true);
731731
}

src/vs/workbench/browser/parts/activitybar/activitybarPart.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
161161
actions.push(this.instantiationService.createInstance(ToggleActivityBarVisibilityAction, ToggleActivityBarVisibilityAction.ID, nls.localize('hideActivitBar', "Hide Activity Bar")));
162162
return actions;
163163
},
164-
getContextMenuActionsForComposite: () => [],
164+
getContextMenuActionsForComposite: compositeId => this.getContextMenuActionsForComposite(compositeId),
165165
getDefaultCompositeId: () => this.viewDescriptorService.getDefaultViewContainer(this.location)!.id,
166166
hidePart: () => this.layoutService.setSideBarHidden(true),
167167
dndHandler: new CompositeDragAndDrop(this.viewDescriptorService, ViewContainerLocation.Sidebar,
@@ -182,6 +182,31 @@ export class ActivitybarPart extends Part implements IActivityBarService {
182182
this.compositeBar.focus();
183183
}
184184

185+
private getContextMenuActionsForComposite(compositeId: string): Action[] {
186+
const viewContainer = this.viewDescriptorService.getViewContainerById(compositeId)!;
187+
188+
const actions = [];
189+
const defaultLocation = this.viewDescriptorService.getDefaultViewContainerLocation(viewContainer)!;
190+
if (defaultLocation !== this.viewDescriptorService.getViewContainerLocation(viewContainer)) {
191+
actions.push(new Action('resetLocationAction', nls.localize('resetLocation', "Reset Location"), undefined, true, async () => {
192+
this.viewDescriptorService.moveViewContainerToLocation(viewContainer, defaultLocation);
193+
}));
194+
} else {
195+
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
196+
if (viewContainerModel.allViewDescriptors.length === 1) {
197+
const viewToReset = viewContainerModel.allViewDescriptors[0];
198+
const defaultContainer = this.viewDescriptorService.getDefaultContainerById(viewToReset.id)!;
199+
if (defaultContainer !== viewContainer) {
200+
actions.push(new Action('resetLocationAction', nls.localize('resetLocation', "Reset Location"), undefined, true, async () => {
201+
this.viewDescriptorService.moveViewsToContainer([viewToReset], defaultContainer);
202+
}));
203+
}
204+
}
205+
}
206+
207+
return actions;
208+
}
209+
185210
private registerListeners(): void {
186211

187212
// View Container Changes

src/vs/workbench/contrib/debug/browser/breakpointsView.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ export class BreakpointsView extends ViewPane {
154154
this.onBreakpointsChange();
155155
}
156156
}));
157+
158+
const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!;
159+
this._register(containerModel.onDidChangeAllViewDescriptors(() => {
160+
this.updateSize();
161+
}));
157162
}
158163

159164
public focus(): void {
@@ -237,9 +242,11 @@ export class BreakpointsView extends ViewPane {
237242
}
238243

239244
private updateSize(): void {
245+
const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!;
246+
240247
// Adjust expanded body size
241248
this.minimumBodySize = this.orientation === Orientation.VERTICAL ? getExpandedBodySize(this.debugService.getModel(), MAX_VISIBLE_BREAKPOINTS) : 170;
242-
this.maximumBodySize = this.orientation === Orientation.VERTICAL ? getExpandedBodySize(this.debugService.getModel(), Number.POSITIVE_INFINITY) : Number.POSITIVE_INFINITY;
249+
this.maximumBodySize = this.orientation === Orientation.VERTICAL && containerModel.visibleViewDescriptors.length > 1 ? getExpandedBodySize(this.debugService.getModel(), Number.POSITIVE_INFINITY) : Number.POSITIVE_INFINITY;
243250
}
244251

245252
private onBreakpointsChange(): void {

src/vs/workbench/contrib/files/browser/views/explorerViewer.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,25 +1085,25 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
10851085

10861086
private async doUploadWebFileEntryBuffered(resource: URI, file: File): Promise<void> {
10871087
const writeableStream = newWriteableBufferStream();
1088+
const writeFilePromise = this.fileService.writeFile(resource, writeableStream);
10881089

10891090
// Read the file in chunks using File.stream() web APIs
1090-
(async () => {
1091-
try {
1092-
const reader: ReadableStreamDefaultReader<Uint8Array> = file.stream().getReader();
1091+
try {
1092+
const reader: ReadableStreamDefaultReader<Uint8Array> = file.stream().getReader();
10931093

1094-
let res = await reader.read();
1095-
while (!res.done) {
1096-
writeableStream.write(VSBuffer.wrap(res.value));
1094+
let res = await reader.read();
1095+
while (!res.done) {
1096+
writeableStream.write(VSBuffer.wrap(res.value));
10971097

1098-
res = await reader.read();
1099-
}
1100-
writeableStream.end(res.value instanceof Uint8Array ? VSBuffer.wrap(res.value) : undefined);
1101-
} catch (error) {
1102-
writeableStream.end(error);
1098+
res = await reader.read();
11031099
}
1104-
})();
1100+
writeableStream.end(res.value instanceof Uint8Array ? VSBuffer.wrap(res.value) : undefined);
1101+
} catch (error) {
1102+
writeableStream.end(error);
1103+
}
11051104

1106-
await this.fileService.writeFile(resource, writeableStream);
1105+
// Wait for file being written to target
1106+
await writeFilePromise;
11071107
}
11081108

11091109
private doUploadWebFileEntryUnbuffered(resource: URI, file: File): Promise<void> {

src/vs/workbench/contrib/files/browser/views/openEditorsView.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ export class OpenEditorsView extends ViewPane {
303303
this.listRefreshScheduler.schedule(0);
304304
}
305305
}));
306+
307+
const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!;
308+
this._register(containerModel.onDidChangeAllViewDescriptors(() => {
309+
this.updateSize();
310+
}));
306311
}
307312

308313
getActions(): IAction[] {
@@ -446,6 +451,11 @@ export class OpenEditorsView extends ViewPane {
446451
}
447452

448453
private getMaxExpandedBodySize(): number {
454+
const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!;
455+
if (containerModel.visibleViewDescriptors.length <= 1) {
456+
return Number.POSITIVE_INFINITY;
457+
}
458+
449459
return this.elementCount * OpenEditorsDelegate.ITEM_HEIGHT;
450460
}
451461

src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { InputFocusedContext, InputFocusedContextKey } from 'vs/platform/context
1818
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
1919
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
2020
import { IQuickInputService, IQuickPickItem, QuickPickInput } from 'vs/platform/quickinput/common/quickInput';
21-
import { BaseCellRenderTemplate, CellEditState, ICellViewModel, INotebookEditor, NOTEBOOK_CELL_EDITABLE, NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, NOTEBOOK_CELL_RUNNABLE, NOTEBOOK_CELL_TYPE, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_EDITOR_EXECUTING_NOTEBOOK, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_RUNNABLE, NOTEBOOK_IS_ACTIVE_EDITOR } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
21+
import { BaseCellRenderTemplate, CellEditState, ICellViewModel, INotebookEditor, NOTEBOOK_CELL_EDITABLE, NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, NOTEBOOK_CELL_RUNNABLE, NOTEBOOK_CELL_TYPE, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_EDITOR_EXECUTING_NOTEBOOK, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_RUNNABLE, NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_CELL_HAS_OUTPUTS } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
2222
import { CellKind, NOTEBOOK_EDITOR_CURSOR_BOUNDARY, NotebookCellRunState } from 'vs/workbench/contrib/notebook/common/notebookCommon';
2323
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
2424
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
@@ -1006,7 +1006,7 @@ registerAction2(class extends NotebookAction {
10061006
title: localize('focusOutput', 'Focus In Active Cell Output'),
10071007
category: NOTEBOOK_ACTIONS_CATEGORY,
10081008
keybinding: {
1009-
when: NOTEBOOK_EDITOR_FOCUSED,
1009+
when: ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_HAS_OUTPUTS),
10101010
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
10111011
mac: { primary: KeyMod.WinCtrl | KeyMod.CtrlCmd | KeyCode.DownArrow, },
10121012
weight: KeybindingWeight.WorkbenchContrib
@@ -1019,7 +1019,7 @@ registerAction2(class extends NotebookAction {
10191019
async runWithContext(accessor: ServicesAccessor, context: INotebookCellActionContext): Promise<void> {
10201020
const editor = context.notebookEditor;
10211021
const activeCell = context.cell;
1022-
await editor.focusNotebookCell(activeCell, 'output');
1022+
editor.focusNotebookCell(activeCell, 'output');
10231023
}
10241024
});
10251025

src/vs/workbench/contrib/notebook/browser/notebookEditor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ export class NotebookEditor extends BaseEditor {
141141
// make sure the editor widget is removed from the view
142142
const existingEditorWidgetForInput = NotebookRegistry.getNotebookEditorWidget(this.input as NotebookEditorInput);
143143
if (existingEditorWidgetForInput) {
144+
// the editor widget is only referenced by the editor input
145+
// clear its state
146+
existingEditorWidgetForInput?.onWillHide();
144147
existingEditorWidgetForInput?.getDomNode().remove();
145148
existingEditorWidgetForInput?.dispose();
146149
NotebookRegistry.releaseNotebookEditorWidget(this.input as NotebookEditorInput);

0 commit comments

Comments
 (0)