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

support go_library importpath_aliases when resolving modules #7194

Open
neskandary-vistar opened this issue Dec 18, 2024 · 0 comments
Open
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: GoLand GoLand plugin type: feature request

Comments

@neskandary-vistar
Copy link

neskandary-vistar commented Dec 18, 2024

Description of the feature request:

Hi team,

Thanks for building and maintaining this plugin, I find it very useful. This may be just be something with me, but in the project I use this for, intellij does not seem to resolve a go module that uses an alias in importpath_aliases, it only works if I change the module to what the importpath is.

The go library is github.com/doug-martin/goqu/v9,

In my bazel workspace that is

go_repository(
        name = "com_github_doug_martin_goqu_v9",
        importpath = "github.com/doug-martin/goqu/v9",
        remote = "https://github.com/doug-martin/goqu",
        vcs = "git",
    )

The generated @com_github_doug_martin_goqu_v9///BUILD.bazel looks like

go_library(
    name = "goqu",
    srcs = [
        "database.go",
        "delete_dataset.go",
        "expressions.go",
        "goqu.go",
        "insert_dataset.go",
        "prepared.go",
        "select_dataset.go",
        "sql_dialect.go",
        "truncate_dataset.go",
        "update_dataset.go",
    ],
    importpath = "github.com/doug-martin/goqu/v9",
    importpath_aliases = ["github.com/doug-martin/goqu"],
    visibility = ["//visibility:public"],
    deps = [
        "//exec",
        "//exp",
        "//internal/errors",
        "//internal/sb",
        "//internal/util",
        "//sqlgen",
    ],
)

In my project, a bazel build file has a go_library that has the dep "@com_github_doug_martin_goqu_v9//:go_default_library",, I would like to use the importpath alias "github.com/doug-martin/goqu" in my go file when importing modules, but intellij cannot resolve that, it only does when I change it to "github.com/doug-martin/goqu/v9". Bazel still builds, it's the IDE support I am missing for this module

OSX 14.4, IntelliJ IDEA 2024.3.1 (Ultimate Edition), Bazel for Intellij 2024.11.19.0.3-api-version-243, Bazel 6.5.0

Thanks!

Which category does this issue belong to?

GoLand

What underlying problem are you trying to solve with this feature?

importing a go module via go_library importpath alias

What operating system, Intellij IDE and programming languages are you using? Please provide specific versions.

OSX 14.4, IntelliJ IDEA 2024.3.1 (Ultimate Edition), Bazel for Intellij 2024.11.19.0.3-api-version-243, Bazel 6.5.0

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: GoLand GoLand plugin type: feature request
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants