Skip to content

Commit ccc7467

Browse files
committed
Merge remote-tracking branch 'upstream/master' into user/gabrield/throwExceptionOnExtensionInstallFail
2 parents 3756f10 + 7ad58a9 commit ccc7467

91 files changed

Lines changed: 1887 additions & 824 deletions

File tree

Some content is hidden

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

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313

1414
- job: macOS
1515
pool:
16-
vmImage: macOS 10.13
16+
vmImage: macOS-latest
1717
steps:
18-
- template: build/azure-pipelines/darwin/continuous-build-darwin.yml
18+
- template: build/azure-pipelines/darwin/continuous-build-darwin.yml

build/azure-pipelines/product-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
- job: macOS
103103
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_MACOS'], 'true'))
104104
pool:
105-
vmImage: macOS 10.13
105+
vmImage: macOS-latest
106106
dependsOn:
107107
- Compile
108108
steps:

build/builtInExtensions.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"name": "ms-vscode.references-view",
34-
"version": "0.0.46",
34+
"version": "0.0.47",
3535
"repo": "https://github.com/Microsoft/vscode-reference-view",
3636
"metadata": {
3737
"id": "dc489f46-520d-4556-ae85-1f9eab3c412d",
@@ -43,5 +43,21 @@
4343
},
4444
"publisherDisplayName": "Microsoft"
4545
}
46+
},
47+
{
48+
"name": "ms-vscode.js-debug-nightly",
49+
"version": "latest",
50+
"forQualities": ["insider"],
51+
"repo": "https://github.com/Microsoft/vscode-js-debug",
52+
"metadata": {
53+
"id": "7acbb4ce-c85a-49d4-8d95-a8054406ae97",
54+
"publisherId": {
55+
"publisherId": "5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee",
56+
"publisherName": "ms-vscode",
57+
"displayName": "Microsoft",
58+
"flags": "verified"
59+
},
60+
"publisherDisplayName": "Microsoft"
61+
}
4662
}
4763
]

build/builtin/browser-main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const os = require('os');
1010
const { remote } = require('electron');
1111
const dialog = remote.dialog;
1212

13+
const productJsonPath = path.join(__dirname, '..', '..', 'product.json');
1314
const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json');
1415
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
1516

@@ -51,6 +52,7 @@ function render(el, state) {
5152
}
5253

5354
const ul = document.createElement('ul');
55+
const { quality } = readJson(productJsonPath);
5456
const { builtin, control } = state;
5557

