diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index eee70e82684106f9cebf30e9db740f9fb31e73f5..277ab50bb88d962f1e4ed01b77ddfa0b7037ee94 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -8,14 +8,6 @@ import { CharCode } from 'vs/base/common/charCode'; import { Iterator, IteratorResult, FIN } from './iterator'; -export function fromArray(array: readonly T[]): Set { - const result = new Set(); - for (const element of array) { - result.add(element); - } - return result; -} - export function values(set: Set): V[]; export function values(map: Map): V[]; export function values(forEachable: { forEach(callback: (value: V, ...more: any[]) => any): void }): V[] { diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 9bf53989111b64636be2a196500ffd96f637ee7d..b5428b8840339fd7255b3894cbbfbadedb1123a1 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -404,7 +404,7 @@ export interface CompletionItem { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindTags?: Set; + kindTags?: ReadonlyArray; /** * A human-readable string with additional information * about this item, like type or symbol information. @@ -913,7 +913,7 @@ export interface DocumentSymbol { name: string; detail: string; kind: SymbolKind; - kindTags: SymbolKindTag[]; + kindTags: ReadonlyArray; containerName?: string; range: IRange; selectionRange: IRange; diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index cb0260ecc609aa04f6bbd4409f1b727aa98afbce..8a0c10b205c4b94443d6604874580328e849ea4b 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -193,7 +193,7 @@ class Renderer implements IListRenderer ]; } - if (suggestion.kindTags && suggestion.kindTags.has(CompletionItemKindTag.Deprecated)) { + if (suggestion.kindTags && suggestion.kindTags.indexOf(CompletionItemKindTag.Deprecated) >= 0) { labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']); labelOptions.matches = []; } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 79c36b8b67e426f824e3a1962dd13e54f00ab955..b55c54c2aa4d9e1192bd8dcd2c4a2fecb5a7b78e 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4822,7 +4822,7 @@ declare namespace monaco.languages { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindTags?: Set; + kindTags?: ReadonlyArray; /** * A human-readable string with additional information * about this item, like type or symbol information. @@ -5240,7 +5240,7 @@ declare namespace monaco.languages { name: string; detail: string; kind: SymbolKind; - kindTags: SymbolKindTag[]; + kindTags: ReadonlyArray; containerName?: string; range: IRange; selectionRange: IRange; diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index cbc61e52916a450910ff016972fef6d56cb94df0..d9c397890d062f100c4476dc3d70d92af05afe57 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -21,7 +21,6 @@ import { Selection } from 'vs/editor/common/core/selection'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import * as callh from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; import { mixin } from 'vs/base/common/objects'; -import { fromArray } from 'vs/base/common/map'; @extHostNamedCustomer(MainContext.MainThreadLanguageFeatures) export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesShape { @@ -331,7 +330,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return { label: data.a, kind: data.b, - kindTags: data.n && fromArray(data.n), + kindTags: data.n, detail: data.c, documentation: data.d, sortText: data.e,