Closed crazyhulk closed 4 days ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Thanks, it seems reasonable to support this, and agree that it is a good help-wanted issue. Thanks for the contribution, we'll review your CL.
I agree that the feature seems like a reasonable interpretation of SignatureHelp and its SignatureInformation result type, which represents "the signature of something callable".
I agree that the feature seems like a reasonable interpretation of SignatureHelp and its SignatureInformation result type, which represents "the signature of something callable".
/**
Callable, not calling?
" Signature help represents the signature of something callable." which refers to the entire set of method, sel, function, etc.
Gopls provides tremendous help while we write code, consider the following situation:
func foo(a, b int) int {
}
foo.
I want a complete menu here, and I must call foo. In this situation, if signature help is provided only after I’ve completed writing the function, it’s no longer useful.
In other words, we should provide function signatures for everything that is callable, not just for functions that are already being called.
We agree. :-)
Change https://go.dev/cl/605983 mentions this issue: SignatureHelp: report signature of Ident if no enclosing CallExpr
gopls version
Build info
golang.org/x/tools/gopls v0.16.1 golang.org/x/tools/gopls@v0.16.1 h1:1hO/dCeUvjEYx3V0rVvCtOkwnpEpqS29paE+Jw4dcAc= github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/google/go-cmp@v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y= golang.org/x/mod@v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/sync@v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/telemetry@v0.0.0-20240607193123-221703e18637 h1:3Wt8mZlbFwG8llny+t18kh7AXxyWePFycXMuVdHxnyM= golang.org/x/text@v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/tools@v0.22.1-0.20240628205440-9c895dd76b34 h1:Kd+Z5Pm6uwYx3T2KEkeHMHUMZxDPb/q6b1m+zEcy62c= golang.org/x/vuln@v1.0.4 h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I= honnef.co/go/tools@v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= mvdan.cc/gofumpt@v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= mvdan.cc/xurls/v2@v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= go: go1.21.0
go env
What did you do?
I cannot get function signatures without the parentheses when use lsp."textDocument/signatureHelp" when I make a code snippet plugin for neovim.
cmp-sign
What did you see happen?
Get nil by exec
lua vim.lsp.buf.signature_help()
in the neovim when cursor over the function name.What did you expect to see?
We prefere to use "." to trigger a code complete menu, we also need the ability to retrieve function signatures when cursor over the function name.
I have made a pull request to fix this.
Editor and settings
nvim, it works well.
Logs
No response