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