-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
gopls version
14.2
go env
unimportantWhat 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.
- for string:split, join
- for slice: len, append
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 in X.Sel, and then match the name of Sel.
For example, the following program s, all functions in strings should appear in completion.
var s string
s.| // complete: HasSuffix, Split, ContainsRune, ...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