tslint5 adoption - fix semicolon rule

This commit is contained in:
Erich Gamma 2017-11-07 12:07:09 +01:00
parent 56111c9cc6
commit b94569fe0d
90 changed files with 152 additions and 149 deletions

View file

@ -227,7 +227,7 @@ export class ExtensionLinter {
}
this.diagnosticsCollection.set(document.uri, diagnostics);
};
}
}
private locateToken(text: string, begin: number, end: number, token: MarkdownItType.Token, content: string) {

View file

@ -68,4 +68,4 @@ export function getCSSMode(documentRegions: LanguageModelCache<HTMLDocumentRegio
cssStylesheets.dispose();
}
};
};
}

View file

@ -22,7 +22,7 @@ export interface HTMLDocumentRegions {
export var CSS_STYLE_RULE = '__';
interface EmbeddedRegion { languageId: string; start: number; end: number; attributeValue?: boolean; };
interface EmbeddedRegion { languageId: string; start: number; end: number; attributeValue?: boolean; }
export function getDocumentRegions(languageService: LanguageService, document: TextDocument): HTMLDocumentRegions {

View file

@ -73,7 +73,7 @@ export function format(languageModes: LanguageModes, document: TextDocument, for
embeddedEdits.push(edit);
}
}
};
}
if (embeddedEdits.length === 0) {
pushAll(result, htmlEdits);

View file

@ -69,7 +69,7 @@ export function getHTMLMode(htmlLanguageService: HTMLLanguageService): LanguageM
htmlDocuments.dispose();
}
};
};
}
function merge(src: any, dst: any): any {
for (var key in src) {

View file

@ -164,7 +164,7 @@ export function getJavascriptMode(documentRegions: LanguageModelCache<HTMLDocume
ret.signatures.push(signature);
});
return ret;
};
}
return null;
},
findDocumentHighlight(document: TextDocument, position: Position): DocumentHighlight[] {
@ -177,7 +177,7 @@ export function getJavascriptMode(documentRegions: LanguageModelCache<HTMLDocume
kind: <DocumentHighlightKind>(entry.isWriteAccess ? DocumentHighlightKind.Write : DocumentHighlightKind.Text)
};
});
};
}
return null;
},
findDocumentSymbols(document: TextDocument): SymbolInformation[] {
@ -286,7 +286,7 @@ export function getJavascriptMode(documentRegions: LanguageModelCache<HTMLDocume
jsDocuments.dispose();
}
};
};
}
function convertRange(document: TextDocument, span: { start: number, length: number }): Range {
let startPosition = document.positionAt(span.start);

View file

@ -136,7 +136,7 @@ export class BowerJSONContribution implements IJSONContribution {
}
return null;
});
};
}
return null;
}

View file

@ -187,7 +187,7 @@ export class PackageJSONContribution implements IJSONContribution {
}
return null;
});
};
}
return null;
}

View file

@ -260,8 +260,8 @@ function getSettings(): Settings {
folderPath = folderPath + '/';
}
collectSchemaSettings(folderSchemas, folderUri.fsPath, folderPath + '*');
};
};
}
}
}
return settings;
}

View file

@ -27,7 +27,7 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict
this.applyEdit(type, editor, edit);
return Promise.resolve(true);
};
}
return editor.edit((edit) => this.applyEdit(type, editor, edit));
}

View file

@ -154,7 +154,7 @@ export function activate(context: ExtensionContext): void {
return true;
}
return false;
};
}
const openListener = workspace.onDidOpenTextDocument(didOpenTextDocument);
for (let textDocument of workspace.textDocuments) {
if (didOpenTextDocument(textDocument)) {

View file

@ -375,6 +375,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
this.isRestarting = false;
});
// tslint:disable-next-line:no-unused-expression
new Reader<Proto.Response>(
childProcess.stdout,
(msg) => { this.dispatchMessage(msg); },

View file

@ -163,7 +163,7 @@ function extractKeyCode(e: KeyboardEvent): KeyCode {
return KeyCodeUtils.fromString(char);
}
return KEY_CODE_MAP[e.keyCode] || KeyCode.Unknown;
};
}
export interface IKeyboardEvent {
readonly browserEvent: KeyboardEvent;

View file

@ -50,10 +50,10 @@ export interface IProblemReporter {
}
export class NullProblemReporter implements IProblemReporter {
info(message: string): void { };
warn(message: string): void { };
error(message: string): void { };
fatal(message: string): void { };
info(message: string): void { }
warn(message: string): void { }
error(message: string): void { }
fatal(message: string): void { }
status: ValidationStatus = new ValidationStatus();
}

View file

@ -450,7 +450,7 @@ function _asFormatted(uri: URI, skipEncoding: boolean): string {
}
parts.push(encoder(path.substring(lastIdx, idx)), _slash);
lastIdx = idx + 1;
};
}
}
if (query) {
parts.push('?', encoder(query));

View file

@ -15,4 +15,4 @@ export function fromEventEmitter<T>(emitter: EventEmitter, eventName: string, ma
const result = new Emitter<T>({ onFirstListenerAdd, onLastListenerRemove });
return result.event;
};
}

View file

@ -61,7 +61,7 @@ export class TestService implements ITestService {
}
progress(batch);
process.nextTick(send);
};
}
process.nextTick(send);
});
}
@ -94,7 +94,7 @@ export class TestChannel implements ITestChannel {
export class TestServiceClient implements ITestService {
private _onMarco: Event<IMarcoPoloEvent>;
get onMarco(): Event<IMarcoPoloEvent> { return this._onMarco; };
get onMarco(): Event<IMarcoPoloEvent> { return this._onMarco; }
constructor(private channel: ITestChannel) {
this._onMarco = eventFromCall<IMarcoPoloEvent>(channel, 'event:marco');

View file

@ -210,7 +210,7 @@ suite('Quick Open Scorer', () => {
});
test('scoreItem - avoid match scattering (bug #36119)', function () {
const resource = URI.file('projects/ui/cula/ats/target.mk');;
const resource = URI.file('projects/ui/cula/ats/target.mk');
const pathRes = scoreItem(resource, 'tcltarget.mk', true, ResourceAccessor, cache);
assert.ok(pathRes.score);

View file

@ -1741,7 +1741,7 @@ suite('TreeModel - bugs', () => {
}).done(() => {
// teardown
while (listeners.length > 0) { listeners.pop()(); };
while (listeners.length > 0) { listeners.pop()(); }
listeners = null;
model.dispose();
model = null;

View file

@ -184,7 +184,7 @@ suite('Types', () => {
function isFoo(f) { }
assert.throws(() => types.validateConstraints([new foo()], [isFoo]));
function isFoo2(f) { return true; };
function isFoo2(f) { return true; }
types.validateConstraints([new foo()], [isFoo2]);
assert.throws(() => types.validateConstraints([1, true], [types.isNumber, types.isString]));

View file

@ -393,6 +393,7 @@ export class CodeApplication {
// Ensure Windows foreground love module
try {
// tslint:disable-next-line:no-unused-expression
<any>require.__$__nodeRequire('windows-foreground-love');
} catch (e) {
if (!this.environmentService.isBuilt) {

View file

@ -458,7 +458,7 @@ export class CodeWindow implements ICodeWindow {
this._win.removeAllListeners('swipe');
}
}
};
}
private registerNavigationListenerOn(command: 'swipe' | 'app-command', back: 'left' | 'browser-backward', forward: 'right' | 'browser-forward', acrossEditors: boolean) {
this._win.on(command as 'swipe' /* | 'app-command' */, (e: Electron.Event, cmd: string) => {
@ -833,7 +833,7 @@ export class CodeWindow implements ICodeWindow {
if (notify) {
this.send('vscode:showInfoMessage', nls.localize('hiddenMenuBar', "You can still access the menu bar by pressing the **Alt** key."));
};
}
break;
case ('hidden'):
@ -847,7 +847,7 @@ export class CodeWindow implements ICodeWindow {
this._win.setAutoHideMenuBar(false);
});
break;
};
}
}
public onWindowTitleDoubleClick(): void {

View file

@ -28,7 +28,7 @@ function gestureChangeEventMerger(lastEvent: IThrottledGestureEvent, currentEven
r.translationX += lastEvent.translationX;
}
return r;
};
}
/**
* Basically IE10 and IE11

View file

@ -114,7 +114,7 @@ export namespace EditorScroll_ {
value?: number;
revealCursor?: boolean;
select?: boolean;
};
}
export function parse(args: RawArguments): ParsedArguments {
let direction: Direction;
@ -224,7 +224,7 @@ export namespace RevealLine_ {
export interface RawArguments {
lineNumber?: number;
at?: string;
};
}
/**
* Values for reveal line 'at' argument

View file

@ -670,7 +670,7 @@ export namespace CursorMove {
select?: boolean;
by?: string;
value?: number;
};
}
export function parse(args: RawArguments): ParsedArguments {
if (!args.to) {
@ -753,7 +753,7 @@ export namespace CursorMove {
unit: Unit;
select: boolean;
value: number;
};
}
export const enum Direction {
Left,
@ -772,7 +772,7 @@ export namespace CursorMove {
ViewPortBottom,
ViewPortIfOutside,
};
}
export const enum Unit {
None,
@ -780,6 +780,6 @@ export namespace CursorMove {
WrappedLine,
Character,
HalfLine,
};
}
}

View file

@ -42,4 +42,4 @@ export namespace EditorContextKeys {
export const hasDocumentFormattingProvider = new RawContextKey<boolean>('editorHasDocumentFormattingProvider', undefined);
export const hasDocumentSelectionFormattingProvider = new RawContextKey<boolean>('editorHasDocumentSelectionFormattingProvider', undefined);
export const hasSignatureHelpProvider = new RawContextKey<boolean>('editorHasSignatureHelpProvider', undefined);
};
}

View file

@ -191,7 +191,7 @@ export class RangesCollector {
}
interface PreviousRegion { indent: number; line: number; marker: boolean; };
interface PreviousRegion { indent: number; line: number; marker: boolean; }
export function computeRanges(model: ITextModel, offSide: boolean, markers?: FoldingMarkers, foldingRegionsLimit = MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT): IndentRanges {
const tabSize = model.getOptions().tabSize;

View file

@ -425,7 +425,7 @@ function adjustMarkerBeforeColumn(markerOffset: number, markerStickToPreviousCha
return true;
}
return markerStickToPreviousCharacter;
};
}
/**
* This is a lot more complicated than strictly necessary to maintain the same behaviour

View file

@ -12,7 +12,7 @@ export const enum IndentConsts {
DECREASE_MASK = 0b00000010,
INDENT_NEXTLINE_MASK = 0b00000100,
UNINDENT_MASK = 0b00001000,
};
}
export class IndentRulesSupport {

View file

@ -28,8 +28,8 @@ export class TextResourceConfigurationService extends Disposable implements ITex
this._register(this.configurationService.onDidChangeConfiguration(e => this._onDidChangeConfiguration.fire(e)));
}
getConfiguration<T>(resource: URI, section?: string): T
getConfiguration<T>(resource: URI, at?: IPosition, section?: string): T
getConfiguration<T>(resource: URI, section?: string): T;
getConfiguration<T>(resource: URI, at?: IPosition, section?: string): T;
getConfiguration<T>(resource: URI, arg2?: any, arg3?: any): T {
const position: IPosition = Position.isIPosition(arg2) ? arg2 : null;
const section: string = position ? (typeof arg3 === 'string' ? arg3 : void 0) : (typeof arg2 === 'string' ? arg2 : void 0);

View file

@ -565,4 +565,4 @@ for (let i = 1; i <= 9; i++) {
}
})
);
};
}

View file

@ -32,8 +32,8 @@ export class FoldingModel {
private _updateEventEmitter = new Emitter<FoldingModelChangeEvent>();
public get regions(): FoldingRegion[] { return this._regions; };
public get onDidChange(): Event<FoldingModelChangeEvent> { return this._updateEventEmitter.event; };
public get regions(): FoldingRegion[] { return this._regions; }
public get onDidChange(): Event<FoldingModelChangeEvent> { return this._updateEventEmitter.event; }
public get textModel() { return this._textModel; }
constructor(textModel: IModel, decorationProvider: IDecorationProvider) {
@ -198,7 +198,7 @@ export class FoldingModel {
let index = this._ranges.findRange(lineNumber);
if (index >= 0) {
return this._regions[index];
};
}
}
return null;
}

View file

@ -16,7 +16,7 @@ export class HiddenRangeModel {
private _foldingModelListener: IDisposable;
private _updateEventEmitter = new Emitter<IRange[]>();
public get onDidChange(): Event<IRange[]> { return this._updateEventEmitter.event; };
public get onDidChange(): Event<IRange[]> { return this._updateEventEmitter.event; }
public get hiddenRanges() { return this._hiddenRanges; }
public constructor(model: FoldingModel) {
@ -50,7 +50,7 @@ export class HiddenRangeModel {
updateHiddenAreas = true;
newHiddenAreas.push(new Range(range.startLineNumber + 1, 1, range.endLineNumber, 1));
}
};
}
if (updateHiddenAreas || i < this._hiddenRanges.length) {
this.applyHiddenRanges(newHiddenAreas);
}

View file

@ -40,7 +40,7 @@ suite('SnippetController', () => {
'\t',
'}'
];
};
}
withMockCodeEditor(lines, {}, (editor, cursor) => {
editor.getModel().updateOptions({

View file

@ -458,10 +458,10 @@ export class SimpleConfigurationService implements IConfigurationService {
return this._configuration;
}
getConfiguration<T>(): T
getConfiguration<T>(section: string): T
getConfiguration<T>(overrides: IConfigurationOverrides): T
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T
getConfiguration<T>(): T;
getConfiguration<T>(section: string): T;
getConfiguration<T>(overrides: IConfigurationOverrides): T;
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T;
getConfiguration(arg1?: any, arg2?: any): any {
const section = typeof arg1 === 'string' ? arg1 : void 0;
const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {};

View file

@ -29,7 +29,7 @@ export class MockCodeEditor extends CommonCodeEditor {
public focus(): void { }
public isFocused(): boolean { return this._isFocused; }
public hasWidgetFocus(): boolean { return true; };
public hasWidgetFocus(): boolean { return true; }
protected _enableEmptySelectionClipboard(): boolean { return false; }
protected _scheduleAtNextAnimationFrame(callback: () => void): IDisposable { throw new Error('Notimplemented'); }

View file

@ -153,7 +153,7 @@ export function addToValueTree(settingsTreeRoot: any, key: string, value: any, c
return;
}
curr = obj;
};
}
if (typeof curr === 'object') {
curr[last] = value; // workaround https://github.com/Microsoft/vscode/issues/13606

View file

@ -529,8 +529,8 @@ export class ConfigurationChangeEvent extends AbstractConfigurationChangeEvent i
return this._changedConfigurationByResource;
}
change(event: ConfigurationChangeEvent): ConfigurationChangeEvent
change(keys: string[], resource?: URI): ConfigurationChangeEvent
change(event: ConfigurationChangeEvent): ConfigurationChangeEvent;
change(keys: string[], resource?: URI): ConfigurationChangeEvent;
change(arg1: any, arg2?: any): ConfigurationChangeEvent {
if (arg1 instanceof ConfigurationChangeEvent) {
this._changedConfiguration = this._changedConfiguration.merge(arg1._changedConfiguration);

View file

@ -232,7 +232,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
if (subNodes) {
subNodes.forEach(register);
}
};
}
register(configuration);
}

View file

@ -56,10 +56,10 @@ export class ConfigurationService extends Disposable implements IConfigurationSe
return this.configuration.toData();
}
getConfiguration<T>(): T
getConfiguration<T>(section: string): T
getConfiguration<T>(overrides: IConfigurationOverrides): T
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T
getConfiguration<T>(): T;
getConfiguration<T>(section: string): T;
getConfiguration<T>(overrides: IConfigurationOverrides): T;
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T;
getConfiguration(arg1?: any, arg2?: any): any {
const section = typeof arg1 === 'string' ? arg1 : void 0;
const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {};
@ -70,10 +70,10 @@ export class ConfigurationService extends Disposable implements IConfigurationSe
return this.configuration.getValue(key, overrides, null);
}
updateValue(key: string, value: any): TPromise<void>
updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise<void>
updateValue(key: string, value: any, target: ConfigurationTarget): TPromise<void>
updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise<void>
updateValue(key: string, value: any): TPromise<void>;
updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise<void>;
updateValue(key: string, value: any, target: ConfigurationTarget): TPromise<void>;
updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise<void>;
updateValue(key: string, value: any, arg3?: any, arg4?: any): TPromise<void> {
return TPromise.wrapError(new Error('not supported'));
}

View file

@ -39,11 +39,11 @@ export class TestInstantiationService extends InstantiationService {
return <T>this._create(service, { mock: true });
}
public stub<T>(service?: ServiceIdentifier<T>, ctor?: any): T
public stub<T>(service?: ServiceIdentifier<T>, obj?: any): T
public stub<T>(service?: ServiceIdentifier<T>, ctor?: any, property?: string, value?: any): sinon.SinonStub
public stub<T>(service?: ServiceIdentifier<T>, obj?: any, property?: string, value?: any): sinon.SinonStub
public stub<T>(service?: ServiceIdentifier<T>, property?: string, value?: any): sinon.SinonStub
public stub<T>(service?: ServiceIdentifier<T>, ctor?: any): T;
public stub<T>(service?: ServiceIdentifier<T>, obj?: any): T;
public stub<T>(service?: ServiceIdentifier<T>, ctor?: any, property?: string, value?: any): sinon.SinonStub;
public stub<T>(service?: ServiceIdentifier<T>, obj?: any, property?: string, value?: any): sinon.SinonStub;
public stub<T>(service?: ServiceIdentifier<T>, property?: string, value?: any): sinon.SinonStub;
public stub<T>(serviceIdentifier?: ServiceIdentifier<T>, arg2?: any, arg3?: string, arg4?: any): sinon.SinonStub {
let service = typeof arg2 !== 'string' ? arg2 : void 0;
let serviceMock: IServiceMock<any> = { id: serviceIdentifier, service: service };
@ -70,9 +70,9 @@ export class TestInstantiationService extends InstantiationService {
return stubObject;
}
public stubPromise<T>(service?: ServiceIdentifier<T>, fnProperty?: string, value?: any): T | sinon.SinonStub
public stubPromise<T>(service?: ServiceIdentifier<T>, ctor?: any, fnProperty?: string, value?: any): sinon.SinonStub
public stubPromise<T>(service?: ServiceIdentifier<T>, obj?: any, fnProperty?: string, value?: any): sinon.SinonStub
public stubPromise<T>(service?: ServiceIdentifier<T>, fnProperty?: string, value?: any): T | sinon.SinonStub;
public stubPromise<T>(service?: ServiceIdentifier<T>, ctor?: any, fnProperty?: string, value?: any): sinon.SinonStub;
public stubPromise<T>(service?: ServiceIdentifier<T>, obj?: any, fnProperty?: string, value?: any): sinon.SinonStub;
public stubPromise<T>(arg1?: any, arg2?: any, arg3?: any, arg4?: any): sinon.SinonStub {
arg3 = typeof arg2 === 'string' ? TPromise.as(arg3) : arg3;
arg4 = typeof arg2 !== 'string' && typeof arg3 === 'string' ? TPromise.as(arg4) : arg4;
@ -85,8 +85,8 @@ export class TestInstantiationService extends InstantiationService {
return spy;
}
private _create<T>(serviceMock: IServiceMock<T>, options: SinonOptions, reset?: boolean): any
private _create<T>(ctor: any, options: SinonOptions): any
private _create<T>(serviceMock: IServiceMock<T>, options: SinonOptions, reset?: boolean): any;
private _create<T>(ctor: any, options: SinonOptions): any;
private _create<T>(arg1: any, options: SinonOptions, reset: boolean = false): any {
if (this.isServiceMock(arg1)) {
let service = this._getOrCreateService(arg1, options, reset);

View file

@ -133,7 +133,7 @@ export interface IQuickOpenStyleOverrides extends IListStyleOverrides, IInputBox
widgetShadow?: ColorIdentifier;
pickerGroupForeground?: ColorIdentifier;
pickerGroupBorder?: ColorIdentifier;
};
}
export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeService, style?: IQuickOpenStyleOverrides): IDisposable {
return attachStyler(themeService, {

View file

@ -63,7 +63,7 @@ export class UpdateChannelClient implements IUpdateService {
get onStateChange(): Event<State> { return this._onStateChange.event; }
private _state: State = State.Uninitialized;
get state(): State { return this._state; };
get state(): State { return this._state; }
constructor(private channel: IUpdateChannel) {
// always set this._state as the state changes

View file

@ -101,7 +101,7 @@ export class WindowsChannel implements IWindowsChannel {
}
return this.service.createAndEnterWorkspace(arg[0], folders, arg[2]);
};
}
case 'saveAndEnterWorkspace': return this.service.saveAndEnterWorkspace(arg[0], arg[1]);
case 'toggleFullScreen': return this.service.toggleFullScreen(arg);
case 'setRepresentedFilename': return this.service.setRepresentedFilename(arg[0], arg[1]);

View file

@ -34,7 +34,7 @@ export class WorkspacesChannel implements IWorkspacesChannel {
}
return this.service.createWorkspace(folders);
};
}
}
return void 0;

View file

@ -64,7 +64,7 @@ namespace delta {
}
});
return { removed, added };
};
}
export function ofMaps<K, V>(before: Map<K, V>, after: Map<K, V>): { removed: V[], added: V[] } {
const removed: V[] = [];
@ -80,7 +80,7 @@ namespace delta {
}
});
return { removed, added };
};
}
}
class EditorSnapshot {

View file

@ -574,7 +574,7 @@ export namespace IdObject {
}
export type IWorkspaceSymbol = IdObject & modes.SymbolInformation;
export interface IWorkspaceSymbols extends IdObject { symbols: IWorkspaceSymbol[]; };
export interface IWorkspaceSymbols extends IdObject { symbols: IWorkspaceSymbol[]; }
export interface ExtHostLanguageFeaturesShape {
$provideDocumentSymbols(handle: number, resource: URI): TPromise<modes.SymbolInformation[]>;

View file

@ -13,7 +13,7 @@ export class ExtHostCredentials implements ExtHostCredentialsShape {
constructor(mainContext: IMainContext) {
this._proxy = mainContext.get(MainContext.MainThreadCredentials);
};
}
readSecret(service: string, account: string): Thenable<string | undefined> {
return this._proxy.$readSecret(service, account);

View file

@ -431,7 +431,7 @@ export class ExtHostTask implements ExtHostTaskShape {
this._extHostWorkspace = extHostWorkspace;
this._handleCounter = 0;
this._handlers = new Map<number, HandlerData>();
};
}
public registerTaskProvider(extension: IExtensionDescription, provider: vscode.TaskProvider): vscode.Disposable {
if (!provider) {

View file

@ -410,7 +410,7 @@ export namespace Suggest {
return result;
}
};
}
export namespace ParameterInformation {
export function from(info: types.ParameterInformation): modes.ParameterInformation {

View file

@ -181,7 +181,7 @@ export class ActivitybarPart extends Part {
}
public getPinned(): string[] {
return this.viewletService.getViewlets().map(v => v.id).filter(id => this.compositeBar.isPinned(id));;
return this.viewletService.getViewlets().map(v => v.id).filter(id => this.compositeBar.isPinned(id));
}
/**

View file

@ -304,7 +304,7 @@ export interface IModel extends ITreeElement {
onDidChangeCallStack: Event<void>;
onDidChangeWatchExpressions: Event<IExpression>;
onDidChangeReplElements: Event<void>;
};
}
// Debug enums

View file

@ -63,7 +63,7 @@ const DEBUG_WATCH_EXPRESSIONS_KEY = 'debug.watchexpressions';
interface StartSessionResult {
status: 'ok' | 'initialConfiguration' | 'saveConfiguration';
content?: string;
};
}
export class DebugService implements debug.IDebugService {
public _serviceBrand: any;

View file

@ -11,7 +11,7 @@ import { ITerminalService, ITerminalInstance, ITerminalConfiguration } from 'vs/
import { ITerminalService as IExternalTerminalService } from 'vs/workbench/parts/execution/common/execution';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const enum ShellType { cmd, powershell, bash };
const enum ShellType { cmd, powershell, bash }
export class TerminalSupport {

View file

@ -165,7 +165,7 @@ export class Adapter {
}
return TPromise.as(content);
};
}
public getSchemaAttributes(): IJSONSchema[] {
if (!this.rawAdapter.configurationAttributes) {

View file

@ -140,7 +140,7 @@ function withVisibleExplorer(accessor: ServicesAccessor): TPromise<ExplorerViewl
}
return viewletService.openViewlet(VIEWLET_ID, false) as TPromise<ExplorerViewlet>;
};
}
export function withFocusedFilesExplorerViewItem(accessor: ServicesAccessor): TPromise<{ explorer: ExplorerViewlet, tree: ITree, item: FileStat }> {
return withFocusedFilesExplorer(accessor).then(res => {
@ -155,7 +155,7 @@ export function withFocusedFilesExplorerViewItem(accessor: ServicesAccessor): TP
return { explorer, tree, item: tree.getFocus() };
});
};
}
export function withFocusedFilesExplorer(accessor: ServicesAccessor): TPromise<{ explorer: ExplorerViewlet, tree: ITree }> {
return withVisibleExplorer(accessor).then(explorer => {
@ -172,7 +172,7 @@ export function withFocusedFilesExplorer(accessor: ServicesAccessor): TPromise<{
return { explorer, tree };
});
};
}
function withFocusedOpenEditorsViewItem(accessor: ServicesAccessor): TPromise<{ explorer: ExplorerViewlet, tree: ITree, item: OpenEditor }> {
return withVisibleExplorer(accessor).then(explorer => {
@ -190,7 +190,7 @@ function withFocusedOpenEditorsViewItem(accessor: ServicesAccessor): TPromise<{
return { explorer, tree, item: focus };
});
};
}
function withFocusedExplorerItem(accessor: ServicesAccessor): TPromise<FileStat | OpenEditor> {
return withFocusedFilesExplorerViewItem(accessor).then(res => {
@ -206,7 +206,7 @@ function withFocusedExplorerItem(accessor: ServicesAccessor): TPromise<FileStat
return void 0;
});
});
};
}
export const renameFocusedFilesExplorerViewItemCommand = (accessor: ServicesAccessor) => {
runActionOnFocusedFilesExplorerViewItem(accessor, 'renameFile');

View file

@ -25,7 +25,7 @@ export class WebviewFindWidget extends SimpleFindWidget {
if (this.webview !== null && val) {
this.webview.find(val, { findNext: true, forward: !previous });
}
};
}
public hide() {
super.hide();

View file

@ -432,7 +432,7 @@ class DefaultSettingsHeaderRenderer extends Disposable {
export class SettingsGroupTitleRenderer extends Disposable implements HiddenAreasProvider {
private _onHiddenAreasChanged: Emitter<void> = new Emitter<void>();
get onHiddenAreasChanged(): Event<void> { return this._onHiddenAreasChanged.event; };
get onHiddenAreasChanged(): Event<void> { return this._onHiddenAreasChanged.event; }
private settingsGroups: ISettingsGroup[];
private hiddenGroups: ISettingsGroup[] = [];

View file

@ -105,9 +105,9 @@ export class ReplaceService implements IReplaceService {
) {
}
public replace(match: Match): TPromise<any>
public replace(files: FileMatch[], progress?: IProgressRunner): TPromise<any>
public replace(match: FileMatchOrMatch, progress?: IProgressRunner, resource?: URI): TPromise<any>
public replace(match: Match): TPromise<any>;
public replace(files: FileMatch[], progress?: IProgressRunner): TPromise<any>;
public replace(match: FileMatchOrMatch, progress?: IProgressRunner, resource?: URI): TPromise<any>;
public replace(arg: any, progress: IProgressRunner = null, resource: URI = null): TPromise<any> {
let bulkEdit: BulkEdit = createBulkEdit(this.textModelResolverService, null, this.fileService);

View file

@ -518,10 +518,10 @@ export abstract class AbstractSearchAndReplaceAction extends Action {
let navigator: INavigator<any> = this.getNavigatorAt(element, viewer);
if (element instanceof FolderMatch) {
// If file match is removed then next element is the next file match
while (!!navigator.next() && !(navigator.current() instanceof FolderMatch)) { };
while (!!navigator.next() && !(navigator.current() instanceof FolderMatch)) { }
} else if (element instanceof FileMatch) {
// If file match is removed then next element is the next file match
while (!!navigator.next() && !(navigator.current() instanceof FileMatch)) { };
while (!!navigator.next() && !(navigator.current() instanceof FileMatch)) { }
} else {
navigator.next();
}

View file

@ -101,7 +101,7 @@ class TaskDefinitionRegistryImpl implements ITaskDefinitionRegistry {
this.taskTypes[type.taskType] = type;
}
}
};
}
} catch (error) {
}
resolve(undefined);

View file

@ -806,14 +806,14 @@ class TaskService extends EventEmitter implements ITaskService {
if (Task.matches(task, alias)) {
return task;
}
};
}
return undefined;
});
}
public tasks(): TPromise<Task[]> {
return this.getGroupedTasks().then(result => result.all());
};
}
public createSorter(): TaskSorter {
return new TaskSorter(this.contextService.getWorkspace() ? this.contextService.getWorkspace().folders : []);
@ -1124,7 +1124,7 @@ class TaskService extends EventEmitter implements ITaskService {
}
promise = this.writeConfiguration(workspaceFolder, 'tasks.tasks', fileConfig.tasks);
}
};
}
if (!promise) {
return TPromise.as(undefined);
}

View file

@ -152,7 +152,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let activeTerminal = this.activeTasks[Task.getMapKey(task)];
if (!activeTerminal) {
return TPromise.as<TaskTerminateResponse>({ success: false, task: undefined });
};
}
return new TPromise<TaskTerminateResponse>((resolve, reject) => {
let terminal = activeTerminal.terminal;
const onExit = terminal.onExit(() => {
@ -397,7 +397,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let waitOnExit: boolean | string = false;
if (task.command.presentation.reveal !== RevealKind.Never || !task.isBackground) {
waitOnExit = nls.localize('reuseTerminal', 'Terminal will be reused by tasks, press any key to close it.');
};
}
let shellLaunchConfig: IShellLaunchConfig = undefined;
let isShellCommand = task.command.runtime === RuntimeType.Shell;
if (isShellCommand) {

View file

@ -1649,7 +1649,7 @@ export interface IProblemReporter extends IProblemReporterBase {
}
class NullProblemReporter extends NullProblemReporterBase implements IProblemReporter {
clearOutput(): void { };
clearOutput(): void { }
}
class UUIDMap {

View file

@ -30,7 +30,7 @@ export class TerminalFindWidget extends SimpleFindWidget {
instance.findNext(val);
}
}
};
}
public hide() {
super.hide();

View file

@ -298,4 +298,4 @@ export class TerminalLinkHandler {
export interface LineColumnInfo {
lineNumber?: string;
columnNumber?: string;
};
}

View file

@ -27,7 +27,7 @@ import { IWindowService } from 'vs/platform/windows/common/windows';
export class TerminalService extends AbstractTerminalService implements ITerminalService {
private _configHelper: TerminalConfigHelper;
public get configHelper(): ITerminalConfigHelper { return this._configHelper; };
public get configHelper(): ITerminalConfigHelper { return this._configHelper; }
constructor(
@IContextKeyService _contextKeyService: IContextKeyService,

View file

@ -358,7 +358,7 @@ class WelcomePage {
this.updateInstalledExtensions(container, installedExtensions);
break;
}
};
}
}));
}

View file

@ -78,7 +78,7 @@ configurationExtPoint.setHandler(extensions => {
configuration.id = id;
configurations.push(configuration);
};
}
for (let extension of extensions) {
const value = <IConfigurationNode | IConfigurationNode[]>extension.value;

View file

@ -308,7 +308,7 @@ export class ConfigurationEditingService {
return nls.localize('errorInvalidConfigurationFolder', "Unable to write into folder settings. Please open **Folder Settings** file under **{0}** folder to correct errors/warnings in it and try again.", workspaceFolderName);
}
return '';
};
}
case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY: {
if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
return nls.localize('errorTasksConfigurationFileDirty', "Unable to write into tasks file because the file is dirty. Please save the **Tasks Configuration** file and try again.");
@ -326,7 +326,7 @@ export class ConfigurationEditingService {
return nls.localize('errorConfigurationFileDirtyFolder', "Unable to write into folder settings because the file is dirty. Please save the **Folder Settings** file under **{0}** folder and try again.", workspaceFolderName);
}
return '';
};
}
}
}

View file

@ -222,10 +222,10 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
return this._configuration.toData();
}
getConfiguration<T>(): T
getConfiguration<T>(section: string): T
getConfiguration<T>(overrides: IConfigurationOverrides): T
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T
getConfiguration<T>(): T;
getConfiguration<T>(section: string): T;
getConfiguration<T>(overrides: IConfigurationOverrides): T;
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T;
getConfiguration(arg1?: any, arg2?: any): any {
const section = typeof arg1 === 'string' ? arg1 : void 0;
const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : void 0;
@ -236,11 +236,11 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
return this._configuration.getValue(key, overrides);
}
updateValue(key: string, value: any): TPromise<void>
updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise<void>
updateValue(key: string, value: any, target: ConfigurationTarget): TPromise<void>
updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise<void>
updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget, donotNotifyError: boolean): TPromise<void>
updateValue(key: string, value: any): TPromise<void>;
updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise<void>;
updateValue(key: string, value: any, target: ConfigurationTarget): TPromise<void>;
updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): TPromise<void>;
updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget, donotNotifyError: boolean): TPromise<void>;
updateValue(key: string, value: any, arg3?: any, arg4?: any, donotNotifyError?: any): TPromise<void> {
assert.ok(this.configurationEditingService, 'Workbench is not initialized yet');
const overrides = isConfigurationOverrides(arg3) ? arg3 : void 0;

View file

@ -126,10 +126,10 @@ export class JSONEditingService implements IJSONEditingService {
// User issues
case JSONEditingErrorCode.ERROR_INVALID_FILE: {
return nls.localize('errorInvalidFile', "Unable to write into the file. Please open the file to correct errors/warnings in the file and try again.");
};
}
case JSONEditingErrorCode.ERROR_FILE_DIRTY: {
return nls.localize('errorFileDirty', "Unable to write into the file because the file is dirty. Please save the file and try again.");
};
}
}
}
}

View file

@ -201,7 +201,7 @@ class ExtensionManifestNLSReplacer extends ExtensionManifestHandler {
if (literal.hasOwnProperty(key)) {
processEntry(literal, key);
}
};
}
}
}

View file

@ -44,7 +44,7 @@ enum Path {
UNIX,
WINDOWS,
UNC
};
}
suite('Watcher', () => {

View file

@ -493,7 +493,7 @@ export class FileWalker {
if (self.isLimitHit) {
break;
}
};
}
}
matchDirectory(rootEntries);
}

View file

@ -412,5 +412,5 @@ export class WorkspaceStats {
this.reportRemotes(uris);
this.reportAzure(uris);
}
};
}
}

View file

@ -178,7 +178,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
}, err => {
if (err && err.code === 'ENOENT') {
return TPromise.as<string>(null); // ignore, user config file doesn't exist yet
};
}
return TPromise.wrapError<string>(err);
});
}
@ -346,7 +346,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
this.storageService.store(PERSISTED_THEME_STORAGE_KEY, newTheme.toStorageData());
return this.writeColorThemeConfiguration(settingsTarget);
};
}
private writeColorThemeConfiguration(settingsTarget: ConfigurationTarget): TPromise<IColorTheme> {
if (!types.isUndefinedOrNull(settingsTarget)) {
@ -588,7 +588,7 @@ function tokenGroupSettings(description: string) {
colorThemeSchema.tokenColorizationSettingSchema
]
};
};
}
configurationRegistry.registerConfiguration({
id: 'editor',

View file

@ -25,8 +25,8 @@ export class ViewletService implements IViewletService {
private extensionViewletsLoaded: TPromise<void>;
private extensionViewletsLoadedPromiseComplete: ValueCallback;
public get onDidViewletOpen(): Event<IViewlet> { return this.sidebarPart.onDidViewletOpen; };
public get onDidViewletClose(): Event<IViewlet> { return this.sidebarPart.onDidViewletClose; };
public get onDidViewletOpen(): Event<IViewlet> { return this.sidebarPart.onDidViewletOpen; }
public get onDidViewletClose(): Event<IViewlet> { return this.sidebarPart.onDidViewletClose; }
constructor(
sidebarPart: SidebarPart,

View file

@ -25,7 +25,7 @@ suite('ExtHostConfiguration', function () {
this.lastArgs = [target, key, value];
return TPromise.as(void 0);
}
};
}
function createExtHostConfiguration(contents: any = Object.create(null), shape?: MainThreadConfigurationShape) {
if (!shape) {

View file

@ -24,7 +24,7 @@ suite('ExtHostDiagnostics', () => {
$clear(owner: string): TPromise<any> {
return TPromise.as(null);
}
};
}
test('disposeCheck', function () {
@ -35,6 +35,7 @@ suite('ExtHostDiagnostics', () => {
assert.throws(() => collection.name);
assert.throws(() => collection.clear());
assert.throws(() => collection.delete(URI.parse('aa:bb')));
// tslint:disable-next-line:semicolon
assert.throws(() => collection.forEach(() => { ; }));
assert.throws(() => collection.get(URI.parse('aa:bb')));
assert.throws(() => collection.has(URI.parse('aa:bb')));

View file

@ -31,7 +31,7 @@ suite('ExtHostConfiguration', function () {
$refresh(viewId: string, itemHandles: number[]): void {
this.onRefresh.fire(itemHandles);
}
};
}
let testObject: ExtHostTreeViews;
let target: RecordingShape;

View file

@ -36,7 +36,7 @@ suite('MainThreadDocumentsAndEditors', () => {
modelService = new ModelServiceImpl(null, configService);
codeEditorService = new MockCodeEditorService();
textFileService = new class extends mock<ITextFileService>() {
isDirty() { return false; };
isDirty() { return false; }
models = <any>{
onModelSaved: Event.None,
onModelReverted: Event.None,

View file

@ -36,7 +36,7 @@ suite('MainThreadEditors', () => {
modelService = new ModelServiceImpl(null, configService);
const codeEditorService = new MockCodeEditorService();
const textFileService = new class extends mock<ITextFileService>() {
isDirty() { return false; };
isDirty() { return false; }
models = <any>{
onModelSaved: Event.None,
onModelReverted: Event.None,

View file

@ -178,7 +178,7 @@ class TestTelemetryService implements ITelemetryService {
machineId: 'someValue.machineId'
});
}
};
}
class TestExperimentService implements IExperimentService {

View file

@ -166,4 +166,4 @@ class TestTelemetryService implements ITelemetryService {
machineId: 'someValue.machineId'
});
}
};
}

View file

@ -880,7 +880,7 @@ export class TestBackupFileService implements IBackupFileService {
public discardAllWorkspaceBackups(): TPromise<void> {
return TPromise.as(void 0);
}
};
}
export class TestWindowService implements IWindowService {

View file

@ -9,7 +9,7 @@ import { SpectronApplication } from '../../spectron/application';
export enum ActivityBarPosition {
LEFT = 0,
RIGHT = 1
};
}
export class ActivityBar {

View file

@ -10,7 +10,7 @@ import { SpectronApplication } from '../../spectron/application';
export enum ActivityBarPosition {
LEFT = 0,
RIGHT = 1
};
}
const SEARCH_INPUT = '.settings-search-input input';
const EDITOR = '.editable-preferences-editor-container .monaco-editor textarea';

View file

@ -8,7 +8,7 @@ import { SpectronApplication } from '../../spectron/application';
export enum ProblemSeverity {
WARNING = 0,
ERROR = 1
};
}
export class Problems {

View file

@ -332,6 +332,6 @@ export class SpectronApplication {
return 'Meta';
default:
return key.length === 1 ? key : key.charAt(0).toUpperCase() + key.slice(1);
};
}
}
}