5658
for (const ext of builtin) {
@@ -61,6 +63,10 @@ function render(el, state) {
6163

6264
const name = document.createElement('code');
6365
name.textContent = ext.name;
66+
if (quality && ext.forQualities && !ext.forQualities.includes(quality)) {
67+
name.textContent += ` (only on ${ext.forQualities.join(', ')})`;
68+
}
69+
6470
li.appendChild(name);
6571

6672
const form = document.createElement('form');
@@ -123,4 +129,4 @@ function main() {
123129
render(el, { builtin, control });
124130
}
125131

126-
window.onload = main;
132+
window.onload = main;

build/lib/extensions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const util = require('./util');
2727
const root = path.dirname(path.dirname(__dirname));
2828
const commit = util.getVersion(root);
2929
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
30+
const product = require('../../product.json');
3031

3132
function fromLocal(extensionPath: string): Stream {
3233
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
@@ -219,16 +220,19 @@ const excludedExtensions = [
219220
'vscode-test-resolver',
220221
'ms-vscode.node-debug',
221222
'ms-vscode.node-debug2',
223+
'ms.vscode.js-debug-nightly'
222224
];
223225

224226
interface IBuiltInExtension {
225227
name: string;
226228
version: string;
227229
repo: string;
230+
forQualities?: ReadonlyArray<string>;
228231
metadata: any;
229232
}
230233

231-
const builtInExtensions: IBuiltInExtension[] = require('../builtInExtensions.json');
234+
const builtInExtensions = (<IBuiltInExtension[]>require('../builtInExtensions.json'))
235+
.filter(({ forQualities }) => !product.quality || forQualities?.includes?.(product.quality) !== false);
232236

233237
export function packageLocalExtensionsStream(): NodeJS.ReadWriteStream {
234238
const localExtensionDescriptions = (<string[]>glob.sync('extensions/*/package.json'))

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
"$ref": "vscode://schemas/settings/machine",
2525
"description": "Machine specific settings that should be copied into the container."
2626
},
27+
"forwardPorts": {
28+
"type": "array",
29+
"description": "Ports that are forwarded from the container to the local machine.",
30+
"items": {
31+
"type": "integer"
32+
}
33+
},
2734
"remoteEnv": {
2835
"type": "object",
2936
"additionalProperties": {

extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ suite('commands namespace tests', () => {
105105
});
106106

107107
test('api-command: vscode.open', function () {
108-
let uri = Uri.parse(workspace.workspaceFolders![0].uri.toString() + '/image.png');
108+
let uri = Uri.parse(workspace.workspaceFolders![0].uri.toString() + '/far.js');
109109
let a = commands.executeCommand('vscode.open', uri).then(() => assert.ok(true), () => assert.ok(false));
110110
let b = commands.executeCommand('vscode.open', uri, ViewColumn.Two).then(() => assert.ok(true), () => assert.ok(false));
111111
let c = commands.executeCommand('vscode.open').then(() => assert.ok(false), () => assert.ok(true));

src/vs/base/common/event.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export namespace Event {
148148

149149
if (leading && !handle) {
150150
emitter.fire(output);
151+
output = undefined;
151152
}
152153

153154
clearTimeout(handle);

src/vs/base/test/common/event.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,20 @@ suite('Event', function () {
237237
assert.equal(calls, 2);
238238
});
239239

240+
test('Debounce Event - leading reset', async function () {
241+
const emitter = new Emitter<number>();
242+
let debounced = Event.debounce(emitter.event, (l, e) => l ? l + 1 : 1, 0, /*leading=*/true);
243+
244+
let calls: number[] = [];
245+
debounced((e) => calls.push(e));
246+
247+
emitter.fire(1);
248+
emitter.fire(1);
249+
250+
await timeout(1);
251+
assert.deepEqual(calls, [1, 1]);
252+
});
253+
240254
test('Emitter - In Order Delivery', function () {
241255
const a = new Emitter<string>();
242256
const listener2Events: string[] = [];

src/vs/editor/browser/controller/textAreaHandler.ts

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { ViewController } from 'vs/editor/browser/view/viewController';
1717
import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart';
1818
import { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers';
1919
import { Margin } from 'vs/editor/browser/viewParts/margin/margin';
20-
import { RenderLineNumbersType, EditorOption, IComputedEditorOptions } from 'vs/editor/common/config/editorOptions';
20+
import { RenderLineNumbersType, EditorOption, IComputedEditorOptions, EditorOptions } from 'vs/editor/common/config/editorOptions';
2121
import { BareFontInfo } from 'vs/editor/common/config/fontInfo';
2222
import { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier';
2323
import { Position } from 'vs/editor/common/core/position';
@@ -62,8 +62,8 @@ export class TextAreaHandler extends ViewPart {
6262
private _scrollLeft: number;
6363
private _scrollTop: number;
6464

65-
private _accessibilitySupport: AccessibilitySupport;
66-
private _accessibilityPageSize: number;
65+
private _accessibilitySupport!: AccessibilitySupport;
66+
private _accessibilityPageSize!: number;
6767
private _contentLeft: number;
6868
private _contentWidth: number;
6969
private _contentHeight: number;
@@ -100,8 +100,7 @@ export class TextAreaHandler extends ViewPart {
100100
const options = this._context.configuration.options;
101101
const layoutInfo = options.get(EditorOption.layoutInfo);
102102

103-
this._accessibilitySupport = options.get(EditorOption.accessibilitySupport);
104-
this._accessibilityPageSize = options.get(EditorOption.accessibilityPageSize);
103+
this._setAccessibilityOptions(options);
105104
this._contentLeft = layoutInfo.contentLeft;
106105
this._contentWidth = layoutInfo.contentWidth;
107106
this._contentHeight = layoutInfo.height;
@@ -159,16 +158,22 @@ export class TextAreaHandler extends ViewPart {
159158
const text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy);
160159

161160
let html: string | null | undefined = undefined;
161+
let mode: string | null = null;
162162
if (generateHTML) {
163163
if (CopyOptions.forceCopyWithSyntaxHighlighting || (this._copyWithSyntaxHighlighting && text.length < 65536)) {
164-
html = this._context.model.getHTMLToCopy(this._modelSelections, this._emptySelectionClipboard);
164+
const richText = this._context.model.getRichTextToCopy(this._modelSelections, this._emptySelectionClipboard);
165+
if (richText) {
166+
html = richText.html;
167+
mode = richText.mode;
168+
}
165169
}
166170
}
167171
return {
168172
isFromEmptySelection,
169173
multicursorText,
170174
text,
171-
html
175+
html,
176+
mode
172177
};
173178
},
174179

@@ -222,11 +227,13 @@ export class TextAreaHandler extends ViewPart {
222227
this._register(this._textAreaInput.onPaste((e: IPasteData) => {
223228
let pasteOnNewLine = false;
224229
let multicursorText: string[] | null = null;
230+
let mode: string | null = null;
225231
if (e.metadata) {
226232
pasteOnNewLine = (this._emptySelectionClipboard && !!e.metadata.isFromEmptySelection);
227233
multicursorText = (typeof e.metadata.multicursorText !== 'undefined' ? e.metadata.multicursorText : null);
234+
mode = e.metadata.mode;
228235
}
229-
this._viewController.paste('keyboard', e.text, pasteOnNewLine, multicursorText);
236+
this._viewController.paste('keyboard', e.text, pasteOnNewLine, multicursorText, mode);
230237
}));
231238

232239
this._register(this._textAreaInput.onCut(() => {
@@ -346,14 +353,24 @@ export class TextAreaHandler extends ViewPart {
346353
return options.get(EditorOption.ariaLabel);
347354
}
348355

356+
private _setAccessibilityOptions(options: IComputedEditorOptions): void {
357+
this._accessibilitySupport = options.get(EditorOption.accessibilitySupport);
358+
const accessibilityPageSize = options.get(EditorOption.accessibilityPageSize);
359+
if (this._accessibilitySupport === AccessibilitySupport.Enabled && accessibilityPageSize === EditorOptions.accessibilityPageSize.defaultValue) {
360+
// If a screen reader is attached and the default value is not set we shuold automatically increase the page size to 1000 for a better experience
361+
this._accessibilityPageSize = 1000;
362+
} else {
363+
this._accessibilityPageSize = accessibilityPageSize;
364+
}
365+
}
366+
349367
// --- begin event handlers
350368

351369
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
352370
const options = this._context.configuration.options;
353371
const layoutInfo = options.get(EditorOption.layoutInfo);
354372

355-
this._accessibilitySupport = options.get(EditorOption.accessibilitySupport);
356-
this._accessibilityPageSize = options.get(EditorOption.accessibilityPageSize);
373+
this._setAccessibilityOptions(options);
357374
this._contentLeft = layoutInfo.contentLeft;
358375
this._contentWidth = layoutInfo.contentWidth;
359376
this._contentHeight = layoutInfo.height;

0 commit comments

Comments
 (0)