mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 17:23:45 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -3,37 +3,55 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { formatOptions } from 'vs/platform/environment/node/argv';
|
||||
import { formatOptions, Option } from 'vs/platform/environment/node/argv';
|
||||
|
||||
suite('formatOptions', () => {
|
||||
|
||||
function o(id: string, description: string): Option {
|
||||
return {
|
||||
id, description, type: 'string'
|
||||
};
|
||||
}
|
||||
|
||||
test('Text should display small columns correctly', () => {
|
||||
assert.equal(formatOptions({ 'foo': 'bar' }, 80), ' foo bar');
|
||||
assert.equal(
|
||||
formatOptions({
|
||||
'f': 'bar',
|
||||
'fo': 'ba',
|
||||
'foo': 'b'
|
||||
}, 80),
|
||||
' f bar\n' +
|
||||
' fo ba\n' +
|
||||
' foo b');
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('foo', 'bar')
|
||||
], 80),
|
||||
[' --foo bar']
|
||||
);
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('f', 'bar'),
|
||||
o('fo', 'ba'),
|
||||
o('foo', 'b')
|
||||
], 80),
|
||||
[
|
||||
' --f bar',
|
||||
' --fo ba',
|
||||
' --foo b'
|
||||
]);
|
||||
});
|
||||
|
||||
test('Text should wrap', () => {
|
||||
assert.equal(
|
||||
formatOptions({
|
||||
'foo': (<any>'bar ').repeat(9)
|
||||
}, 40),
|
||||
' foo bar bar bar bar bar bar bar bar\n' +
|
||||
' bar');
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('foo', (<any>'bar ').repeat(9))
|
||||
], 40),
|
||||
[
|
||||
' --foo bar bar bar bar bar bar bar bar',
|
||||
' bar'
|
||||
]);
|
||||
});
|
||||
|
||||
test('Text should revert to the condensed view when the terminal is too narrow', () => {
|
||||
assert.equal(
|
||||
formatOptions({
|
||||
'foo': (<any>'bar ').repeat(9)
|
||||
}, 30),
|
||||
' foo\n' +
|
||||
' bar bar bar bar bar bar bar bar bar ');
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('foo', (<any>'bar ').repeat(9))
|
||||
], 30),
|
||||
[
|
||||
' --foo',
|
||||
' bar bar bar bar bar bar bar bar bar '
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -25,13 +25,13 @@ function options(custom?: Partial<IBestWindowOrFolderOptions<ISimpleWindow>>): I
|
||||
reuseWindow: false,
|
||||
context: OpenContext.CLI,
|
||||
codeSettingsFolder: '_vscode',
|
||||
workspaceResolver: workspace => { return workspace === testWorkspace ? { id: testWorkspace.id, configPath: workspace.configPath, folders: toWorkspaceFolders([{ path: path.join(fixturesFolder, 'vscode_workspace_1_folder') }, { path: path.join(fixturesFolder, 'vscode_workspace_2_folder') }]) } : null; },
|
||||
workspaceResolver: workspace => { return workspace === testWorkspace ? { id: testWorkspace.id, configPath: workspace.configPath, folders: toWorkspaceFolders([{ path: path.join(fixturesFolder, 'vscode_workspace_1_folder') }, { path: path.join(fixturesFolder, 'vscode_workspace_2_folder') }]) } : null!; },
|
||||
...custom
|
||||
};
|
||||
}
|
||||
|
||||
const vscodeFolderWindow: ISimpleWindow = { lastFocusTime: 1, openedFolderUri: URI.file(path.join(fixturesFolder, 'vscode_folder')) };
|
||||
const lastActiveWindow: ISimpleWindow = { lastFocusTime: 3, openedFolderUri: null };
|
||||
const lastActiveWindow: ISimpleWindow = { lastFocusTime: 3, openedFolderUri: undefined };
|
||||
const noVscodeFolderWindow: ISimpleWindow = { lastFocusTime: 2, openedFolderUri: URI.file(path.join(fixturesFolder, 'no_vscode_folder')) };
|
||||
const windows: ISimpleWindow[] = [
|
||||
vscodeFolderWindow,
|
||||
|
||||
Reference in New Issue
Block a user