-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: Postfix complete supports ordinary functions #64799
Comments
Interesting idea. This might make more sense outside postfix snippets since it involves searching for matching candidates. It's also a less-bounded search than the normal search of object methods, so we would probably have to limit the search scope somehow. |
Interesting. Whenever I want to use something from the strings package, I start by typing |
Let me explain in detail why:
a := someFunction() |
@rogeryk thanks for the explanation. It's an interesting idea, but definitely not trivial, and I'm not sure it is worth it. We will reconsider when we cross-prioritize feature requests. |
@findleyr From a comparison of the difficulty of implementation and the benefits, it does seem a bit mismatched. The main reason for this idea is that I feel after implementation, users will no longer need to customize suffixes. Currently, there is no support for users to customize suffix completion. Are there any plans for this? |
gopls version
14.2
go env
What did you do?
unimportant
What did you expect to see?
Now gopls already support postfix complete, which is very useful in some scenarios, but these all provides pre-defined.
Some completion is just some ordinary functions.
In fact, we do not need to pre-define these functions, just need to search for all the first parameter types according to the type of
X
inX.Sel
, and then match the name ofSel
.For example, the following program s, all functions in
strings
should appear in completion.This feature is useful for some basic types, such as string, slice, map. There are also places to pack different implement using functions, such as Context.Context types.
For some types, these completions may cause disturb, so it should have a relatively low priority.
What did you see instead?
unimportant
Editor and settings
No response
Logs
No response
The text was updated successfully, but these errors were encountered: