diff --git a/src/jsonSchema.ts b/src/jsonSchema.ts index 5640ba7..adda0a3 100644 --- a/src/jsonSchema.ts +++ b/src/jsonSchema.ts @@ -85,6 +85,7 @@ export interface JSONSchema { suggestSortText?: string; // VSCode extension allowComments?: boolean; // VSCode extension allowTrailingCommas?: boolean; // VSCode extension + completionDetail?: string; // VSCode extension } export interface JSONSchemaMap { diff --git a/src/services/jsonCompletion.ts b/src/services/jsonCompletion.ts index fe42793..dfe17b6 100644 --- a/src/services/jsonCompletion.ts +++ b/src/services/jsonCompletion.ts @@ -237,8 +237,11 @@ export class JSONCompletion { insertText: this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter), insertTextFormat: InsertTextFormat.Snippet, filterText: this.getFilterTextForValue(key), - documentation: this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '', + documentation: this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '' }; + if (propertySchema.completionDetail !== undefined) { + proposal.detail = propertySchema.completionDetail; + } if (propertySchema.suggestSortText !== undefined) { proposal.sortText = propertySchema.suggestSortText; } @@ -261,8 +264,11 @@ export class JSONCompletion { insertText: this.getInsertTextForProperty(name, undefined, addValue, separatorAfter), insertTextFormat: InsertTextFormat.Snippet, filterText: this.getFilterTextForValue(name), - documentation: enumDescription || this.fromMarkup(schemaPropertyNames.markdownDescription) || schemaPropertyNames.description || '', + documentation: enumDescription || this.fromMarkup(schemaPropertyNames.markdownDescription) || schemaPropertyNames.description || '' }; + if (schemaPropertyNames.completionDetail !== undefined) { + proposal.detail = schemaPropertyNames.completionDetail; + } if (schemaPropertyNames.suggestSortText !== undefined) { proposal.sortText = schemaPropertyNames.suggestSortText; }