gleam
gleam copied to clipboard
LSP: Display function signature when passing arguments
In instances like such:
fn main() {
do_something(
}
it would be nice to have the function signature for do_something
displayed as you pass in the arguments so as to know the order and type information.
This would be fab, let's get this. It will likely require some amount of fault tolerant parsing and compilation.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
/**
* Additional details for a completion item label.
*
* @since 3.17.0
*/
export interface [CompletionItemLabelDetails](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemLabelDetails) {
/**
* An optional string which is rendered less prominently directly after
* {@link CompletionItem.label label}, without any spacing. Should be
* used for **function signatures** or type annotations.
*/
detail?: string;
/**
* An optional string which is rendered less prominently after
* {@link CompletionItemLabelDetails.detail}. Should be used for fully qualified
* names or file path.
*/
description?: string;
}
It's not a completion in this case as there's nothing being suggested that the programmer could select. It may be an InlayHint, but don't know for sure.
I think this would be a signature help
- https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureHelp
Well researched! Thank you