gocode icon indicating copy to clipboard operation
gocode copied to clipboard

Parameter suggestions don't match the type of the parameter

Open sprt opened this issue 9 years ago • 1 comments

Example:

screenshot from 2016-04-01 12-38-17

exprtToIdent expects an ast.Expr but the suggestions are all over the place.

:sparkles:

sprt avatar Apr 01 '16 10:04 sprt

To comment on that. Gocode doesn't do any deduction when it comes to function arguments. I think it's possible to do so, the same way we do autocompletions for struct literals. But sadly you can't really remove autocompletions without doing deep analysis. Because what if you want to call some function which returns type A, which has method B, which returns type C, which has field that matches your function signature. I think the only acceptable solution here is to introduce priority based sorting. But some editors sort on their own anyway.

So, don't expect this feature to be available soon, but maybe one day.

nsf avatar Apr 01 '16 18:04 nsf