Skip to content

Commit

Permalink
CompletionItemKindModifier -> CompletionItemKindTag, #23927
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Aug 23, 2019
1 parent ce32c3a commit 8b0bc47
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/vs/editor/common/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export let completionKindFromString: {
};
})();

export const enum CompletionItemKindModifier {
export const enum CompletionItemKindTag {
Deprecated = 1
}

Expand Down Expand Up @@ -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
*/
kindModifier?: Set<CompletionItemKindModifier>;
kindTags?: Set<CompletionItemKindTag>;
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/standalone/standaloneEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ export enum CompletionItemKind {
Snippet = 25
}

export enum CompletionItemKindModifier {
export enum CompletionItemKindTag {
Deprecated = 1
}

Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/suggest/suggestWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { TimeoutTimer, CancelablePromise, createCancelablePromise, disposableTimeout } from 'vs/base/common/async';
import { CompletionItemKind, completionKindToCssClass, CompletionItemKindModifier } from 'vs/editor/common/modes';
import { CompletionItemKind, completionKindToCssClass, CompletionItemKindTag } from 'vs/editor/common/modes';
import { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
import { IModelService } from 'vs/editor/common/services/modelService';
Expand Down Expand Up @@ -193,7 +193,7 @@ class Renderer implements IListRenderer<CompletionItem, ISuggestionTemplateData>
];
}

if (suggestion.kindModifier && suggestion.kindModifier.has(CompletionItemKindModifier.Deprecated)) {
if (suggestion.kindTags && suggestion.kindTags.has(CompletionItemKindTag.Deprecated)) {
labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']);
labelOptions.matches = [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/standalone/browser/standaloneLanguages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages {
// enums
DocumentHighlightKind: standaloneEnums.DocumentHighlightKind,
CompletionItemKind: standaloneEnums.CompletionItemKind,
CompletionItemKindModifier: standaloneEnums.CompletionItemKindModifier,
CompletionItemKindTag: standaloneEnums.CompletionItemKindTag,
CompletionItemInsertTextRule: standaloneEnums.CompletionItemInsertTextRule,
SymbolKind: standaloneEnums.SymbolKind,
SymbolKindTag: standaloneEnums.SymbolKindTag,
Expand Down
4 changes: 2 additions & 2 deletions src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4786,7 +4786,7 @@ declare namespace monaco.languages {
Snippet = 25
}

export enum CompletionItemKindModifier {
export enum CompletionItemKindTag {
Deprecated = 1
}

Expand Down Expand Up @@ -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
*/
kindModifier?: Set<CompletionItemKindModifier>;
kindTags?: Set<CompletionItemKindTag>;
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
Expand Down
6 changes: 3 additions & 3 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,9 @@ declare module 'vscode' {

//#endregion

//#region Joh - CompletionItemKindModifier, https://github.com/microsoft/vscode/issues/23927
//#region Joh - CompletionItemKindTag, https://github.com/microsoft/vscode/issues/23927

export enum CompletionItemKindModifier {
export enum CompletionItemKindTag {
Deprecated = 1
}

Expand All @@ -1149,7 +1149,7 @@ declare module 'vscode' {
/**
*
*/
kind2?: CompletionItemKind | { base: CompletionItemKind, modifier: ReadonlyArray<CompletionItemKindModifier> };
kind2?: CompletionItemKind | { kind: CompletionItemKind, tags: ReadonlyArray<CompletionItemKindTag> };
}

//#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
return {
label: data.a,
kind: data.b,
kindModifier: data.n && fromArray(data.n),
kindTags: data.n && fromArray(data.n),
detail: data.c,
documentation: data.d,
sortText: data.e,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
CommentMode: extHostTypes.CommentMode,
CompletionItem: extHostTypes.CompletionItem,
CompletionItemKind: extHostTypes.CompletionItemKind,
CompletionItemKindModifier: extHostTypes.CompletionItemKindModifier,
CompletionItemKindTag: extHostTypes.CompletionItemKindTag,
CompletionList: extHostTypes.CompletionList,
CompletionTriggerKind: extHostTypes.CompletionTriggerKind,
ConfigurationTarget: extHostTypes.ConfigurationTarget,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/common/extHost.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ export interface ISuggestDataDto {
k/* commitCharacters */?: string[];
l/* additionalTextEdits */?: ISingleEditOperation[];
m/* command */?: modes.Command;
n/* kindModifier */?: modes.CompletionItemKindModifier[];
n/* kindModifier */?: modes.CompletionItemKindTag[];
// not-standard
x?: ChainedCacheId;
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHostLanguageFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ class SuggestAdapter {

// kind2
if (typeof item.kind2 === 'object') {
result.b = typeConvert.CompletionItemKind.from(item.kind2.base);
result.n = item.kind2.modifier.map(typeConvert.CompletionItemKindModifier.from);
result.b = typeConvert.CompletionItemKind.from(item.kind2.kind);
result.n = item.kind2.tags.map(typeConvert.CompletionItemKindTag.from);
}

// 'insertText'-logic
Expand Down
10 changes: 5 additions & 5 deletions src/vs/workbench/api/common/extHostTypeConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,17 +682,17 @@ export namespace CompletionContext {
}
}

export namespace CompletionItemKindModifier {
export namespace CompletionItemKindTag {

export function from(kind: types.CompletionItemKindModifier): modes.CompletionItemKindModifier {
export function from(kind: types.CompletionItemKindTag): modes.CompletionItemKindTag {
switch (kind) {
case types.CompletionItemKindModifier.Deprecated: return modes.CompletionItemKindModifier.Deprecated;
case types.CompletionItemKindTag.Deprecated: return modes.CompletionItemKindTag.Deprecated;
}
}

export function to(kind: modes.CompletionItemKindModifier): types.CompletionItemKindModifier {
export function to(kind: modes.CompletionItemKindTag): types.CompletionItemKindTag {
switch (kind) {
case modes.CompletionItemKindModifier.Deprecated: return types.CompletionItemKindModifier.Deprecated;
case modes.CompletionItemKindTag.Deprecated: return types.CompletionItemKindTag.Deprecated;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHostTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ export enum CompletionItemKind {
TypeParameter = 24
}

export enum CompletionItemKindModifier {
export enum CompletionItemKindTag {
Deprecated = 1,
}

Expand All @@ -1317,7 +1317,7 @@ export class CompletionItem implements vscode.CompletionItem {

label: string;
kind?: CompletionItemKind;
kind2?: CompletionItemKind | { base: CompletionItemKind, modifier: CompletionItemKindModifier[] };
kind2?: CompletionItemKind | { kind: CompletionItemKind, tags: CompletionItemKindTag[] };
detail?: string;
documentation?: string | MarkdownString;
sortText?: string;
Expand Down

0 comments on commit 8b0bc47

Please sign in to comment.