-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
GO111MODULE=on support #916
Comments
Go modules is not supported beyond whatever magic is in At this time I don't understand how modules work because it's under-documented and the devs seem to be making it up as they go, so I will wait until after the release of go1.12.1 to re-evaluate the situation. Hopefully they'll have sorted out some of the mess by then. |
Thanks for answering. Would you prefer I close this issue, since my question has been answered, or keep it open in case other people have the same question? |
NW.
I'll leave it open until I make a decision and update |
Is there any update on this? It looks like we are heading towards a world where modules are on by default by soon after the middle of this year (Go 1.13 release is planned for August). This is not that far away. |
The latest update on the |
Thanks. The reason I ask is because, apart from the looming change that will break GoSublime unless the user sets |
@kortschak The answer to your question is at the bottom of https://golang.org/cmd/go/#hdr-Import_path_checking section:
If it's okay to discuss alternative solutions since GoSublime does not support module mode at this time, another way to consider getting some module support in Sublime Text could be via a Language Server Protocol (LSP) plugin such as https://github.com/tomv564/LSP and the gopls LSP server. I haven't tried that approach yet, but I'd like to sometime. |
Thanks. |
An update on this. If I add a |
@kortschak can you elaborate a little more on how and what exactly you got working? Are you saying that you were able to get autocomplete to work in projects using modules which are outside the GOPATH? |
It seems so. Starting from a file that is outside I have not tried completely outside |
Just wanted to mention that on a project outside my GOPATH, my cursor stutters when I write code. As in, the CPU spikes up shortly due to which the cursor movement is not smooth. It goes away if I disable the |
Is GO111MODULE=on still unsupported by now? |
I dusted off my experimental code from December/January and added experimental support for auto-completion in go modules, but it needs testing before release. If you want to try it out, you'll need to temporarily switch to the |
@DisposaBoy I've tried |
I'm having problems with modules and code completion (i am on the "next" branch). Did anybody get that working? |
@alesstimec What problems are you having? |
@DisposaBoy sorry for a late answer.. but autocompletion seems to work occasionally for project using go modules.. far from what was available for non-module projects.. maybe it's just my configuration... |
@alesstimec Are you able to reliably reproduce the issue? There are a few changes yet to be released - which improves things a bit - but what's released should work on pure-go packages and partially with CGO packages. Maybe setting
|
Hi @DisposaBoy.. |
@alesstimec What does your config look like? I don't use |
I am using modules outside of a GOPATH. Checking out the &golang.MarGocodeCtl{
ImporterMode: golang.KimPorter,
} Has resulted in a lot of my woes being handled. Auto-completion working great, at least with the stdlib and within my module. Still working on getting external module auto-completion working. It's interesting, seems to work fine for some packages and less for others. Prefers things that I have listed in my
|
@tooolbox If you're able to reliably reproduce it it would be very helpful. I suspect one of the unreleased changes I have locally would help and/fix this. |
I found one thing, which is that it doesn't handle Empty directory, write a package main
import (
"os"
"github.com/cockroachdb/errors"
)
func main() {
if err := epicfail(); err != nil {
os.Exit(1)
}
}
func epicfail() error {
return errors.New("This failed")
} With a
(I did one I get auto-completion on the
Is that helpful @DisposaBoy ? |
@tooolbox Thanks for the repro. I've pushed some of my local changes/experimentation onto the |
The latest release v20.01.01 should hopefully resolve all bugs reported in this issue. |
The autocomplete still doesn't seem to work with go modules(in my case most of the times). What I'm saying is based on 9o://9o output. |
@zoli How can I reproduce the issue? I just tried:
and autocompleting |
Done the exact steps you mentioned and I cant get any autocompletion. I see this error in 9o:
|
@zoli that error is from |
@DisposaBoy Yeah, but I thought not showing any autocompletion and not working go to definition maybe related. The package is on latest commit(96954d1). This is my margo.go. Thanks for your help and the great package btw. |
@zoli margo.go looks fine to me. Try adding the Also, from within |
Enabling debug option didn't bring anything in console. |
@zoli Did you explicitly set |
@DisposaBoy I don't have any user settings for gosublime. Also except the
|
@zoli You need to run the AFAIK, if If you look in the Sublime Text console ctrl+` after it starts up, you should see some lines like From 9o, running the command Worst-case, I guess you could also set it in the GS
|
@DisposaBoy After what you said I looked into the code and I think I might have found the problem. Here Gosublime sets Running |
Thanks for spotting that @zoli. It turns out I had EDIT: Latest release https://github.com/DisposaBoy/GoSublime/releases/tag/v20.03.09 should fix it. |
Pulled the latest release and yes it fixes the problem, Thanks. |
Comment removed I'm sorry, everything is working great! Thanks @DisposaBoy ! I have tried out VSCode for Go a few times now and I always throw up my hands in disgust and come back to GoSublime. |
This is merely a question, not a feature request.
I've read SUPPORT.md, searched through issues, and didn't find an answer as to whether GO111MODULE=on mode is meant to be supported (or planned to be supported). I wanted to ask about that.
Thank you!
The text was updated successfully, but these errors were encountered: