From d5e8fcf52edfbf2921bb66799fc8eed92d00049d Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 11 Nov 2016 09:58:50 +0100 Subject: [PATCH] pass tests through more hygiene checks related to #15259 --- build/gulpfile.hygiene.js | 16 +++--- src/vs/base/test/common/collections.test.ts | 11 ++-- src/vs/base/test/common/decorators.test.ts | 2 +- src/vs/base/test/node/config.test.ts | 2 +- .../test/common/core/editorState.test.ts | 48 ++++++++--------- .../test/common/diff/diffComputer.test.ts | 2 +- src/vs/editor/test/common/editorTestUtils.ts | 2 +- .../common/model/editableTextModel.test.ts | 51 +++++-------------- .../test/common/model/textModel.test.ts | 2 +- .../modes/languageConfiguration.test.ts | 16 +++--- .../test/node/textMate/TMSyntax.test.ts | 20 ++++---- .../commands/test/commandService.test.ts | 4 +- .../test/node/environmentService.test.ts | 4 +- .../electron-browser/telemetryService.test.ts | 4 +- src/vs/test/utils/instantiationTestUtils.ts | 8 +-- src/vs/test/utils/promiseTestUtils.ts | 8 +-- .../parts/debug/test/node/debugModel.test.ts | 2 +- .../test/browser/extensionsActions.test.ts | 2 +- 18 files changed, 91 insertions(+), 113 deletions(-) diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 29e35ec4b10e..055a91431db8 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -14,8 +14,9 @@ const tslint = require('tslint'); /** * Hygiene works by creating cascading subsets of all our files and - * passing them through a bunch of checks. Here are the current subsets, - * each containing the following one, in mathematical notation: + * passing them through a sequence of checks. Here are the current subsets, + * named according to the checks performed on them. Each subset contains + * the following one, as described in mathematical notation: * * all ⊃ eol ⊇ indentation ⊃ copyright ⊃ typescript */ @@ -51,7 +52,6 @@ const indentationFilter = [ '!**/lib/**', '!**/*.d.ts', '!**/*.d.ts.recipe', - '!extensions/typescript/server/**', '!test/assert.js', '!**/package.json', '!**/npm-shrinkwrap.json', @@ -75,15 +75,16 @@ const copyrightFilter = [ '!**/*.json', '!**/*.html', '!**/*.template', - '!**/test/**', '!**/*.md', '!**/*.bat', '!**/*.cmd', - '!resources/win32/bin/code.js', '!**/*.xml', '!**/*.sh', '!**/*.txt', '!**/*.xpm', + '!**/*.opts', + '!**/*.disabled', + '!resources/win32/bin/code.js', '!extensions/markdown/media/tomorrow.css' ]; @@ -91,6 +92,7 @@ const tslintFilter = [ 'src/**/*.ts', 'extensions/**/*.ts', '!**/*.d.ts', + '!**/fixtures/**', '!**/typings/**', '!**/node_modules/**', '!extensions/typescript/test/colorize-fixtures/**', @@ -112,7 +114,7 @@ function reportFailures(failures) { const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line; const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character; - console.error(`${ name }:${ line + 1}:${ character + 1 }:${ failure.failure }`); + console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`); }); } @@ -185,7 +187,7 @@ const hygiene = exports.hygiene = (some, options) => { }); }); - const tsl = es.through(function(file) { + const tsl = es.through(function (file) { const configuration = tslint.findConfiguration(null, '.'); const options = { configuration, formatter: 'json', rulesDirectory: 'build/lib/tslint' }; const contents = file.contents.toString('utf8'); diff --git a/src/vs/base/test/common/collections.test.ts b/src/vs/base/test/common/collections.test.ts index 1b9d41b10966..61cc8873f34e 100644 --- a/src/vs/base/test/common/collections.test.ts +++ b/src/vs/base/test/common/collections.test.ts @@ -2,6 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + 'use strict'; import * as assert from 'assert'; @@ -68,11 +69,11 @@ suite('Collections', () => { const group1 = 'a', group2 = 'b'; const value1 = 1, value2 = 2, value3 = 3; - let source = [ - { key: group1, value: value1 }, - { key: group1, value: value2 }, - { key: group2, value: value3 }, - ]; + let source = [ + { key: group1, value: value1 }, + { key: group1, value: value2 }, + { key: group2, value: value3 }, + ]; let grouped = collections.groupBy(source, x => x.key); diff --git a/src/vs/base/test/common/decorators.test.ts b/src/vs/base/test/common/decorators.test.ts index 9d6c1c5e434e..c20c4ac10052 100644 --- a/src/vs/base/test/common/decorators.test.ts +++ b/src/vs/base/test/common/decorators.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import { memoize  } from 'vs/base/common/decorators'; +import { memoize } from 'vs/base/common/decorators'; suite('Decorators', () => { test('memoize should memoize methods', () => { diff --git a/src/vs/base/test/node/config.test.ts b/src/vs/base/test/node/config.test.ts index 08569b6f1098..bae77d0b7563 100644 --- a/src/vs/base/test/node/config.test.ts +++ b/src/vs/base/test/node/config.test.ts @@ -175,7 +175,7 @@ suite('Config', () => { if (error) { return onError(error, done); } - + fs.writeFileSync(testFile, '// my comment\n{ "foo": "bar" }'); let watcher = new ConfigWatcher<{ foo: string; }>(testFile, { changeBufferDelay: 100 }); diff --git a/src/vs/editor/test/common/core/editorState.test.ts b/src/vs/editor/test/common/core/editorState.test.ts index 22b5bf368858..a5855fd0a17f 100644 --- a/src/vs/editor/test/common/core/editorState.test.ts +++ b/src/vs/editor/test/common/core/editorState.test.ts @@ -2,6 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + 'use strict'; import * as assert from 'assert'; @@ -21,56 +22,56 @@ interface IStubEditorState { suite('Editor Core - Editor State', () => { const allFlags = Object.keys(CodeEditorStateFlag) - .map(k => CodeEditorStateFlag[k]) - .filter(v => typeof v === 'number') as number[]; + .map(k => CodeEditorStateFlag[k]) + .filter(v => typeof v === 'number') as number[]; test('empty editor state should be valid', () => { - let result = validate( {}, {} ); + let result = validate({}, {}); assert.equal(result, true); }); test('different model URIs should be invalid', () => { let result = validate( - { model: { uri: URI.parse('http://test1') } }, - { model: { uri: URI.parse('http://test2') } } - ); + { model: { uri: URI.parse('http://test1') } }, + { model: { uri: URI.parse('http://test2') } } + ); assert.equal(result, false); }); test('different model versions should be invalid', () => { let result = validate( - { model: { version: 1 } }, - { model: { version: 2 } } - ); + { model: { version: 1 } }, + { model: { version: 2 } } + ); assert.equal(result, false); }); test('different positions should be invalid', () => { let result = validate( - { position: new Position(1, 2) }, - { position: new Position(2, 3) } - ); + { position: new Position(1, 2) }, + { position: new Position(2, 3) } + ); assert.equal(result, false); }); test('different selections should be invalid', () => { let result = validate( - { selection: new Selection(1, 2, 3, 4) }, - { selection: new Selection(5, 2, 3, 4) } - ); + { selection: new Selection(1, 2, 3, 4) }, + { selection: new Selection(5, 2, 3, 4) } + ); assert.equal(result, false); }); test('different scroll positions should be invalid', () => { let result = validate( - { scroll: { left: 1, top: 2 } }, - { scroll: { left: 3, top: 2 } } - ); + { scroll: { left: 1, top: 2 } }, + { scroll: { left: 3, top: 2 } } + ); assert.equal(result, false); }); @@ -80,20 +81,13 @@ suite('Editor Core - Editor State', () => { let sourceEditor = createEditor(source), targetEditor = createEditor(target); - let result = new EditorState(sourceEditor, allFlags) - .validate(targetEditor); + let result = new EditorState(sourceEditor, allFlags).validate(targetEditor); return result; } function createEditor({ model, position, selection, scroll }: IStubEditorState = {}): ICommonCodeEditor { - - let mappedModel = model - ? { - uri: model.uri ? model.uri : URI.parse('http://dummy.org'), - getVersionId: () => model.version - } - : null; + let mappedModel = model ? { uri: model.uri ? model.uri : URI.parse('http://dummy.org'), getVersionId: () => model.version } : null; return { getModel: (): IModel => mappedModel, diff --git a/src/vs/editor/test/common/diff/diffComputer.test.ts b/src/vs/editor/test/common/diff/diffComputer.test.ts index 49891c9495d6..bb3dcf99ace7 100644 --- a/src/vs/editor/test/common/diff/diffComputer.test.ts +++ b/src/vs/editor/test/common/diff/diffComputer.test.ts @@ -24,7 +24,7 @@ function extractCharChangeRepresentation(change, expectedChange): ICharChange { }; } -function extractLineChangeRepresentation(change, expectedChange): IChange|ILineChange { +function extractLineChangeRepresentation(change, expectedChange): IChange | ILineChange { if (change.charChanges) { let charChanges: ICharChange[] = []; for (let i = 0; i < change.charChanges.length; i++) { diff --git a/src/vs/editor/test/common/editorTestUtils.ts b/src/vs/editor/test/common/editorTestUtils.ts index 52665e7da15d..2e2510819749 100644 --- a/src/vs/editor/test/common/editorTestUtils.ts +++ b/src/vs/editor/test/common/editorTestUtils.ts @@ -36,7 +36,7 @@ export function viewModelHelper(model): IViewModelHelper { validateViewPosition: (viewPosition: Position, modelPosition: Position): Position => { return modelPosition; }, - validateViewRange: (viewRange:Range, modelRange: Range): Range => { + validateViewRange: (viewRange: Range, modelRange: Range): Range => { return modelRange; } }; diff --git a/src/vs/editor/test/common/model/editableTextModel.test.ts b/src/vs/editor/test/common/model/editableTextModel.test.ts index bd20fd95025d..6d5351adcbd8 100644 --- a/src/vs/editor/test/common/model/editableTextModel.test.ts +++ b/src/vs/editor/test/common/model/editableTextModel.test.ts @@ -2,6 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + 'use strict'; import * as assert from 'assert'; @@ -518,7 +519,7 @@ suite('EditorModel - EditableTextModel._toSingleEditOperation', () => { suite('EditorModel - EditableTextModel.applyEdits updates mightContainRTL', () => { - function testApplyEdits(original: string[], edits: IIdentifiedSingleEditOperation[], before:boolean, after:boolean): void { + function testApplyEdits(original: string[], edits: IIdentifiedSingleEditOperation[], before: boolean, after: boolean): void { let model = new EditableTextModel([], TextModel.toRawText(original.join('\n'), TextModel.DEFAULT_CREATION_OPTIONS), null); model.setEOL(EndOfLineSequence.LF); @@ -537,56 +538,32 @@ suite('EditorModel - EditableTextModel.applyEdits updates mightContainRTL', () = forceMoveMarkers: false }; } - // model.setValue('Hello,\nזוהי עובדה מבוססת שדעתו'); + // model.setValue('Hello,\nזוהי עובדה מבוססת שדעתו'); - // let model = new TextModel([], TextModel.toRawText('Hello,\nهناك حقيقة مثبتة منذ زمن طويل', TextModel.DEFAULT_CREATION_OPTIONS)); + // let model = new TextModel([], TextModel.toRawText('Hello,\nهناك حقيقة مثبتة منذ زمن طويل', TextModel.DEFAULT_CREATION_OPTIONS)); test('start with RTL, insert LTR', () => { - testApplyEdits([ - 'Hello,\nזוהי עובדה מבוססת שדעתו' - ], [ - editOp(1,1,1,1, ['hello']) - ], true, true); + testApplyEdits(['Hello,\nזוהי עובדה מבוססת שדעתו'], [editOp(1, 1, 1, 1, ['hello'])], true, true); }); test('start with RTL, delete RTL', () => { - testApplyEdits([ - 'Hello,\nזוהי עובדה מבוססת שדעתו' - ], [ - editOp(1,1,10,10, ['']) - ], true, true); + testApplyEdits(['Hello,\nזוהי עובדה מבוססת שדעתו'], [editOp(1, 1, 10, 10, [''])], true, true); }); test('start with RTL, insert RTL', () => { - testApplyEdits([ - 'Hello,\nזוהי עובדה מבוססת שדעתו' - ], [ - editOp(1,1,1,1, ['هناك حقيقة مثبتة منذ زمن طويل']) - ], true, true); + testApplyEdits(['Hello,\nזוהי עובדה מבוססת שדעתו'], [editOp(1, 1, 1, 1, ['هناك حقيقة مثبتة منذ زمن طويل'])], true, true); }); test('start with LTR, insert LTR', () => { - testApplyEdits([ - 'Hello,\nworld!' - ], [ - editOp(1,1,1,1, ['hello']) - ], false, false); + testApplyEdits(['Hello,\nworld!'], [editOp(1, 1, 1, 1, ['hello'])], false, false); }); test('start with LTR, insert RTL 1', () => { - testApplyEdits([ - 'Hello,\nworld!' - ], [ - editOp(1,1,1,1, ['هناك حقيقة مثبتة منذ زمن طويل']) - ], false, true); + testApplyEdits(['Hello,\nworld!'], [editOp(1, 1, 1, 1, ['هناك حقيقة مثبتة منذ زمن طويل'])], false, true); }); test('start with LTR, insert RTL 2', () => { - testApplyEdits([ - 'Hello,\nworld!' - ], [ - editOp(1,1,1,1, ['זוהי עובדה מבוססת שדעתו']) - ], false, true); + testApplyEdits(['Hello,\nworld!'], [editOp(1, 1, 1, 1, ['זוהי עובדה מבוססת שדעתו'])], false, true); }); }); @@ -616,7 +593,7 @@ suite('EditorModel - EditableTextModel.applyEdits', () => { 'very nice', 'text' ], - /*inputEditsAreInvalid*/true +/*inputEditsAreInvalid*/true ); }); test('high-low surrogates 2', () => { @@ -634,7 +611,7 @@ suite('EditorModel - EditableTextModel.applyEdits', () => { 'very nice', 'text' ], - /*inputEditsAreInvalid*/true +/*inputEditsAreInvalid*/true ); }); test('high-low surrogates 3', () => { @@ -652,7 +629,7 @@ suite('EditorModel - EditableTextModel.applyEdits', () => { 'very nice', 'text' ], - /*inputEditsAreInvalid*/true +/*inputEditsAreInvalid*/true ); }); test('high-low surrogates 4', () => { @@ -670,7 +647,7 @@ suite('EditorModel - EditableTextModel.applyEdits', () => { 'very nice', 'text' ], - /*inputEditsAreInvalid*/true +/*inputEditsAreInvalid*/true ); }); diff --git a/src/vs/editor/test/common/model/textModel.test.ts b/src/vs/editor/test/common/model/textModel.test.ts index e9cebd3734cf..2bb79833aa3e 100644 --- a/src/vs/editor/test/common/model/textModel.test.ts +++ b/src/vs/editor/test/common/model/textModel.test.ts @@ -53,7 +53,7 @@ function assertGuess(expectedInsertSpaces: boolean, expectedTabSize: number, tex suite('TextModel.toRawText', () => { - function testToRawText(text:string, expected:IRawText): void { + function testToRawText(text: string, expected: IRawText): void { let actual = TextModel.toRawText(text, TextModel.DEFAULT_CREATION_OPTIONS); assert.deepEqual(actual, expected); } diff --git a/src/vs/editor/test/common/modes/languageConfiguration.test.ts b/src/vs/editor/test/common/modes/languageConfiguration.test.ts index 45bb72ca8ab8..ec970be8dbeb 100644 --- a/src/vs/editor/test/common/modes/languageConfiguration.test.ts +++ b/src/vs/editor/test/common/modes/languageConfiguration.test.ts @@ -28,7 +28,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('Invalid notIn', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'bla' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['bla'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), true); assert.equal(v.isOK(StandardTokenType.String), true); @@ -36,7 +36,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('notIn in strings', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'string' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['string'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), true); assert.equal(v.isOK(StandardTokenType.String), false); @@ -44,7 +44,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('notIn in comments', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'comment' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['comment'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), false); assert.equal(v.isOK(StandardTokenType.String), true); @@ -52,7 +52,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('notIn in regex', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'regex' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['regex'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), true); assert.equal(v.isOK(StandardTokenType.String), true); @@ -60,7 +60,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('notIn in strings nor comments', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'string', 'comment' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['string', 'comment'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), false); assert.equal(v.isOK(StandardTokenType.String), false); @@ -68,7 +68,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('notIn in strings nor regex', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'string', 'regex' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['string', 'regex'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), true); assert.equal(v.isOK(StandardTokenType.String), false); @@ -76,7 +76,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('notIn in comments nor regex', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'comment', 'regex' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['comment', 'regex'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), false); assert.equal(v.isOK(StandardTokenType.String), true); @@ -84,7 +84,7 @@ suite('StandardAutoClosingPairConditional', () => { }); test('notIn in strings, comments nor regex', () => { - let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: [ 'string', 'comment', 'regex' ] }); + let v = new StandardAutoClosingPairConditional({ open: '{', close: '}', notIn: ['string', 'comment', 'regex'] }); assert.equal(v.isOK(StandardTokenType.Other), true); assert.equal(v.isOK(StandardTokenType.Comment), false); assert.equal(v.isOK(StandardTokenType.String), false); diff --git a/src/vs/editor/test/node/textMate/TMSyntax.test.ts b/src/vs/editor/test/node/textMate/TMSyntax.test.ts index 7abd3b19aafb..48d2baac3ab2 100644 --- a/src/vs/editor/test/node/textMate/TMSyntax.test.ts +++ b/src/vs/editor/test/node/textMate/TMSyntax.test.ts @@ -332,7 +332,7 @@ suite('TextMate.decodeTextMateTokens', () => { { startIndex: 1, type: 'meta.punctuation.embedded.section.end.block.php.metatag' } ], modeTransitions: [ - { startIndex: 0, modeId: 'php'}, + { startIndex: 0, modeId: 'php' }, { startIndex: 1, modeId: 'html' } ] }, { @@ -843,8 +843,8 @@ suite('TextMate.decodeTextMateTokens', () => { { line: 'class {', tmTokens: [ - { startIndex: 0, endIndex: 6, scopes: [ 'source.css.scss' ] }, - { startIndex: 6, endIndex: 7, scopes: [ 'source.css.scss', 'meta.property-list.scss', 'punctuation.section.property-list.begin.bracket.curly.scss' ] } + { startIndex: 0, endIndex: 6, scopes: ['source.css.scss'] }, + { startIndex: 6, endIndex: 7, scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.section.property-list.begin.bracket.curly.scss'] } ], tokens: [ { startIndex: 0, type: '' }, @@ -856,12 +856,12 @@ suite('TextMate.decodeTextMateTokens', () => { }, { line: ' background: red;', tmTokens: [ - { startIndex: 0, endIndex: 4, scopes: [ 'source.css.scss', 'meta.property-list.scss' ] }, - { startIndex: 4, endIndex: 14, scopes: [ 'source.css.scss', 'meta.property-list.scss', 'meta.property-name.scss', 'support.type.property-name.scss' ] }, - { startIndex: 14, endIndex: 15, scopes: [ 'source.css.scss', 'meta.property-list.scss', 'punctuation.separator.key-value.scss' ] }, - { startIndex: 15, endIndex: 16, scopes: [ 'source.css.scss', 'meta.property-list.scss' ] }, - { startIndex: 16, endIndex: 19, scopes: [ 'source.css.scss', 'meta.property-list.scss', 'meta.property-value.scss', 'support.constant.color.w3c-standard-color-name.scss' ] }, - { startIndex: 19, endIndex: 20, scopes: [ 'source.css.scss', 'meta.property-list.scss', 'punctuation.terminator.rule.scss' ] } + { startIndex: 0, endIndex: 4, scopes: ['source.css.scss', 'meta.property-list.scss'] }, + { startIndex: 4, endIndex: 14, scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-name.scss', 'support.type.property-name.scss'] }, + { startIndex: 14, endIndex: 15, scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.separator.key-value.scss'] }, + { startIndex: 15, endIndex: 16, scopes: ['source.css.scss', 'meta.property-list.scss'] }, + { startIndex: 16, endIndex: 19, scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-value.scss', 'support.constant.color.w3c-standard-color-name.scss'] }, + { startIndex: 19, endIndex: 20, scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.terminator.rule.scss'] } ], tokens: [ { startIndex: 0, type: 'meta.property-list.scss' }, @@ -877,7 +877,7 @@ suite('TextMate.decodeTextMateTokens', () => { }, { line: '}', tmTokens: [ - { startIndex: 0, endIndex: 1, scopes: [ 'source.css.scss', 'meta.property-list.scss', 'punctuation.section.property-list.end.bracket.curly.scss' ] } + { startIndex: 0, endIndex: 1, scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.section.property-list.end.bracket.curly.scss'] } ], tokens: [ { startIndex: 0, type: 'meta.property-list.scss.punctuation.section.bracket.curly.end' } diff --git a/src/vs/platform/commands/test/commandService.test.ts b/src/vs/platform/commands/test/commandService.test.ts index 7496b53b4a22..8925ace9eb5b 100644 --- a/src/vs/platform/commands/test/commandService.test.ts +++ b/src/vs/platform/commands/test/commandService.test.ts @@ -21,13 +21,13 @@ class SimpleExtensionService implements IExtensionService { onReady(): TPromise { return TPromise.as(true); } - readExtensionPointContributions(extPoint:IExtensionPoint): TPromise[]> { + readExtensionPointContributions(extPoint: IExtensionPoint): TPromise[]> { return TPromise.as([]); } getExtensionsStatus() { return undefined; } - getExtensions() : TPromise { + getExtensions(): TPromise { return TPromise.wrap([]); } } diff --git a/src/vs/platform/environment/test/node/environmentService.test.ts b/src/vs/platform/environment/test/node/environmentService.test.ts index a3e3576c76e1..1f3b16ab9443 100644 --- a/src/vs/platform/environment/test/node/environmentService.test.ts +++ b/src/vs/platform/environment/test/node/environmentService.test.ts @@ -34,11 +34,11 @@ suite('EnvironmentService', () => { }); test('userDataPath', () => { - const parse = (a, b: { cwd: () => string, env: { [key: string]: string }}) => parseUserDataDir(parseArgs(a), b); + const parse = (a, b: { cwd: () => string, env: { [key: string]: string } }) => parseUserDataDir(parseArgs(a), b); assert.equal(parse(['--user-data-dir', './dir'], { cwd: () => '/foo', env: {} }), path.resolve('/foo/dir'), 'should use cwd when --user-data-dir is specified'); - assert.equal(parse(['--user-data-dir', './dir'], { cwd: () => '/foo', env: {'VSCODE_CWD': '/bar'} }), path.resolve('/bar/dir'), + assert.equal(parse(['--user-data-dir', './dir'], { cwd: () => '/foo', env: { 'VSCODE_CWD': '/bar' } }), path.resolve('/bar/dir'), 'should use VSCODE_CWD as the cwd when --user-data-dir is specified'); }); }); \ No newline at end of file diff --git a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts index 947da678a0f8..e1441e9cc25a 100644 --- a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts @@ -441,7 +441,7 @@ suite('TelemetryService', () => { try { let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); - let service = new TelemetryService({ appender: testAppender, piiPaths: [ settings.personalInfo + '/resources/app/' ] }, undefined); + let service = new TelemetryService({ appender: testAppender, piiPaths: [settings.personalInfo + '/resources/app/'] }, undefined); const errorTelemetry = new ErrorTelemetry(service); let dangerousPathWithImportantInfoError: any = new Error(settings.dangerousPathWithImportantInfo); @@ -472,7 +472,7 @@ suite('TelemetryService', () => { let errorStub = this.stub(window, 'onerror'); let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); - let service = new TelemetryService({ appender: testAppender, piiPaths: [ settings.personalInfo + '/resources/app/' ] }, undefined); + let service = new TelemetryService({ appender: testAppender, piiPaths: [settings.personalInfo + '/resources/app/'] }, undefined); const errorTelemetry = new ErrorTelemetry(service); let dangerousPathWithImportantInfoError: any = new Error('dangerousPathWithImportantInfo'); diff --git a/src/vs/test/utils/instantiationTestUtils.ts b/src/vs/test/utils/instantiationTestUtils.ts index 0e34d008c41e..729a112c4b3e 100644 --- a/src/vs/test/utils/instantiationTestUtils.ts +++ b/src/vs/test/utils/instantiationTestUtils.ts @@ -1,7 +1,9 @@ /*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; import * as sinon from 'sinon'; import { TPromise } from 'vs/base/common/winjs.base'; diff --git a/src/vs/test/utils/promiseTestUtils.ts b/src/vs/test/utils/promiseTestUtils.ts index 315490d0b5e0..c639ccacba6b 100644 --- a/src/vs/test/utils/promiseTestUtils.ts +++ b/src/vs/test/utils/promiseTestUtils.ts @@ -1,7 +1,9 @@ /*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; import { TPromise, PPromise, TValueCallback, TProgressCallback, ProgressCallback } from 'vs/base/common/winjs.base'; import errors = require('vs/base/common/errors'); diff --git a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts index df7d64c0ebe1..e014d245e897 100644 --- a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts +++ b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts @@ -275,7 +275,7 @@ suite('Debug - Model', () => { model.clearThreads(process.getId(), true); assert.equal(process.getThread(stoppedThreadId), null); assert.equal(process.getThread(runningThreadId), null); - assert.equal(process.getAllThreads().length, 0 ); + assert.equal(process.getAllThreads().length, 0); }); // Expressions diff --git a/src/vs/workbench/parts/extensions/test/browser/extensionsActions.test.ts b/src/vs/workbench/parts/extensions/test/browser/extensionsActions.test.ts index 6cd2a3992c15..731312830e41 100644 --- a/src/vs/workbench/parts/extensions/test/browser/extensionsActions.test.ts +++ b/src/vs/workbench/parts/extensions/test/browser/extensionsActions.test.ts @@ -321,7 +321,7 @@ suite('ExtensionsActions Test', () => { instantiationService.get(IExtensionsWorkbenchService).queryLocal().done(extensions => { testObject.extension = extensions[0]; - instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', {id: local.id, version: local.manifest.version}))); + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { id: local.id, version: local.manifest.version }))); instantiationService.get(IExtensionsWorkbenchService).queryGallery().done(extensions => { assert.ok(!testObject.enabled); done();