Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -12,7 +12,7 @@ suite('OpenerService', function () {
const editorService = new TestCodeEditorService();
let lastCommand: { id: string, args: any[] };
let lastCommand: { id: string, args: any[] } | undefined;
const commandService = new class implements ICommandService {
_serviceBrand: any;
@@ -30,7 +30,7 @@ suite('OpenerService', function () {
test('delegate to editorService, scheme:///fff', function () {
const openerService = new OpenerService(editorService, NullCommandService);
openerService.open(URI.parse('another:///somepath'));
assert.equal(editorService.lastInput.options.selection, undefined);
assert.equal(editorService.lastInput.options!.selection, undefined);
});
test('delegate to editorService, scheme:///fff#L123', function () {
@@ -38,21 +38,21 @@ suite('OpenerService', function () {
const openerService = new OpenerService(editorService, NullCommandService);
openerService.open(URI.parse('file:///somepath#L23'));
assert.equal(editorService.lastInput.options.selection.startLineNumber, 23);
assert.equal(editorService.lastInput.options.selection.startColumn, 1);
assert.equal(editorService.lastInput.options.selection.endLineNumber, undefined);
assert.equal(editorService.lastInput.options.selection.endColumn, undefined);
assert.equal(editorService.lastInput.options!.selection!.startLineNumber, 23);
assert.equal(editorService.lastInput.options!.selection!.startColumn, 1);
assert.equal(editorService.lastInput.options!.selection!.endLineNumber, undefined);
assert.equal(editorService.lastInput.options!.selection!.endColumn, undefined);
assert.equal(editorService.lastInput.resource.fragment, '');
openerService.open(URI.parse('another:///somepath#L23'));
assert.equal(editorService.lastInput.options.selection.startLineNumber, 23);
assert.equal(editorService.lastInput.options.selection.startColumn, 1);
assert.equal(editorService.lastInput.options!.selection!.startLineNumber, 23);
assert.equal(editorService.lastInput.options!.selection!.startColumn, 1);
openerService.open(URI.parse('another:///somepath#L23,45'));
assert.equal(editorService.lastInput.options.selection.startLineNumber, 23);
assert.equal(editorService.lastInput.options.selection.startColumn, 45);
assert.equal(editorService.lastInput.options.selection.endLineNumber, undefined);
assert.equal(editorService.lastInput.options.selection.endColumn, undefined);
assert.equal(editorService.lastInput.options!.selection!.startLineNumber, 23);
assert.equal(editorService.lastInput.options!.selection!.startColumn, 45);
assert.equal(editorService.lastInput.options!.selection!.endLineNumber, undefined);
assert.equal(editorService.lastInput.options!.selection!.endColumn, undefined);
assert.equal(editorService.lastInput.resource.fragment, '');
});
@@ -61,17 +61,17 @@ suite('OpenerService', function () {
const openerService = new OpenerService(editorService, NullCommandService);
openerService.open(URI.parse('file:///somepath#23'));
assert.equal(editorService.lastInput.options.selection.startLineNumber, 23);
assert.equal(editorService.lastInput.options.selection.startColumn, 1);
assert.equal(editorService.lastInput.options.selection.endLineNumber, undefined);
assert.equal(editorService.lastInput.options.selection.endColumn, undefined);
assert.equal(editorService.lastInput.options!.selection!.startLineNumber, 23);
assert.equal(editorService.lastInput.options!.selection!.startColumn, 1);
assert.equal(editorService.lastInput.options!.selection!.endLineNumber, undefined);
assert.equal(editorService.lastInput.options!.selection!.endColumn, undefined);
assert.equal(editorService.lastInput.resource.fragment, '');
openerService.open(URI.parse('file:///somepath#23,45'));
assert.equal(editorService.lastInput.options.selection.startLineNumber, 23);
assert.equal(editorService.lastInput.options.selection.startColumn, 45);
assert.equal(editorService.lastInput.options.selection.endLineNumber, undefined);
assert.equal(editorService.lastInput.options.selection.endColumn, undefined);
assert.equal(editorService.lastInput.options!.selection!.startLineNumber, 23);
assert.equal(editorService.lastInput.options!.selection!.startColumn, 45);
assert.equal(editorService.lastInput.options!.selection!.endLineNumber, undefined);
assert.equal(editorService.lastInput.options!.selection!.endColumn, undefined);
assert.equal(editorService.lastInput.resource.fragment, '');
});
@@ -79,28 +79,22 @@ suite('OpenerService', function () {
const openerService = new OpenerService(editorService, commandService);
// unknown command
openerService.open(URI.parse('command:foobar'));
assert.equal(lastCommand, undefined);
assert.equal(editorService.lastInput.resource.toString(), 'command:foobar');
assert.equal(editorService.lastInput.options.selection, undefined);
const id = `aCommand${Math.random()}`;
CommandsRegistry.registerCommand(id, function () { });
openerService.open(URI.parse('command:' + id));
assert.equal(lastCommand.id, id);
assert.equal(lastCommand.args.length, 0);
assert.equal(lastCommand!.id, id);
assert.equal(lastCommand!.args.length, 0);
openerService.open(URI.parse('command:' + id).with({ query: '123' }));
assert.equal(lastCommand.id, id);
assert.equal(lastCommand.args.length, 1);
assert.equal(lastCommand.args[0], '123');
assert.equal(lastCommand!.id, id);
assert.equal(lastCommand!.args.length, 1);
assert.equal(lastCommand!.args[0], '123');
openerService.open(URI.parse('command:' + id).with({ query: JSON.stringify([12, true]) }));
assert.equal(lastCommand.id, id);
assert.equal(lastCommand.args.length, 2);
assert.equal(lastCommand.args[0], 12);
assert.equal(lastCommand.args[1], true);
assert.equal(lastCommand!.id, id);
assert.equal(lastCommand!.args.length, 2);
assert.equal(lastCommand!.args[0], 12);
assert.equal(lastCommand!.args[1], true);
});
});