mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 10:40:41 +00:00
This commit is contained in:
parent
0681925277
commit
f922e8b757
|
@ -16,6 +16,7 @@
|
|||
},
|
||||
"lib": [
|
||||
"ES2015",
|
||||
"ES2016.Array.Include",
|
||||
"ES2017.String",
|
||||
"ES2018.Promise",
|
||||
"DOM",
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"include": [
|
||||
"typings/require.d.ts",
|
||||
"typings/thenable.d.ts",
|
||||
"typings/lib.array-ext.d.ts",
|
||||
"vs/css.d.ts",
|
||||
"vs/monaco.d.ts",
|
||||
"vs/nls.d.ts",
|
||||
|
|
11
src/typings/lib.array-ext.d.ts
vendored
11
src/typings/lib.array-ext.d.ts
vendored
|
@ -1,11 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
interface ArrayConstructor {
|
||||
isArray<T>(arg: ReadonlyArray<T> | null | undefined): arg is ReadonlyArray<T>;
|
||||
isArray<T>(arg: Array<T> | null | undefined): arg is Array<T>;
|
||||
isArray(arg: any): arg is Array<any>;
|
||||
isArray<T>(arg: any): arg is Array<T>;
|
||||
}
|
|
@ -110,11 +110,11 @@ function fillInActions(groups: ReadonlyArray<[string, ReadonlyArray<MenuItemActi
|
|||
}
|
||||
|
||||
if (isPrimaryGroup(group)) {
|
||||
const to = Array.isArray<IAction>(target) ? target : target.primary;
|
||||
const to = Array.isArray(target) ? target : target.primary;
|
||||
|
||||
to.unshift(...actions);
|
||||
} else {
|
||||
const to = Array.isArray<IAction>(target) ? target : target.secondary;
|
||||
const to = Array.isArray(target) ? target : target.secondary;
|
||||
|
||||
if (to.length > 0) {
|
||||
to.push(new Separator());
|
||||
|
|
|
@ -1120,7 +1120,7 @@ class ColorProviderAdapter {
|
|||
provideColors(resource: URI, token: CancellationToken): Promise<extHostProtocol.IRawColorInfo[]> {
|
||||
const doc = this._documents.getDocument(resource);
|
||||
return asPromise(() => this._provider.provideDocumentColors(doc, token)).then(colors => {
|
||||
if (!Array.isArray<vscode.ColorInformation>(colors)) {
|
||||
if (!Array.isArray(colors)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
@ -535,11 +535,11 @@ function fillInActions(groups: [string, Array<MenuItemAction | SubmenuItemAction
|
|||
}
|
||||
|
||||
if (isPrimaryGroup(group)) {
|
||||
const to = Array.isArray<IAction>(target) ? target : target.primary;
|
||||
const to = Array.isArray(target) ? target : target.primary;
|
||||
|
||||
to.unshift(...actions);
|
||||
} else {
|
||||
const to = Array.isArray<IAction>(target) ? target : target.secondary;
|
||||
const to = Array.isArray(target) ? target : target.secondary;
|
||||
|
||||
if (to.length > 0) {
|
||||
to.push(new Separator());
|
||||
|
|
|
@ -296,7 +296,7 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
|
|||
|
||||
private getCachedRecommendations(): IStringDictionary<number> {
|
||||
let storedRecommendations = JSON.parse(this.storageService.get(recommendationsStorageKey, StorageScope.GLOBAL, '[]'));
|
||||
if (Array.isArray<string>(storedRecommendations)) {
|
||||
if (Array.isArray(storedRecommendations)) {
|
||||
storedRecommendations = storedRecommendations.reduce((result, id) => { result[id] = Date.now(); return result; }, <IStringDictionary<number>>{});
|
||||
}
|
||||
const result: IStringDictionary<number> = {};
|
||||
|
|
|
@ -45,7 +45,7 @@ function fillInActions(groups: ReadonlyArray<[string, ReadonlyArray<MenuItemActi
|
|||
|
||||
const isPrimary = isPrimaryGroup(group);
|
||||
if (isPrimary) {
|
||||
const to = Array.isArray<IAction>(target) ? target : target.primary;
|
||||
const to = Array.isArray(target) ? target : target.primary;
|
||||
|
||||
if (to.length > 0) {
|
||||
to.push(new VerticalSeparator());
|
||||
|
@ -55,7 +55,7 @@ function fillInActions(groups: ReadonlyArray<[string, ReadonlyArray<MenuItemActi
|
|||
}
|
||||
|
||||
if (!isPrimary || alwaysFillSecondary) {
|
||||
const to = Array.isArray<IAction>(target) ? target : target.secondary;
|
||||
const to = Array.isArray(target) ? target : target.secondary;
|
||||
|
||||
if (to.length > 0) {
|
||||
to.push(new Separator());
|
||||
|
|
Loading…
Reference in a new issue