Fix more TS 2.4 Errors in VS Code codebase (#28144)
This commit is contained in:
parent
bc72c64573
commit
dd9ebe1d6e
9 changed files with 13 additions and 12 deletions
|
@ -436,7 +436,8 @@ export function parse(arg1: string | IExpression, options: IGlobOptions = {}): a
|
|||
export function parseToAsync(expression: IExpression, options?: IGlobOptions): ParsedExpression {
|
||||
const parsedExpression = parse(expression, options);
|
||||
return (path: string, basename?: string, siblingsFn?: () => TPromise<string[]>): TPromise<string> => {
|
||||
return TPromise.as(parsedExpression(path, basename, siblingsFn));
|
||||
const result = parsedExpression(path, basename, siblingsFn);
|
||||
return typeof result === 'string' ? TPromise.as(result) : result;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
|
|||
import { asWinJsPromise } from 'vs/base/common/async';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
|
||||
function outputResults(promises: TPromise<Location[]>[]) {
|
||||
function outputResults(promises: TPromise<Location | Location[]>[]) {
|
||||
return TPromise.join(promises).then(allReferences => {
|
||||
let result: Location[] = [];
|
||||
for (let references of allReferences) {
|
||||
|
|
|
@ -38,7 +38,7 @@ export function rename(model: IReadOnlyModel, position: Position, newName: strin
|
|||
let hasResult = false;
|
||||
|
||||
const factory = supports.map(support => {
|
||||
return () => {
|
||||
return (): TPromise<WorkspaceEdit> => {
|
||||
if (!hasResult) {
|
||||
return asWinJsPromise((token) => {
|
||||
return support.provideRenameEdits(model, position, newName, token);
|
||||
|
|
|
@ -32,7 +32,7 @@ export function getOccurrencesAtPosition(model: editorCommon.IReadOnlyModel, pos
|
|||
// until someone response with a good result
|
||||
// (good = none empty array)
|
||||
return sequence(orderedByScore.map(provider => {
|
||||
return () => {
|
||||
return (): TPromise<DocumentHighlight[]> => {
|
||||
if (!foundResult) {
|
||||
return asWinJsPromise((token) => {
|
||||
return provider.provideDocumentHighlights(model, position, token);
|
||||
|
|
|
@ -44,8 +44,8 @@ export class UpdateService implements IUpdateService {
|
|||
private _onUpdateNotAvailable = new Emitter<boolean>();
|
||||
get onUpdateNotAvailable(): Event<boolean> { return this._onUpdateNotAvailable.event; }
|
||||
|
||||
private _onUpdateReady = new Emitter<IUpdate>();
|
||||
get onUpdateReady(): Event<IUpdate> { return this._onUpdateReady.event; }
|
||||
private _onUpdateReady = new Emitter<IRawUpdate>();
|
||||
get onUpdateReady(): Event<IRawUpdate> { return this._onUpdateReady.event; }
|
||||
|
||||
private _onStateChange = new Emitter<State>();
|
||||
get onStateChange(): Event<State> { return this._onStateChange.event; }
|
||||
|
@ -180,7 +180,7 @@ export class UpdateService implements IUpdateService {
|
|||
this.telemetryService.publicLog('update:available', { explicit, version: update.version, currentVersion: product.commit });
|
||||
|
||||
} else {
|
||||
const data: IUpdate = {
|
||||
const data: IRawUpdate = {
|
||||
releaseNotes: update.releaseNotes,
|
||||
version: update.version,
|
||||
date: update.date
|
||||
|
|
|
@ -40,8 +40,8 @@ type TreeItemHandle = number;
|
|||
|
||||
class TreeViewDataProvider implements ITreeViewDataProvider {
|
||||
|
||||
private _onDidChange: Emitter<ITreeItem | undefined | void> = new Emitter<ITreeItem | undefined | void>();
|
||||
readonly onDidChange: Event<ITreeItem | undefined | void> = this._onDidChange.event;
|
||||
private _onDidChange: Emitter<ITreeItem | undefined | null> = new Emitter<ITreeItem | undefined | null>();
|
||||
readonly onDidChange: Event<ITreeItem | undefined | null> = this._onDidChange.event;
|
||||
|
||||
private childrenMap: Map<TreeItemHandle, TreeItemHandle[]> = new Map<TreeItemHandle, TreeItemHandle[]>();
|
||||
private itemsMap: Map<TreeItemHandle, ITreeItem> = new Map<TreeItemHandle, ITreeItem>();
|
||||
|
|
|
@ -22,7 +22,7 @@ export interface ISnippetsService {
|
|||
|
||||
registerSnippets(languageId: LanguageId, snippets: ISnippet[], owner: string): void;
|
||||
|
||||
visitSnippets(languageId: LanguageId, accept: (snippet: ISnippet) => void): void;
|
||||
visitSnippets(languageId: LanguageId, accept: (snippet: ISnippet) => boolean): void;
|
||||
|
||||
getSnippets(languageId: LanguageId): ISnippet[];
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
|
|||
}
|
||||
|
||||
if (task.command) {
|
||||
return TPromise.join(promises).then((summaries): ITaskSummary => {
|
||||
return TPromise.join(promises).then((summaries): TPromise<ITaskSummary> | ITaskSummary => {
|
||||
for (let summary of summaries) {
|
||||
if (summary.exitCode !== 0) {
|
||||
return { exitCode: summary.exitCode };
|
||||
|
|
|
@ -178,7 +178,7 @@ export class TerminalService extends AbstractTerminalService implements ITermina
|
|||
}
|
||||
return this._validateShellPaths(label, potentialPaths);
|
||||
}
|
||||
return [label, current];
|
||||
return [label, current] as [string, string];
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue