@@ -2240,41 +2240,28 @@ fn try_restore_indent(doc: &mut Document, view: &mut View) {
22402240 }
22412241}
22422242
2243+ // NOTE: When you implement a new completion source/handler, dont forget to add
2244+ // your completion kinds here!
2245+ #[ rustfmt:: skip]
2246+ const ALL_KINDS : & [ & str ] = & [
2247+ // All of these are LSP item kinds.
2248+ // It happens that file and folder are also here.
2249+ "text" , "method" , "function" , "constructor" , "field" , "variable" ,
2250+ "class" , "interface" , "module" , "property" , "unit" , "value" , "enum" ,
2251+ "keyword" , "snippet" , "color" , "file" , "reference" , "folder" ,
2252+ "enum-member" , "constant" , "struct" , "event" , "operator" ,
2253+ "type-parameter" ,
2254+ // The following are specific to path completion source
2255+ // We ignore the other linux-specific ones (block, socket, etc...)
2256+ "link"
2257+ ] ;
2258+
22432259fn compute_completion_item_kind_styles (
22442260 theme : & Theme ,
22452261 config : & DynGuard < Config > ,
22462262) -> HashMap < & ' static str , CompletionItemKindStyle > {
22472263 let mut ret = HashMap :: new ( ) ;
2248- // We populate with LSP kinds and additionally file+folder for path completion
2249- for name in [
2250- "text" ,
2251- "method" ,
2252- "function" ,
2253- "constructor" ,
2254- "field" ,
2255- "variable" ,
2256- "class" ,
2257- "interface" ,
2258- "module" ,
2259- "property" ,
2260- "unit" ,
2261- "value" ,
2262- "enum" ,
2263- "keyword" ,
2264- "snippet" ,
2265- "color" ,
2266- "file" ,
2267- "reference" ,
2268- "folder" ,
2269- "enum-member" ,
2270- "constant" ,
2271- "struct" ,
2272- "event" ,
2273- "operator" ,
2274- "type-parameter" ,
2275- "file" ,
2276- "folder" ,
2277- ] {
2264+ for & name in ALL_KINDS {
22782265 let style = theme. try_get ( & format ! ( "ui.completion.kind.{name}" ) ) ;
22792266 let text = config. completion_item_kinds . get ( name) . cloned ( ) ;
22802267 if style. is_some ( ) || text. is_some ( ) {
0 commit comments