-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Description
Loose end discovered while working on #819:
ark/crates/ark/src/lsp/completions/completion_item.rs
Lines 122 to 135 in bcdaed2
if rhs.node_type() == NodeType::FunctionDefinition { | |
if let Some(parameters) = rhs.child_by_field_name("parameters") { | |
let parameters = context | |
.document | |
.contents | |
.node_slice(¶meters)? | |
.to_string(); | |
item.detail = Some(join!(label, parameters)); | |
} | |
item.kind = Some(CompletionItemKind::FUNCTION); | |
item.insert_text_format = Some(InsertTextFormat::SNIPPET); | |
item.insert_text = Some(format!("{}($0)", label)); | |
} |
completion_item_from_assignment()
, which is used for document completions, hand crafts a function completion item, which means it doesn't benefit from all the smarts in completion_item_from_function()
.
I actually found this problem when writing tests for #819, because my first crack at it was with a user-defined function in the global environment. I wondered why things weren't working! This issue is a reminder to me to come back and route this through completion_item_from_function()
and to look hard for any other instances of similar.