Skip to content
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

Unresolved reference #3328

Closed
mashail opened this issue Mar 11, 2022 · 5 comments
Closed

Unresolved reference #3328

mashail opened this issue Mar 11, 2022 · 5 comments
Assignees
Labels
lang: go Go rules integration P2 We'll consider working on this in future. (Assignee optional) product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin type: bug

Comments

@mashail
Copy link

mashail commented Mar 11, 2022

Hello,

Our project is a golang monorepo built with bazel. The tree of the project looks like this

.
├── BUILD.bazel
├── README.md
├── Review.md
├── Taskfile.yml
├── WORKSPACE
├── build.sh
├── download.bzl
├── go.mod
├── go.sum
├── k8s
├── k8s-roach
├── nogo.json
├── packages
│   ├── BUILD.bazel
│   ├── customers
....
│   ├── proto
│   │   ├── accounts
│   │   │   └── v1
│   │   │       ├── BUILD.bazel
│   │   │       ├── accounts.proto
│   │   │       ├── client.go **
│   │   │       ├── tx.go **
│   │   │       └── tx_test.go **
......
├── repos.bzl
├── scripts

Here is the BUILD file under proto/accounts/v1

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

proto_library(
    name = "cigar_accounts_v1_proto",
    srcs = ["accounts.proto"],
    visibility = ["//visibility:public"],
    deps = [
        "//packages/proto/common/v1:cigar_common_v1_proto",
        "@com_github_envoyproxy_protoc_gen_validate//validate:validate_proto",
        "@com_google_protobuf//:duration_proto",
        "@com_google_protobuf//:timestamp_proto",
    ],
)

go_proto_library(
    name = "cigar_accounts_v1_go_proto",
    compilers = [
        "@io_bazel_rules_go//proto:go_grpc",
        "//bazel:pgv_plugin_go",
    ],
    importpath = "cigar/genproto/accounts/v1",
    proto = ":cigar_accounts_v1_proto",
    visibility = ["//visibility:public"],
    deps = [
        "//packages/proto/common/v1:common",
        "@com_github_envoyproxy_protoc_gen_validate//validate:go_default_library",
    ],
)

go_library(
    name = "accounts",
    srcs = [
        "client.go",
        "tx.go",
    ],
    embed = [":cigar_accounts_v1_go_proto"],  # keep
    importpath = "cigar/genproto/accounts/v1",  # keep
    visibility = ["//visibility:public"],
    deps = ["@org_golang_google_grpc//:go_default_library"],
)

go_test(
    name = "accounts_test",
    srcs = ["tx_test.go"],
    embed = [":accounts"],
    deps = ["@com_github_stretchr_testify//assert"],
)

Once we added the *.go file the proto/accounts/v1 everything under this package even the generated proto code became unresolved in Intellij IDEA.

before adding the *.go under proto/accounts/v1 it was resolving them without any issue. Any idea what should I change to fix this

@mashail
Copy link
Author

mashail commented Mar 22, 2022

help please

@sgowroji sgowroji added type: bug lang: go Go rules integration product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-maintainer Awaiting review from Bazel team on issues labels Oct 31, 2022
@blorente blorente added the P2 We'll consider working on this in future. (Assignee optional) label Nov 4, 2022
@blorente blorente removed the awaiting-maintainer Awaiting review from Bazel team on issues label Mar 23, 2023
@tingilee
Copy link
Contributor

+1 Also seeing this issue.

Copy link

Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Mar 16, 2024
@blorente
Copy link
Collaborator

This looks like it will be fixed by @tingilee 's contribution here: #6030

@github-actions github-actions bot removed the stale Issues or PRs that are stale (no activity for 30 days) label Mar 20, 2024
@tpasternak
Copy link
Collaborator

Probably fixed #6030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: go Go rules integration P2 We'll consider working on this in future. (Assignee optional) product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin type: bug
Projects
Development

No branches or pull requests

5 participants