Add documentation to function autocompletes
This commit is contained in:
		
							parent
							
								
									f4bce14299
								
							
						
					
					
						commit
						7a6f99479a
					
				| @ -1243,7 +1243,7 @@ pub fn analyze_expr( | ||||
|                     .iter() | ||||
|                     .map(|fun| Autocomplete { | ||||
|                         text: fun.name.clone(), | ||||
|                         documentation: Some("intrinsic function documentation".to_string()), | ||||
|                         documentation: fun.documentation.clone(), | ||||
|                         kind: AutocompleteKind::Function(fun.parameters.clone(), fun.return_type.clone()), | ||||
|                     }) | ||||
|                     .collect::<Vec<_>>(), | ||||
|  | ||||
| @ -152,10 +152,12 @@ impl LanguageServer for Backend { | ||||
|                             }) | ||||
|                             .unwrap(), | ||||
|                         ); | ||||
|                         item.documentation = autocomplete | ||||
|                             .documentation | ||||
|                             .as_ref() | ||||
|                             .and_then(|d| Some(lsp_types::Documentation::String(d.clone()))); | ||||
|                         item.documentation = autocomplete.documentation.as_ref().and_then(|d| { | ||||
|                             Some(lsp_types::Documentation::MarkupContent(MarkupContent { | ||||
|                                 kind: MarkupKind::Markdown, | ||||
|                                 value: d.clone(), | ||||
|                             })) | ||||
|                         }); | ||||
|                         item | ||||
|                     }) | ||||
|                     .collect() | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user