Open urandom opened 3 days ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Thanks for the report. This sounds like a bug in postfix completions.
Seems like it is this line. I don't think we have ever really established snippet best practices when placeholders are disabled. I guess it depends on how good the default placeholder values are. If we expect the user to normally want the default values, we should insert them (with no placeholder). If we expect the user to want to replace them, we should omit them and leave the cursor there so the user can type.
Personally I think we should address the usability issues with placeholders and get away from supporting a global no-placeholder mode for snippets. Turning off placeholders just doesn't make sense for most snippets. If there are still contentious uses of placeholders (e.g. func call params), we introduce specific config flags to control those individual uses.
gopls version
golang.org/x/tools/gopls v0.16.1
go env
What did you do?
I've disabled the
usePlaceholders
option, since having it enabled inserts invalid syntax, causing more work.Then I attempted to complete a
.var!
suffix completion on a function call, in order to have the variables defined.What did you see happen?
, := theFunctionThatWasCompleted()
What did you expect to see?
someVar, err := theFunctionThatWasCompleted()
Editor and settings
Zed:
Logs
No response