unused imports and other tslint findings

This commit is contained in:
Johannes Rieken 2015-12-10 14:55:40 +01:00
parent 67fa01ef8a
commit bf6db83167
5 changed files with 26 additions and 60 deletions

View file

@ -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';

View file

@ -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<ICodeLensData[]>('_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 {
}
});
}
}
}

View file

@ -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<ISingleEditOperation[]> {
@ -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<IOutlineEntry[]>{
$getOutline(handle: number, resource: URI): TPromise<IOutlineEntry[]> {
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<modes.ICodeLensSymbol> {
$resolveCodeLensSymbol(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol> {
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<modes.IComputeExtraInfoResult> {
$computeInfo(handle: number, resource: URI, position: IPosition): TPromise<modes.IComputeExtraInfoResult> {
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<modes.IOccurence[]> {
$findOccurrences(handle: number, resource: URI, position: IPosition): TPromise<modes.IOccurence[]> {
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<modes.IQuickFix[]> {
$getQuickFixes(handle: number, resource: URI, range: IRange, marker: IMarker[]): TPromise<modes.IQuickFix[]> {
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<ISingleEditOperation[]>{
$formatDocument(handle: number, resource: URI, options: modes.IFormattingOptions): TPromise<ISingleEditOperation[]> {
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<ISingleEditOperation[]>{
$formatRange(handle: number, resource: URI, range: IRange, options: modes.IFormattingOptions): TPromise<ISingleEditOperation[]> {
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<ISingleEditOperation[]>{
$formatAfterKeystroke(handle: number, resource: URI, position: IPosition, ch: string, options: modes.IFormattingOptions): TPromise<ISingleEditOperation[]> {
return this._withAdapter(handle, OnTypeFormattingAdapter, adapter => adapter.formatAfterKeystroke(resource, position, ch, options));
}
@ -1036,4 +1030,4 @@ export class MainThreadLanguageFeatures {
});
return undefined;
}
}
}

View file

@ -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<string[]> {
return TPromise.as(this._registry.getRegisteredModes());
}
}
}

View file

@ -109,4 +109,4 @@ export class MainThreadOutputService {
}
}
}
}
}