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

Godoc improvement #782

Merged
merged 2 commits into from
Apr 10, 2016
Merged

Godoc improvement #782

merged 2 commits into from
Apr 10, 2016

Conversation

fatih
Copy link
Owner

@fatih fatih commented Apr 2, 2016

Fixes #332

This uses @zmb3's new excellent tool called gogetdoc. It solves most of our problem here. Just call :GoDoc and it should show the documentation for the identifier under the cursor. Hit esc or enter to close the window easily.

@jzacsh
Copy link

jzacsh commented Apr 3, 2016

Nice, works wonderfully! Only thing is the new doc window is strangely small compared to the (50%?) height it used to have. I think this is intentional, as it seems full docs aren't listed anymore. Is this possible to turn on? (ie: open doc on a method, show that method in context on its package's full doc, as before?)

@zmb3
Copy link
Contributor

zmb3 commented Apr 3, 2016

No, gogetdoc doesnt work this way. It gets the doc right from the source code, where it isn't grouped by package.

@fatih
Copy link
Owner Author

fatih commented Apr 3, 2016

@jzacsh unfortunately it breaks the old way of showing the doc. The other way could be getting the package name and then pass it to go doc. This might be another solution.

@fatih
Copy link
Owner Author

fatih commented Apr 3, 2016

Also there is a way to explore the docs: https://github.com/garyburd/go-explorer

I think I have to re evaluate how we're going to want to explore go documentation in the future. Sometimes just getting a look at the current identifiers documentation is what we want. But sometimes we want to have a full disclosure to all documentation, to get a feeling what the remaining exported identifiers are, how the package can be used etc...

So we have two behavior of how we want to explore documentation:

  1. Checking/showing an identifier
  2. Exploring the documentation of a package

Based on this I think we should have the following commands:

  1. :GoDoc: the current approach which will show a single documentation of the underlying identifier
  2. :GoDocExplore: this will be used to explore a package and see the full documentation (so basically https://github.com/garyburd/go-explorer)
  3. :GoDocBrowser: we have this already, but it's flawed and doesn't work as intended. This opens the documentation in godoc.org. We also should re-evaluate this for private packages and and co.

Any feedback is welcome, I'm happy to discuss this.

/cc @garyburd @zmb3

@jzacsh
Copy link

jzacsh commented Apr 3, 2016

interesting, thanks for expanding @fatih!

I think I only unconsciously expect full-doc view because I'm used to a C file where Ctrl+K opens the full man page for me.

To clarify: no.2 the thing that currently happens (when an identifier is easily found), right? Except that we actually scroll/jump down to the method's doc inside the full package doc? This is a nice mixture of both package-doc and method-doc.

@fatih
Copy link
Owner Author

fatih commented Apr 10, 2016

To clarify: no.2 the thing that currently happens (when an identifier is easily found), right? Except that we actually scroll/jump down to the method's doc inside the full package doc? This is a nice mixture of both package-doc and method-doc.

This is the old approach, and will be replaced by the new approach. It's just for showing the documentation, like go doc. If you want to explore it' you have to use :GoDocExplore (which is not implemented and is the functionality provided via go-explorer).

@fatih fatih merged commit 7f248b2 into master Apr 10, 2016
@fatih fatih deleted the godoc-improvement branch April 10, 2016 18:17
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

Successfully merging this pull request may close these issues.

GoDoc doesn't properly find documentation
3 participants