mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Revert isDetailsResolved and implement CompletionItemLabel
This commit is contained in:
@@ -989,7 +989,7 @@ export const enum ISuggestDataDtoField {
|
||||
}
|
||||
|
||||
export interface ISuggestDataDto {
|
||||
[ISuggestDataDtoField.label]: string;
|
||||
[ISuggestDataDtoField.label]: string | modes.CompletionItemLabel;
|
||||
[ISuggestDataDtoField.kind]: modes.CompletionItemKind;
|
||||
[ISuggestDataDtoField.detail]?: string;
|
||||
[ISuggestDataDtoField.documentation]?: string | IMarkdownString;
|
||||
@@ -1012,7 +1012,6 @@ export interface ISuggestResultDto {
|
||||
a: { insert: IRange, replace: IRange; };
|
||||
b: ISuggestDataDto[];
|
||||
c?: boolean;
|
||||
d?: boolean;
|
||||
}
|
||||
|
||||
export interface ISignatureHelpDto {
|
||||
|
||||
@@ -787,8 +787,7 @@ class SuggestAdapter {
|
||||
x: pid,
|
||||
b: [],
|
||||
a: { replace: typeConvert.Range.from(replaceRange), insert: typeConvert.Range.from(insertRange) },
|
||||
c: list.isIncomplete || undefined,
|
||||
d: list.isDetailsResolved || undefined
|
||||
c: list.isIncomplete || undefined
|
||||
};
|
||||
|
||||
for (let i = 0; i < list.items.length; i++) {
|
||||
@@ -858,7 +857,11 @@ class SuggestAdapter {
|
||||
}
|
||||
|
||||
private _convertCompletionItem(item: vscode.CompletionItem, position: vscode.Position, id: extHostProtocol.ChainedCacheId): extHostProtocol.ISuggestDataDto | undefined {
|
||||
if (typeof item.label !== 'string' || item.label.length === 0) {
|
||||
const label = typeof item.label === 'string'
|
||||
? item.label
|
||||
: item.label.label;
|
||||
|
||||
if (typeof label !== 'string' || label.length === 0) {
|
||||
this._logService.warn('INVALID text edit -> must have at least a label');
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -1351,10 +1351,17 @@ export enum CompletionItemTag {
|
||||
Deprecated = 1,
|
||||
}
|
||||
|
||||
export interface CompletionItemLabel {
|
||||
label: string;
|
||||
// description?: string;
|
||||
details?: string;
|
||||
}
|
||||
|
||||
|
||||
@es5ClassCompat
|
||||
export class CompletionItem implements vscode.CompletionItem {
|
||||
|
||||
label: string;
|
||||
label: string | CompletionItemLabel;
|
||||
kind?: CompletionItemKind;
|
||||
tags?: CompletionItemTag[];
|
||||
detail?: string;
|
||||
@@ -1371,7 +1378,7 @@ export class CompletionItem implements vscode.CompletionItem {
|
||||
additionalTextEdits?: TextEdit[];
|
||||
command?: vscode.Command;
|
||||
|
||||
constructor(label: string, kind?: CompletionItemKind) {
|
||||
constructor(label: string | CompletionItemLabel, kind?: CompletionItemKind) {
|
||||
this.label = label;
|
||||
this.kind = kind;
|
||||
}
|
||||
@@ -1395,7 +1402,6 @@ export class CompletionItem implements vscode.CompletionItem {
|
||||
export class CompletionList {
|
||||
|
||||
isIncomplete?: boolean;
|
||||
isDetailsResolved?: boolean;
|
||||
items: vscode.CompletionItem[];
|
||||
|
||||
constructor(items: vscode.CompletionItem[] = [], isIncomplete: boolean = false) {
|
||||
|
||||
Reference in New Issue
Block a user