go-plus icon indicating copy to clipboard operation
go-plus copied to clipboard

Type hinting on cursor hover

Open pkieltyka opened this issue 11 years ago • 13 comments

Is there a way for go-plus, or something in combination with it to output the type of a variable or function definition where the cursor is placed? This is something GoSublime does in Sublime and its very useful. The auto-complete stuff is cool, albeit, a bit overzealous (ie. its code-completing in a comment...), but knowing the types of code once its already written would be very nice :)

pkieltyka avatar May 01 '15 12:05 pkieltyka

I agree, this is worth doing.

You can suppress completion in a comment via the Autocomplete Scope Blacklist preference, which is set by default to a scope of .source.go .comment. If you're getting suggestions in comments, they're not coming from gocode, they are from other packages you have installed. You can suppress scopes for all providers using the autocomplete-plus preference: Scope Blacklist.

joefitzgerald avatar May 05 '15 15:05 joefitzgerald

Type hinting is probably the one thing I miss the most. This is also very close to godoc support. Depending on how the UI is constructed.

otm avatar Oct 01 '15 18:10 otm

What I'd actually love is something similar to GoInfo from vim-go where it shows the type info for the item under the cursor in the statusline:

screen shot 2015-10-01 at 12 51 46 pm

philk avatar Oct 01 '15 19:10 philk

That is very nice. In atom that could be combined with links to definition and documentation.

otm avatar Oct 01 '15 19:10 otm

Here's some code we use for @omnisharp https://github.com/OmniSharp/omnisharp-atom/blob/1babb843c03982f18ab8819274d14e1225c54194/lib/omnisharp-atom/views/tooltip-view.ts

That will give the tooltips in Atom, we just need the API to call out when the mouse is hovering over a type

jchannon avatar Nov 09 '15 17:11 jchannon

Yes, this would be really awesome

thalesmello avatar Nov 19 '15 21:11 thalesmello

+1 This is what I would really need for productive go coding in Atom. I use the hinting feature all the time in Sublime Text 3 + GoSublime Plugin to see the parameters and return values of functions.

gobijan avatar Dec 06 '15 20:12 gobijan

+1

ddgnani avatar Dec 11 '15 03:12 ddgnani

+1 you can see this working nicely as well in the https://github.com/Microsoft/vscode-go package

josebalius avatar Mar 04 '16 01:03 josebalius

Is there any workaround available until this is officially implemented?

tonyxiao avatar Jun 10 '16 05:06 tonyxiao

+1

ctcpip avatar Jul 10 '16 05:07 ctcpip

This functionality is provided in https://atom.io/packages/go-signature-statusbar. I think it would be nice to include this in go-plus, but I want to come up with an effective solution for https://github.com/joefitzgerald/go-plus/issues/469#issuecomment-242887530 before including it.

joefitzgerald avatar Oct 01 '16 06:10 joefitzgerald

This is now included in v5.0.0 of go-plus.

joefitzgerald avatar Dec 19 '16 19:12 joefitzgerald