bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
761 stars 303 forks source link

Error importing a library when using the plugin #503

Closed nisdas closed 1 year ago

nisdas commented 5 years ago

Despite the libraries existing in my workspace , I keep on getting this error Build constraints exclude all Go files in //path/to/library . I am not sure exactly how to interpret this error correctly as I have no issues importing other libraries. This has lead to syntax highlighting being red over all my source files as the ide keeps on showing the import as invalid.

To reproduce this issue locally:

nisdas commented 5 years ago

Looks like #194 is related to this

ewang commented 5 years ago

It works in IntelliJ, but not on GoLand 2018.3.3. Looks like GoLand isn't picking up the pb.go files that are generated by Bazel.

ewang commented 5 years ago

@nisdas After further investigation, looks like IntelliJ with Go plugin doesn't enable Vgo support by default but GoLand does. Disabling Vgo support for the project in GoLand resolved the above issue for me.

grefab commented 5 years ago

Same issue here. Enableing/disabling Vgo did not help (was not enabled by default in Goland for my project). This seems to only affect go libs that use cgo, since most of the imports are recognized correctly.

cdelguercio commented 4 years ago

Any update on this? I'm using GoLand 2019.2.5 and v2019.12.02 of the Bazel plugin.

ranveermeemo commented 4 years ago

+1 Still failing.

riuvshyn commented 3 years ago

I have same issue with

IntelliJ IDEA 2020.3.2 (Ultimate Edition)
Build #IU-203.7148.57, built on January 26, 2021
Licensed to ... Ltd / ...
Subscription is active until ...
Runtime version: 11.0.9.1+11-b1145.77 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 4012M
Cores: 12
Non-Bundled Plugins: YAML/Ansible support, dk.lost_world.intellij-touch, org.intellij.plugins.hcl, org.jetbrains.plugins.go-template, org.jetbrains.kotlin, Pythonid, org.jetbrains.plugins.go

some libs are just are red in the editor however I can successfully build the project with no issues.

blorente commented 1 year ago

Could you try updating to the newest IntelliJ/GoLand, and updating the plugin? There's been quite a bit of work on .pb.go files lately.

sgowroji commented 1 year ago

We are closing this issue now as it is fixed in the latest plugin and IDE releases. Please check and let us know , with complete steps, if you are still seeing the same observation. Thanks!