Skip to content
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

Feature Request: Open GoDoc #31

Closed
ajoslin opened this issue Feb 3, 2012 · 8 comments
Closed

Feature Request: Open GoDoc #31

ajoslin opened this issue Feb 3, 2012 · 8 comments

Comments

@ajoslin
Copy link

ajoslin commented Feb 3, 2012

Hi,

Would it be possible to add a command that would open godoc at package? Eg if I had 'fmt' written on the current line and I pressed ctrl-alt-g-d, it would open 'godoc fmt' in Sublime.

Or if I had 'fmt.Printf' written on the current line and pressed the command, it would open godoc fmt and then search for 'Printf'.

This'd be a huge help.

@tux21b
Copy link
Contributor

tux21b commented Feb 4, 2012

Since the docs are quite short, I would prefer an automatic popup (some kind of tooltip) which shows the 1-2 sentences above the function automatically. As far as I remember Eclipse and VS are doing the same with Java and C#.

@ajoslin
Copy link
Author

ajoslin commented Feb 4, 2012

Yeah, that would work too.

Perhaps something in the command palette to open the source for that function too (godoc has an option for opening a func's source)

@DisposaBoy
Copy link
Owner

I'm not sure of how to do with by calling the command.

godoc fmt Print

might work and is easy because I can simply gather all [\w.] before and after the cursor and split on the dot.

Needless to say that will only work sometimes(rarely). It gets interesting when the package is aliased or not on the root, e.g net/http .

The only way I can think to do it to parse the file to find out the actual variable etc. that's under the cursor, at least then we can also give the right info. AFAICT godoc pretty much does a search which returns loads of noise.

regarding the command palette: This functionality would most likely go under GsPalette ctrl+shift+g

all this stuff is a little way off though because I'm planning to migrate all the plugin functionality into github.com/DisposaBoy/MarGo which is lagging as I wait for things to settle down so I can depend on Go1. This also means the end of calling external commands more or less so I won't have to depend on tools doing what we want or hacking around stuff.

@ajoslin
Copy link
Author

ajoslin commented Feb 14, 2012

Ok, sounds good:)

@DisposaBoy
Copy link
Owner

I have ideas about implementing the full browser-based godoc style of browsing, but inside of sublime text. that's still in the experimental phase but the basic show documentation is now partially implemented (margo implementation is seerely lacking) but after the latest update you can access it by ctrl+., ctrl+h when the cursor is on a package-level function. currently only package-level functions are supported, the variables, constants, methods, etc. will follow in margo at some point

@DisposaBoy DisposaBoy mentioned this issue Jun 7, 2012
@DisposaBoy
Copy link
Owner

this issue is now being tracked as part of #62

@mindplay-dk
Copy link

Any progress on this?

This would put SublimeText+GoSublime right up there with the best full-blown IDEs, but with Sublime performance :-)

@mchiodo
Copy link

mchiodo commented Jan 10, 2014

A popup link on mouseover would be great, similar to mousing over Java classes in Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants