Skip to content

Commit

Permalink
Fix more Compiler Errors for TS 2.4 in the VSCode codebase (#29055)
Browse files Browse the repository at this point in the history
* Fix more Compiler Errors for TS 2.4 in the VSCode codebase

* Fix compile error for 2.3
  • Loading branch information
mjbvz authored Jun 20, 2017
1 parent 5b4f203 commit a460624
Show file tree
Hide file tree
Showing 16 changed files with 1,477 additions and 43 deletions.
1,431 changes: 1,431 additions & 0 deletions build/lib/watch/package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/vs/editor/standalone/browser/simpleServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,13 @@ export class SimpleResourceConfigurationService implements ITextResourceConfigur

_serviceBrand: any;

public readonly onDidUpdateConfiguration: Event<any>;
public readonly onDidUpdateConfiguration: Event<void>;
private readonly _onDidUpdateConfigurationEmitter = new Emitter();

constructor(private configurationService: SimpleConfigurationService) {
this.onDidUpdateConfiguration = this.configurationService.onDidUpdateConfiguration;
this.configurationService.onDidUpdateConfiguration(() => {
this._onDidUpdateConfigurationEmitter.fire();
});
}

public getConfiguration<T>(): T {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/platform/configuration/node/configurationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class ConfigurationService<T> extends Disposable implements IConfiguratio
return this._configuration.values();
}

public getConfigurationData(): IConfigurationData<T> {
public getConfigurationData<T2>(): IConfigurationData<T2> {
return this.configuration().toData();
}

Expand Down
10 changes: 5 additions & 5 deletions src/vs/workbench/parts/debug/electron-browser/debugViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { IHighlightEvent, ITree } from 'vs/base/parts/tree/browser/tree';
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
import { CollapsibleState, ViewSizing } from 'vs/base/browser/ui/splitview/splitview';
import { CollapseAction } from 'vs/workbench/browser/viewlet';
import { CollapsibleView, IViewletViewOptions } from 'vs/workbench/parts/views/browser/views';
import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views';
import { IDebugService, State, IBreakpoint, IExpression, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_WATCH_EXPRESSIONS_FOCUSED, CONTEXT_VARIABLES_FOCUSED } from 'vs/workbench/parts/debug/common/debug';
import { Expression, Variable, ExceptionBreakpoint, FunctionBreakpoint, Thread, StackFrame, Breakpoint, ThreadAndProcessIds } from 'vs/workbench/parts/debug/common/debugModel';
import * as viewer from 'vs/workbench/parts/debug/electron-browser/debugViewer';
Expand Down Expand Up @@ -60,7 +60,7 @@ export class VariablesView extends CollapsibleView {
@IListService private listService: IListService,
@IThemeService private themeService: IThemeService
) {
super({ ...options, sizing: ViewSizing.Flexible, ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), sizing: ViewSizing.Flexible, ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService);

this.settings = options.viewletSettings;
this.variablesFocusedContext = CONTEXT_VARIABLES_FOCUSED.bindTo(contextKeyService);
Expand Down Expand Up @@ -168,7 +168,7 @@ export class WatchExpressionsView extends CollapsibleView {
@IListService private listService: IListService,
@IThemeService private themeService: IThemeService
) {
super({ ...options, ariaHeaderLabel: nls.localize('expressionsSection', "Expressions Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('expressionsSection', "Expressions Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);
this.settings = options.viewletSettings;

this.toDispose.push(this.debugService.getModel().onDidChangeWatchExpressions(we => {
Expand Down Expand Up @@ -267,7 +267,7 @@ export class CallStackView extends CollapsibleView {
@IListService private listService: IListService,
@IThemeService private themeService: IThemeService
) {
super({ ...options, ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);
this.settings = options.viewletSettings;

// Create scheduler to prevent unnecessary flashing of tree when reacting to changes
Expand Down Expand Up @@ -402,7 +402,7 @@ export class BreakpointsView extends CollapsibleView {
@IThemeService private themeService: IThemeService
) {
super({
...options,
...(options as IViewOptions),
ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section"),
sizing: ViewSizing.Fixed, initialBodySize: BreakpointsView.getExpandedBodySize(
debugService.getModel().getBreakpoints().length + debugService.getModel().getFunctionBreakpoints().length + debugService.getModel().getExceptionBreakpoints().length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
return this.extensionService.installFromGallery(gallery, promptToInstallDependencies);
}

setEnablement(extension: IExtension, enable: boolean, workspace: boolean = false): TPromise<any> {
setEnablement(extension: IExtension, enable: boolean, workspace: boolean = false): TPromise<void> {
if (extension.type === LocalExtensionType.System) {
return TPromise.wrap(null);
return TPromise.wrap<void>(void 0);
}

return this.promptAndSetEnablement(extension, enable, workspace).then(reload => {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/parts/files/browser/views/emptyView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IAction } from 'vs/base/common/actions';
import { Button } from 'vs/base/browser/ui/button/button';
import { $ } from 'vs/base/browser/builder';
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { CollapsibleView, IViewletViewOptions } from 'vs/workbench/parts/views/browser/views';
import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/fileActions';
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
Expand All @@ -36,7 +36,7 @@ export class EmptyView extends CollapsibleView {
@IKeybindingService keybindingService: IKeybindingService,
@IContextMenuService contextMenuService: IContextMenuService
) {
super({ ...options, ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);
}

public renderHeader(container: HTMLElement): void {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/parts/files/browser/views/explorerView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import * as DOM from 'vs/base/browser/dom';
import { CollapseAction } from 'vs/workbench/browser/viewlet';
import { CollapsibleView, IViewletViewOptions } from 'vs/workbench/parts/views/browser/views';
import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views';
import { FileStat, Model } from 'vs/workbench/parts/files/common/explorerModel';
import { IListService } from 'vs/platform/list/browser/listService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
Expand Down Expand Up @@ -101,7 +101,7 @@ export class ExplorerView extends CollapsibleView {
@IWorkbenchThemeService private themeService: IWorkbenchThemeService,
@IEnvironmentService private environmentService: IEnvironmentService
) {
super({ ...options, ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService);

this.settings = options.viewletSettings;
this.viewletState = options.viewletState;
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/parts/files/browser/views/openEditorsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IEditorStacksModel, IStacksModelChangeEvent, IEditorGroup } from 'vs/workbench/common/editor';
import { SaveAllAction } from 'vs/workbench/parts/files/browser/fileActions';
import { CollapsibleView, IViewletViewOptions } from 'vs/workbench/parts/views/browser/views';
import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views';
import { IFilesConfiguration, VIEWLET_ID, OpenEditorsFocussedContext, ExplorerFocussedContext } from 'vs/workbench/parts/files/common/files';
import { ITextFileService, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
Expand Down Expand Up @@ -71,7 +71,7 @@ export class OpenEditorsView extends CollapsibleView {
@IThemeService private themeService: IThemeService
) {
super({
...options,
...(options as IViewOptions),
ariaHeaderLabel: nls.localize({ key: 'openEditosrSection', comment: ['Open is an adjective'] }, "Open Editors Section"),
sizing: ViewSizing.Fixed,
initialBodySize: OpenEditorsView.computeExpandedBodySize(editorGroupService.getStacksModel())
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/parts/tasks/common/taskConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ namespace ProblemMatcherConverter {
JSON.stringify(config, null, 4)));
return result;
} else if (kind === ProblemMatcherKind.String || kind === ProblemMatcherKind.ProblemMatcher) {
let matcher = resolveProblemMatcher(config, context);
let matcher = resolveProblemMatcher(config as ProblemMatcherConfig.ProblemMatcher, context);
if (matcher) {
result.push(matcher);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ class TaskService extends EventEmitter implements ITaskService {

public terminate(task: string | Task): TPromise<TaskTerminateResponse> {
if (!this._taskSystem) {
return TPromise.as({ success: true });
return TPromise.as({ success: true, task: undefined });
}
const id: string = Types.isString(task) ? task : task._id;
return this._taskSystem.terminate(id);
Expand Down Expand Up @@ -1138,7 +1138,7 @@ class TaskService extends EventEmitter implements ITaskService {
{
let { config, hasParseErrors } = this.getConfiguration();
if (hasParseErrors) {
return TPromise.as({ set: undefined, hasErrors: true });
return TPromise.as({ set: undefined, hasErrors: true, annotatingTasks: undefined });
}
let engine = TaskConfig.ExecutionEngine._default;
if (config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

import * as assert from 'assert';
import { IConfigurationService, getConfigurationValue } from 'vs/platform/configuration/common/configuration';
import { IConfigurationService, getConfigurationValue, IConfigurationValue, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration';
import { Platform } from 'vs/base/common/platform';
import { TPromise } from 'vs/base/common/winjs.base';
import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper';
Expand All @@ -18,7 +18,7 @@ class MockConfigurationService implements IConfigurationService {
public serviceId = IConfigurationService;
public constructor(private configuration: any = {}) { }
public reloadConfiguration<T>(section?: string): TPromise<T> { return TPromise.as(this.getConfiguration()); }
public lookup(key: string) { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), user: getConfigurationValue(this.getConfiguration(), key), workspace: void 0 }; }
public lookup<T>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<T> { return { value: getConfigurationValue<T>(this.getConfiguration(), key), default: getConfigurationValue<T>(this.getConfiguration(), key), user: getConfigurationValue<T>(this.getConfiguration(), key), workspace: void 0 }; }
public keys() { return { default: [], user: [], workspace: [] }; }
public values() { return {}; }
public getConfiguration(): any { return this.configuration; }
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/parts/views/browser/treeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ViewsRegistry } from 'vs/workbench/parts/views/browser/viewsRegistry';
import { ITreeViewDataProvider, ITreeItem, TreeItemCollapsibleState, TreeViewItemHandleArg } from 'vs/workbench/parts/views/common/views';
import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import { CollapsibleState, ViewSizing } from 'vs/base/browser/ui/splitview/splitview';
import { CollapsibleView, IViewletViewOptions } from 'vs/workbench/parts/views/browser/views';
import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views';
import { ICommandService } from 'vs/platform/commands/common/commands';

export class TreeView extends CollapsibleView {
Expand All @@ -55,7 +55,7 @@ export class TreeView extends CollapsibleView {
@IExtensionService private extensionService: IExtensionService,
@ICommandService private commandService: ICommandService
) {
super({ ...options, ariaHeaderLabel: options.name, sizing: ViewSizing.Flexible, collapsed: options.collapsed === void 0 ? true : options.collapsed }, keybindingService, contextMenuService);
super({ ...(options as IViewOptions), ariaHeaderLabel: options.name, sizing: ViewSizing.Flexible, collapsed: options.collapsed === void 0 ? true : options.collapsed }, keybindingService, contextMenuService);
this.menus = this.instantiationService.createInstance(Menus, this.id);
this.viewFocusContext = this.contextKeyService.createKey<boolean>(this.id, void 0);
this.menus.onDidChangeTitle(() => this.updateActions(), this, this.disposables);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import assert = require('assert');
import uri from 'vs/base/common/uri';
import platform = require('vs/base/common/platform');
import { TPromise } from 'vs/base/common/winjs.base';
import { IConfigurationService, getConfigurationValue } from 'vs/platform/configuration/common/configuration';
import { IConfigurationService, getConfigurationValue, IConfigurationOverrides, IConfigurationValue } from 'vs/platform/configuration/common/configuration';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/node/configurationResolverService';
Expand Down Expand Up @@ -340,7 +340,7 @@ class MockConfigurationService implements IConfigurationService {
public serviceId = IConfigurationService;
public constructor(private configuration: any = {}) { }
public reloadConfiguration<T>(section?: string): TPromise<T> { return TPromise.as(this.getConfiguration()); }
public lookup(key: string) { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), user: getConfigurationValue(this.getConfiguration(), key), workspace: void 0 }; }
public lookup<T>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<T> { return { value: getConfigurationValue<T>(this.getConfiguration(), key), default: getConfigurationValue<T>(this.getConfiguration(), key), user: getConfigurationValue<T>(this.getConfiguration(), key), workspace: void 0 }; }
public keys() { return { default: [], user: [], workspace: [] }; }
public values() { return {}; }
public getConfiguration(): any { return this.configuration; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ suite('WorkbenchEditorService', () => {
}
let ed = instantiationService.createInstance(MyEditor, 'my.editor');

let inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.from('my://resource'));
let inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.parse('my://resource'));
let delegate = instantiationService.createInstance(DelegatingWorkbenchEditorService);
delegate.setEditorOpenHandler((input, options?) => {
assert.strictEqual(input, inp);
Expand Down
Loading

0 comments on commit a460624

Please sign in to comment.