-
Notifications
You must be signed in to change notification settings - Fork 25
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
working directory not preserved correctly #54
Comments
cc @zmb3 |
GO111MODULE=on
Thanks for tracking this down - the detail in your vscode-go issue helped tremendously. This is an issue of preserving context properly. In its current state, When you try to navigate again from within the |
@zmb3 In that case, I believe I can fix this from vscode-go just like I did previously for godef I dont set a working directory for the child process being spawned for calling Will doing the same help gogetdoc as well? |
Yes, it will. But I need to push a fix to gogetdoc before it will make a difference. |
Editors must use the project working directory when invoking gogetdoc to ensure that we can jump across module boundaries. Updates #54
Seems like the issue is resolved now. |
Thanks for following up @nezorflame! |
@zmb3 The fix for this issue introduced another issue. The details are here microsoft/vscode-go#2246. Would you mind taking a look at it? |
@karim this is intentional. Editors must provide a working directory when invoking the tool. The fix will have to be made in the extension. Let’s take the conversation over to that issue. |
I see, thanks. |
Seems like
gogetdoc
(or, rather,go list
?) is unable to get documentation for stdlib packages withGO111MODULE=on
(/Users/nezorflame/.gvm/gos/go1.11.4
is where my Go is installed, throughgvm
):Input:
~ gogetdoc -pos=/Users/nezorflame/.gvm/gos/go1.11.4/src/fmt/print.go:#7660
Output:
cannot load package containing /Users/nezorflame/.gvm/gos/go1.11.4/src/fmt/print.go: go [list -e -json -compiled -test=false -export=false -deps=true -- /Users/nezorflame/.gvm/gos/go1.11.4/src/fmt]: exit status 1: go: cannot determine module path for source directory /Users/nezorflame/.gvm/gos/go1.11.4 (outside GOPATH, no import comments)
If I explicitly set
GO111MODULE=auto
(oroff
) before invoking it, it works:Input:
~ GO111MODULE=auto gogetdoc -pos=/Users/nezorflame/.gvm/gos/go1.11.4/src/fmt/print.go:#7660
Output:
Details on that issue can be found here: microsoft/vscode-go#2213
The text was updated successfully, but these errors were encountered: