Automatically add semicolon when completing unit-returning functions

But provide a config to suppress that.

I didn't check whether we are in statement expression position, because this is hard in completion (due to the natural incompleteness of source code when completion is invoked), and anyway using function returning unit as an argument to something seems... dubious.
This commit is contained in:
Chayim Refael Friedman 2024-09-01 07:02:40 +03:00
parent 08c7bbc2db
commit 779a7cb0e3
12 changed files with 217 additions and 40 deletions

View file

@ -19,6 +19,7 @@ pub struct CompletionConfig {
pub term_search_fuel: u64,
pub full_function_signatures: bool,
pub callable: Option<CallableSnippets>,
pub add_semicolon_to_unit: bool,
pub snippet_cap: Option<SnippetCap>,
pub insert_use: InsertUseConfig,
pub prefer_no_std: bool,