From bf6db831672304ef6f6c8dd4deeac25ca58342f6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 10 Dec 2015 14:55:40 +0100 Subject: [PATCH] unused imports and other tslint findings --- src/vs/editor/contrib/format/common/format.ts | 3 +- .../api/common/extHostApiCommands.ts | 31 ++++----------- .../api/common/extHostLanguageFeatures.ts | 38 ++++++++----------- .../workbench/api/common/extHostLanguages.ts | 12 +----- .../api/common/extHostOutputService.ts | 2 +- 5 files changed, 26 insertions(+), 60 deletions(-) diff --git a/src/vs/editor/contrib/format/common/format.ts b/src/vs/editor/contrib/format/common/format.ts index 44820b30b1f..b583a65a782 100644 --- a/src/vs/editor/contrib/format/common/format.ts +++ b/src/vs/editor/contrib/format/common/format.ts @@ -7,9 +7,8 @@ import {IFormattingSupport, IFormattingOptions} from 'vs/editor/common/modes'; import LanguageFeatureRegistry from 'vs/editor/common/modes/languageFeatureRegistry'; -import {onUnexpectedError, illegalArgument} from 'vs/base/common/errors'; +import {illegalArgument} from 'vs/base/common/errors'; import URI from 'vs/base/common/uri'; -import {IAction, Action} from 'vs/base/common/actions'; import {IModelService} from 'vs/editor/common/services/modelService'; import {TPromise} from 'vs/base/common/winjs.base'; import {IModel, IRange, IPosition, ISingleEditOperation} from 'vs/editor/common/editorCommon'; diff --git a/src/vs/workbench/api/common/extHostApiCommands.ts b/src/vs/workbench/api/common/extHostApiCommands.ts index 01c4875a8d3..a059a192f41 100644 --- a/src/vs/workbench/api/common/extHostApiCommands.ts +++ b/src/vs/workbench/api/common/extHostApiCommands.ts @@ -5,36 +5,18 @@ 'use strict'; import URI from 'vs/base/common/uri'; -import Event, {Emitter} from 'vs/base/common/event'; -import Severity from 'vs/base/common/severity'; -import {DefaultFilter} from 'vs/editor/common/modes/modesFilters'; import {TPromise} from 'vs/base/common/winjs.base'; -import {onUnexpectedError} from 'vs/base/common/errors'; -import {sequence} from 'vs/base/common/async'; -import {Range as EditorRange} from 'vs/editor/common/core/range'; import {IDisposable} from 'vs/base/common/lifecycle'; -import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; -import {Remotable, IThreadService} from 'vs/platform/thread/common/thread'; import * as vscode from 'vscode'; import * as typeConverters from 'vs/workbench/api/common/pluginHostTypeConverters'; import * as types from 'vs/workbench/api/common/pluginHostTypes'; -import {IPosition, IRange, ISingleEditOperation} from 'vs/editor/common/editorCommon'; +import {ISingleEditOperation} from 'vs/editor/common/editorCommon'; import * as modes from 'vs/editor/common/modes'; import {ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindingService'; -import {CancellationTokenSource} from 'vs/base/common/cancellation'; -import {PluginHostModelService} from 'vs/workbench/api/common/pluginHostDocuments'; -import {IMarkerService, IMarker} from 'vs/platform/markers/common/markers'; -import {PluginHostCommands, MainThreadCommands} from 'vs/workbench/api/common/pluginHostCommands'; -import {DeclarationRegistry} from 'vs/editor/contrib/goToDeclaration/common/goToDeclaration'; -import {ExtraInfoRegistry} from 'vs/editor/contrib/hover/common/hover'; -import {OccurrencesRegistry} from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; -import {ReferenceRegistry} from 'vs/editor/contrib/referenceSearch/common/referenceSearch'; -import {IQuickFix2, QuickFixRegistry, getQuickFixes} from 'vs/editor/contrib/quickFix/common/quickFix'; +import {PluginHostCommands} from 'vs/workbench/api/common/pluginHostCommands'; +import {IQuickFix2} from 'vs/editor/contrib/quickFix/common/quickFix'; import {IOutline} from 'vs/editor/contrib/quickOpen/common/quickOpen'; -import LanguageFeatureRegistry from 'vs/editor/common/modes/languageFeatureRegistry'; -import {NavigateTypesSupportRegistry, INavigateTypesSupport, ITypeBearing} from 'vs/workbench/parts/search/common/search' -import {RenameRegistry} from 'vs/editor/contrib/rename/common/rename'; -import {FormatRegistry, FormatOnTypeRegistry} from 'vs/editor/contrib/format/common/format'; +import {ITypeBearing} from 'vs/workbench/parts/search/common/search' import {ICodeLensData} from 'vs/editor/contrib/codelens/common/codelens'; export class ExtHostApiCommands { @@ -313,7 +295,8 @@ export class ExtHostApiCommands { return this._commands.executeCommand('_executeCodeLensProvider', args).then(value => { if (Array.isArray(value)) { return value.map(item => { - return new types.CodeLens(typeConverters.toRange(item.symbol.range), + return new types.CodeLens( + typeConverters.toRange(item.symbol.range), typeConverters.Command.to(item.symbol.command)); }); } @@ -358,4 +341,4 @@ export class ExtHostApiCommands { } }); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index 696b257c71b..e68844d4614 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -5,32 +5,26 @@ 'use strict'; import URI from 'vs/base/common/uri'; -import Event, {Emitter} from 'vs/base/common/event'; -import Severity from 'vs/base/common/severity'; import {DefaultFilter} from 'vs/editor/common/modes/modesFilters'; import {TPromise} from 'vs/base/common/winjs.base'; -import {onUnexpectedError} from 'vs/base/common/errors'; -import {sequence} from 'vs/base/common/async'; -import {Range as EditorRange} from 'vs/editor/common/core/range'; import {IDisposable} from 'vs/base/common/lifecycle'; -import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService'; import {Remotable, IThreadService} from 'vs/platform/thread/common/thread'; +import {Range as EditorRange} from 'vs/editor/common/core/range'; import * as vscode from 'vscode'; import * as TypeConverters from 'vs/workbench/api/common/pluginHostTypeConverters'; -import {Position, Range, SymbolKind, DocumentHighlightKind, Disposable, Diagnostic, DiagnosticSeverity, Location, SignatureHelp, CompletionItemKind} from 'vs/workbench/api/common/pluginHostTypes'; +import {Range, DocumentHighlightKind, Disposable, Diagnostic, SignatureHelp} from 'vs/workbench/api/common/pluginHostTypes'; import {IPosition, IRange, ISingleEditOperation} from 'vs/editor/common/editorCommon'; import * as modes from 'vs/editor/common/modes'; import {CancellationTokenSource} from 'vs/base/common/cancellation'; import {PluginHostModelService} from 'vs/workbench/api/common/pluginHostDocuments'; import {IMarkerService, IMarker} from 'vs/platform/markers/common/markers'; -import {PluginHostCommands, MainThreadCommands} from 'vs/workbench/api/common/pluginHostCommands'; +import {PluginHostCommands} from 'vs/workbench/api/common/pluginHostCommands'; import {DeclarationRegistry} from 'vs/editor/contrib/goToDeclaration/common/goToDeclaration'; import {ExtraInfoRegistry} from 'vs/editor/contrib/hover/common/hover'; import {OccurrencesRegistry} from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; import {ReferenceRegistry} from 'vs/editor/contrib/referenceSearch/common/referenceSearch'; import {QuickFixRegistry} from 'vs/editor/contrib/quickFix/common/quickFix'; import {OutlineRegistry, IOutlineEntry, IOutlineSupport} from 'vs/editor/contrib/quickOpen/common/quickOpen'; -import LanguageFeatureRegistry from 'vs/editor/common/modes/languageFeatureRegistry'; import {NavigateTypesSupportRegistry, INavigateTypesSupport, ITypeBearing} from 'vs/workbench/parts/search/common/search' import {RenameRegistry} from 'vs/editor/contrib/rename/common/rename'; import {FormatRegistry, FormatOnTypeRegistry} from 'vs/editor/contrib/format/common/format'; @@ -256,7 +250,7 @@ class ReferenceAdapter implements modes.IReferenceSupport { this._provider = provider; } - canFindReferences():boolean { + canFindReferences(): boolean { return true } @@ -376,7 +370,7 @@ class OnTypeFormattingAdapter implements modes.IFormattingSupport { this._provider = provider; } - autoFormatTriggerCharacters = []; // not here + autoFormatTriggerCharacters: string[] = []; // not here formatAfterKeystroke(resource: URI, position: IPosition, ch: string, options: modes.IFormattingOptions): TPromise { @@ -548,7 +542,7 @@ class SuggestAdapter implements modes.ISuggestSupport { }); } - getFilter(): any{ + getFilter(): any { throw new Error('illegal state'); } getTriggerCharacters(): string[] { @@ -601,7 +595,7 @@ type Adapter = OutlineAdapter | CodeLensAdapter | DeclarationAdapter | ExtraInfo @Remotable.PluginHostContext('ExtHostLanguageFeatures') export class ExtHostLanguageFeatures { - private static _handlePool = 0; + private static _handlePool: number = 0; private _proxy: MainThreadLanguageFeatures; private _documents: PluginHostModelService; @@ -642,7 +636,7 @@ export class ExtHostLanguageFeatures { return this._createDisposable(handle); } - $getOutline(handle: number, resource: URI): TPromise{ + $getOutline(handle: number, resource: URI): TPromise { return this._withAdapter(handle, OutlineAdapter, adapter => adapter.getOutline(resource)); } @@ -659,7 +653,7 @@ export class ExtHostLanguageFeatures { return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.findCodeLensSymbols(resource)); } - $resolveCodeLensSymbol(handle:number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise { + $resolveCodeLensSymbol(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise { return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.resolveCodeLensSymbol(resource, symbol)); } @@ -685,7 +679,7 @@ export class ExtHostLanguageFeatures { return this._createDisposable(handle); } - $computeInfo(handle:number, resource: URI, position: IPosition): TPromise { + $computeInfo(handle: number, resource: URI, position: IPosition): TPromise { return this._withAdapter(handle, ExtraInfoAdapter, adpater => adpater.computeInfo(resource, position)); } @@ -698,7 +692,7 @@ export class ExtHostLanguageFeatures { return this._createDisposable(handle); } - $findOccurrences(handle:number, resource: URI, position: IPosition): TPromise { + $findOccurrences(handle: number, resource: URI, position: IPosition): TPromise { return this._withAdapter(handle, OccurrencesAdapter, adapter => adapter.findOccurrences(resource, position)); } @@ -724,7 +718,7 @@ export class ExtHostLanguageFeatures { return this._createDisposable(handle); } - $getQuickFixes(handle:number, resource: URI, range: IRange, marker: IMarker[]): TPromise { + $getQuickFixes(handle: number, resource: URI, range: IRange, marker: IMarker[]): TPromise { return this._withAdapter(handle, QuickFixAdapter, adapter => adapter.getQuickFixes(resource, range, marker)); } @@ -741,7 +735,7 @@ export class ExtHostLanguageFeatures { return this._createDisposable(handle); } - $formatDocument(handle: number, resource: URI, options: modes.IFormattingOptions): TPromise{ + $formatDocument(handle: number, resource: URI, options: modes.IFormattingOptions): TPromise { return this._withAdapter(handle, DocumentFormattingAdapter, adapter => adapter.formatDocument(resource, options)); } @@ -752,7 +746,7 @@ export class ExtHostLanguageFeatures { return this._createDisposable(handle); } - $formatRange(handle: number, resource: URI, range: IRange, options: modes.IFormattingOptions): TPromise{ + $formatRange(handle: number, resource: URI, range: IRange, options: modes.IFormattingOptions): TPromise { return this._withAdapter(handle, RangeFormattingAdapter, adapter => adapter.formatRange(resource, range, options)); } @@ -763,7 +757,7 @@ export class ExtHostLanguageFeatures { return this._createDisposable(handle); } - $formatAfterKeystroke(handle: number, resource: URI, position: IPosition, ch: string, options: modes.IFormattingOptions): TPromise{ + $formatAfterKeystroke(handle: number, resource: URI, position: IPosition, ch: string, options: modes.IFormattingOptions): TPromise { return this._withAdapter(handle, OnTypeFormattingAdapter, adapter => adapter.formatAfterKeystroke(resource, position, ch, options)); } @@ -1036,4 +1030,4 @@ export class MainThreadLanguageFeatures { }); return undefined; } -} \ No newline at end of file +} diff --git a/src/vs/workbench/api/common/extHostLanguages.ts b/src/vs/workbench/api/common/extHostLanguages.ts index ea351dd9e5c..faf87793a8a 100644 --- a/src/vs/workbench/api/common/extHostLanguages.ts +++ b/src/vs/workbench/api/common/extHostLanguages.ts @@ -4,18 +4,8 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import URI from 'vs/base/common/uri'; -import Event, {Emitter} from 'vs/base/common/event'; -import {IDisposable, disposeAll} from 'vs/base/common/lifecycle'; import {TPromise} from 'vs/base/common/winjs.base'; import {Remotable, IThreadService} from 'vs/platform/thread/common/thread'; -import {PluginHostModelService} from 'vs/workbench/api/common/pluginHostDocuments'; -import {ISingleEditOperation, ISelection, IRange, IInternalIndentationOptions} from 'vs/editor/common/editorCommon'; -import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; -import {IModelService} from 'vs/editor/common/services/modelService'; -import {MainThreadEditorsTracker, MainThreadTextEditor, ITextEditorConfiguration} from 'vs/workbench/api/common/mainThreadEditors'; -import * as TypeConverters from './pluginHostTypeConverters'; -import {TextEditorSelectionChangeEvent, TextEditorOptionsChangeEvent} from 'vscode'; import {IEditorModesRegistry, Extensions} from 'vs/editor/common/modes/modesRegistry'; import {Registry} from 'vs/platform/platform'; import {INullService} from 'vs/platform/instantiation/common/instantiation'; @@ -45,4 +35,4 @@ export class MainThreadLanguages { _getLanguages(): TPromise { return TPromise.as(this._registry.getRegisteredModes()); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/api/common/extHostOutputService.ts b/src/vs/workbench/api/common/extHostOutputService.ts index 3e7f2cfcb18..aff6178bf70 100644 --- a/src/vs/workbench/api/common/extHostOutputService.ts +++ b/src/vs/workbench/api/common/extHostOutputService.ts @@ -109,4 +109,4 @@ export class MainThreadOutputService { } } } -} \ No newline at end of file +}