@@ -62,17 +62,12 @@ impl LanguageServer {
6262 suggestion : SemanticSuggestion ,
6363 range : Range ,
6464 ) -> CompletionItem {
65- let decl_id = suggestion. kind . as_ref ( ) . and_then ( |kind| {
66- matches ! ( kind, SuggestionKind :: Command ( _) )
67- . then_some ( engine_state. find_decl ( suggestion. suggestion . value . as_bytes ( ) , & [ ] ) ?)
68- } ) ;
69-
7065 let mut snippet_text = suggestion. suggestion . value . clone ( ) ;
7166 let mut doc_string = suggestion. suggestion . extra . map ( |ex| ex. join ( "\n " ) ) ;
7267 let mut insert_text_format = None ;
7368 let mut idx = 0 ;
7469 // use snippet as `insert_text_format` for command argument completion
75- if let Some ( decl_id) = decl_id {
70+ if let Some ( SuggestionKind :: Command ( _ , Some ( decl_id) ) ) = suggestion . kind {
7671 let cmd = engine_state. get_decl ( decl_id) ;
7772 doc_string = Some ( Self :: get_decl_description ( cmd, true ) ) ;
7873 insert_text_format = Some ( InsertTextFormat :: SNIPPET ) ;
@@ -138,7 +133,7 @@ impl LanguageServer {
138133 . as_ref ( )
139134 . map ( |kind| match kind {
140135 SuggestionKind :: Value ( t) => t. to_string ( ) ,
141- SuggestionKind :: Command ( cmd) => cmd. to_string ( ) ,
136+ SuggestionKind :: Command ( cmd, _ ) => cmd. to_string ( ) ,
142137 SuggestionKind :: Module => "module" . to_string ( ) ,
143138 SuggestionKind :: Operator => "operator" . to_string ( ) ,
144139 SuggestionKind :: Variable => "variable" . to_string ( ) ,
@@ -172,7 +167,7 @@ impl LanguageServer {
172167 _ => None ,
173168 } ,
174169 SuggestionKind :: CellPath => Some ( CompletionItemKind :: PROPERTY ) ,
175- SuggestionKind :: Command ( c) => match c {
170+ SuggestionKind :: Command ( c, _ ) => match c {
176171 CommandType :: Keyword => Some ( CompletionItemKind :: KEYWORD ) ,
177172 CommandType :: Builtin => Some ( CompletionItemKind :: FUNCTION ) ,
178173 CommandType :: Alias => Some ( CompletionItemKind :: REFERENCE ) ,
0 commit comments