From 3ae2793a31b76f609d6eab0ebe85d603d30ea6d1 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 22 Dec 2015 15:34:21 +0100 Subject: [PATCH] tslint --- .../common/api/extHostApiCommands.test.ts | 46 +++++++------------ .../api/extHostLanguageFeatures.test.ts | 22 ++++----- 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/vs/workbench/test/common/api/extHostApiCommands.test.ts b/src/vs/workbench/test/common/api/extHostApiCommands.test.ts index a52e5425bb5..de7c5bd68c0 100644 --- a/src/vs/workbench/test/common/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/common/api/extHostApiCommands.test.ts @@ -26,18 +26,6 @@ import {ExtHostLanguageFeatures, MainThreadLanguageFeatures} from 'vs/workbench/ import {ExtHostApiCommands} from 'vs/workbench/api/common/extHostApiCommands'; import {ExtHostCommands, MainThreadCommands} from 'vs/workbench/api/common/extHostCommands'; import {ExtHostModelService} from 'vs/workbench/api/common/extHostDocuments'; -import {SyncDescriptor0} from 'vs/platform/instantiation/common/descriptors'; -import {LanguageSelector} from 'vs/editor/common/modes/languageSelector'; -import {OutlineRegistry, getOutlineEntries} from 'vs/editor/contrib/quickOpen/common/quickOpen'; -import {CodeLensRegistry, getCodeLensData} from 'vs/editor/contrib/codelens/common/codelens'; -import {DeclarationRegistry, getDeclarationsAtPosition} from 'vs/editor/contrib/goToDeclaration/common/goToDeclaration'; -import {ExtraInfoRegistry, getExtraInfoAtPosition} from 'vs/editor/contrib/hover/common/hover'; -import {OccurrencesRegistry, getOccurrencesAtPosition} from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; -import {ReferenceRegistry, findReferences} from 'vs/editor/contrib/referenceSearch/common/referenceSearch'; -import {getQuickFixes} from 'vs/editor/contrib/quickFix/common/quickFix'; -import {getNavigateToItems} from 'vs/workbench/parts/search/common/search'; -import {rename} from 'vs/editor/contrib/rename/common/rename'; -import {getParameterHints} from 'vs/editor/contrib/parameterHints/common/parameterHints'; const defaultSelector = { scheme: 'far' }; const model: EditorCommon.IModel = new EditorModel( @@ -66,18 +54,18 @@ suite('ExtHostLanguageFeatureCommands', function() { threadService.setInstantiationService(instantiationService); instantiationService.addSingleton(IMarkerService, new MarkerService(threadService)); instantiationService.addSingleton(IThreadService, threadService); - instantiationService.addSingleton(IModelService, { + instantiationService.addSingleton(IModelService, { serviceId: IModelService, - getModel():any { return model; }, - createModel():any { throw new Error(); }, - destroyModel():any { throw new Error(); }, - getModels():any { throw new Error(); }, + getModel(): any { return model; }, + createModel(): any { throw new Error(); }, + destroyModel(): any { throw new Error(); }, + getModels(): any { throw new Error(); }, onModelAdded: undefined, onModelModeChanged: undefined, onModelRemoved: undefined }); instantiationService.addSingleton(IKeybindingService, { - executeCommand(id, args):any { + executeCommand(id, args): any { let handler = KeybindingsRegistry.getCommands()[id]; return TPromise.as(instantiationService.invokeFunction(handler, args)); } @@ -127,11 +115,11 @@ suite('ExtHostLanguageFeatureCommands', function() { ]; // threadService.sync().then(() => { - TPromise.join(promises).then(undefined, (err: any[]) => { - assert.equal(err.length, 4); - done(); - return []; - }); + TPromise.join(promises).then(undefined, (err: any[]) => { + assert.equal(err.length, 4); + done(); + return []; + }); // }); }); @@ -180,11 +168,11 @@ suite('ExtHostLanguageFeatureCommands', function() { ]; // threadService.sync().then(() => { - TPromise.join(promises).then(undefined, (err: any[]) => { - assert.equal(err.length, 4); - done(); - return []; - }); + TPromise.join(promises).then(undefined, (err: any[]) => { + assert.equal(err.length, 4); + done(); + return []; + }); // }); }); @@ -334,4 +322,4 @@ suite('ExtHostLanguageFeatureCommands', function() { }); }); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts index f794915c0fd..9db78121535 100644 --- a/src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/common/api/extHostLanguageFeatures.test.ts @@ -9,8 +9,6 @@ import * as assert from 'assert'; import {setUnexpectedErrorHandler, errorHandler} from 'vs/base/common/errors'; import {create} from 'vs/base/common/types'; import URI from 'vs/base/common/uri'; -import {TPromise} from 'vs/base/common/winjs.base'; -import {ExtHostDocument} from 'vs/workbench/api/common/extHostDocuments'; import * as types from 'vs/workbench/api/common/extHostTypes'; import {Range as CodeEditorRange} from 'vs/editor/common/core/range'; import * as EditorCommon from 'vs/editor/common/editorCommon'; @@ -23,14 +21,12 @@ import {IThreadService} from 'vs/platform/thread/common/thread'; import {ExtHostLanguageFeatures, MainThreadLanguageFeatures} from 'vs/workbench/api/common/extHostLanguageFeatures'; import {ExtHostCommands, MainThreadCommands} from 'vs/workbench/api/common/extHostCommands'; import {ExtHostModelService} from 'vs/workbench/api/common/extHostDocuments'; -import {SyncDescriptor0} from 'vs/platform/instantiation/common/descriptors'; -import {LanguageSelector} from 'vs/editor/common/modes/languageSelector'; import {OutlineRegistry, getOutlineEntries} from 'vs/editor/contrib/quickOpen/common/quickOpen'; -import {CodeLensRegistry, getCodeLensData} from 'vs/editor/contrib/codelens/common/codelens'; -import {DeclarationRegistry, getDeclarationsAtPosition} from 'vs/editor/contrib/goToDeclaration/common/goToDeclaration'; -import {ExtraInfoRegistry, getExtraInfoAtPosition} from 'vs/editor/contrib/hover/common/hover'; -import {OccurrencesRegistry, getOccurrencesAtPosition} from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; -import {ReferenceRegistry, findReferences} from 'vs/editor/contrib/referenceSearch/common/referenceSearch'; +import {getCodeLensData} from 'vs/editor/contrib/codelens/common/codelens'; +import {getDeclarationsAtPosition} from 'vs/editor/contrib/goToDeclaration/common/goToDeclaration'; +import {getExtraInfoAtPosition} from 'vs/editor/contrib/hover/common/hover'; +import {getOccurrencesAtPosition} from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; +import {findReferences} from 'vs/editor/contrib/referenceSearch/common/referenceSearch'; import {getQuickFixes} from 'vs/editor/contrib/quickFix/common/quickFix'; import {getNavigateToItems} from 'vs/workbench/parts/search/common/search'; import {rename} from 'vs/editor/contrib/rename/common/rename'; @@ -168,7 +164,7 @@ suite('ExtHostLanguageFeatures', function() { test('CodeLens, evil provider', function(done) { disposables.push(extHost.registerCodeLensProvider(defaultSelector, { - provideCodeLenses():any { + provideCodeLenses(): any { throw new Error('evil') } })); @@ -189,12 +185,12 @@ suite('ExtHostLanguageFeatures', function() { test('CodeLens, do not resolve a resolved lens', function(done) { disposables.push(extHost.registerCodeLensProvider(defaultSelector, { - provideCodeLenses():any { + provideCodeLenses(): any { return [new types.CodeLens( new types.Range(0, 0, 0, 0), { command: 'id', title: 'Title' })]; }, - resolveCodeLens():any { + resolveCodeLens(): any { assert.ok(false, 'do not resolve'); } })); @@ -1010,4 +1006,4 @@ suite('ExtHostLanguageFeatures', function() { }); }); }); -}); \ No newline at end of file +}); -- GitLab