-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 doesn't properly find documentation #332
Comments
Can you give an example file so I can test on it. |
Yeah, of course. Also I am particularly interested in using the So, a minimal replication of my setup:
Put the mouse over one of the struct types and attempt to open in GoDoc. Should fail with the error mentioned above. |
If you are already inside the source code, there is not much Godoc can do. We can surely optimize the outcome here. But I've tried your steps and created an package main
import (
"company/models"
"fmt"
)
func main() {
a := models.ApplicationPageManager{}
fmt.Printf("a = %+v\n", a)
} When I put my cursor on top of However if you try Is this what you want? If yes I can work on adding an option to use Thanks |
Hmm, not sure why it wasn't reproducable. Here is another thing to try.
Then create another file called
But yes, a variable specifying the host to use for GoDoc would be awesome. There are some cool flags you can enable on a local GoDoc server that the main one does not have. |
I can't follow your question. As described above I could open the doc inside the company folder. I think you are misusing it somehow. Can you give more details what to do once I've created the page.go file? Please give more info, possible with more steps so I can reproduce it. Based on your report I couldn't do it, so it's getting hard for me to follow it. |
I've got exactly the same issue. I've created an application in Wherever I try to call ":GoDoc" I've got the same error:
and so on... note that "package", or "type" is the text under cursor... That exactly the same with my packages inside the project. Running godoc in terminal is ok... EDIT: I tried to change my GOPATH to point on /home/patachou/goprojects/website too, same problem |
I'm experiencing a problem with GoDoc too but I'm not sure if this bug is correlated with mine. Here is a simplified snippet: http://play.golang.org/p/Hlx7RttH7l. Put the cursor on "Peek" and call :GoDoc. Error message is
If it is a different problem, I can file a different issue. |
I also wanted this, since I'm running godoc daemon on my box. I ended up patching my copy of
|
(it's be nice to be able to make this change via an option in |
I wrote a tool that uses There's even a blog post showing how it handles several cases that vim-go currently chokes on: https://zmb3.github.io/post/gogetdoc/ |
tl;dr someone w/enough VimL-foo, can update If cursor's word is passed to golang's oracle first to determine "package", I think this will be solvable inline in the current $ go get golang.org/x/tools/cmd/oracle In the below,
|
@jzacsh thanks for the feedback. Your solution requires two roundtrips and will increase the UI latency. This needs to be done in one single query. @zmb3 has a great tool that does it already (and I've also wanted to use something like that already. But my original plan was to use oracle's new |
#782 definitely solves the problem I had (#332 (comment)) |
I have vim-go fully installed and my
$GOPATH
contains everything needed for a full build of my package. It does reference a few different directories though.When I try to run
:GoDoc
on anything other than standard package items I receive:Where
db.Db
is the package of the item I was hovering over.Additionally, when running
:GoDocBrowser
I get referred tohttps://godoc.org/db.Db#Select
which of course does not actually exist. Did I miss something that will give GoDoc the information I need? Is there a way to refer it to a running instance ofGoDoc -http
Let me know if I can provided more helpful information about my setup. Thank you
The text was updated successfully, but these errors were encountered: