@@ -79,20 +79,13 @@ is identical to the `contents`:
79
79
80
80
``` json
81
81
{ "trigger" : " foo" , "contents" : " foobar" },
82
- { "trigger" : " foo\t test" , "contents" : " foobar" }
83
82
```
84
83
85
84
** trigger**
86
85
: Text that will be displayed in the completions list
87
86
and will cause the ` contents `
88
87
to be inserted when chosen.
89
88
90
- You can use a ` \t ` tab character
91
- to add an * annotation* for the preceding trigger.
92
- The annotation will be displayed right-aligned,
93
- slightly grayed
94
- and does not affect the trigger itself.
95
-
96
89
** contents**
97
90
: Text to be inserted in the buffer.
98
91
Supports the same string interpolation features
@@ -108,3 +101,36 @@ you have to escape it like this: `\\$`
108
101
(double backslashes are needed
109
102
because we are within a JSON string).
110
103
:::
104
+
105
+
106
+ ## Completions Metadata
107
+
108
+ ``` json
109
+ {
110
+ "trigger" : " func" ,
111
+ "contents" : " funcbar" ,
112
+ "annotation" : " string" ,
113
+ "kind" : " function" ,
114
+ "details" : " A short description of what this string function does."
115
+ }
116
+
117
+ { "trigger" : " func\t string" , "contents" : " funcbar" }
118
+ ```
119
+
120
+ ::: info Added in build 4050.
121
+ These do not affect the triggers themselves,
122
+ but allow for customization of the appearance of completions in the completions list.
123
+ :::
124
+
125
+ ** kind**
126
+ : Allows for categorization of the completion via a colored
127
+ kind letter to the left of the entry in the completions list.
128
+ Colors are determined by the user's color scheme.
129
+
130
+ ** annotation**
131
+ : Displays as right-aligned gray text to the right of the entry in the completions list.
132
+ Does not affect the trigger itself.
133
+ Annotations can also be defined using a tab character ` \t ` in ` trigger ` .
134
+
135
+ ** details**
136
+ : Displays at the bottom of the completions list when the entry is highlighted.
0 commit comments