Versions: IDEA Ultimate 2017.3.3 / 2018.01.02.0.1
IDEA Ultimate 2017.3.1 / 2017.11.20.0.4
We are missing the right-click Run/Debug options in Golang projects that we have for Java/Scala.
We can execute tests form the corresponding BUILD file, but not from the context of the test file itself either as a whole unit or an individual method.
It also appears that the Workspace is frequently out-of-sync (via the light in the toolbar).
Sample .bazelproject:
directories:
.
targets:
//...
additional_languages:
go
I am interesting in contributing, would we just need to port somethings over from the Java/Scala invocations?
You don't see these from right clicking?


Can you share your project? Or a minimal repro case?
Thanks for the reply @chaoren, yeah I am missing those options. Let me see if I can create a reproducible example outside our private monorepo context.
@chaoren, here is one of our public projects that I was able to repro the issue with:
https://github.com/vsco/domino
I setup the project via:
Via TestGetItemEmpty:

Via BUILD

Problem seems to be in rules_go.
ctx.rule.attr is empty for go_test targets.
Thank you @chaoren 馃憤 !
Bad news. Those providers are not usable unless we load their definitions from the rules_go repo into our aspect, but we also run the aspect for non-go workspaces, and there's no such thing as a conditional load. We'll need to talk with the bazel people about potentially changing the providers API.
Is the rules_go project the only one that is not following the same convention for those providers? It would seem that in that case if let's say rules_scala made a similar change we would lose functionality there as well right?
We're in discussions with the Skylark folks now to come up with a solution for this (likely adding support for a conditional load).
The only reason our plugin currently works for java-like languages (java, scala, kotlin) is that the java providers we use are bundled with Bazel. This is something we're going to have to solve for all languages.
It works as of the latest plugin and IDE.
Most helpful comment
We're in discussions with the Skylark folks now to come up with a solution for this (likely adding support for a conditional load).
The only reason our plugin currently works for java-like languages (java, scala, kotlin) is that the java providers we use are bundled with Bazel. This is something we're going to have to solve for all languages.