Skip to content

x/tools/gopls: improve support for users of cgo packages #35720

@heschi

Description

@heschi

Forked from #31561. This issue is not for packages that directly import "C"; that issue is #35721.

Various features, notably Go to Definition and friends, fail when the declaring package uses cgo. That's because the Go code for cgo files is actually in a generated file in the build cache, not the .go file the user might expect. The generated file has //line directives that point to the original code, but gopls is currently not honoring those directives. Fixing that should improve the experience for people who depend on a cgo library.

If there are other features that break when depending on a cgo package, please note them here so that we can make sure they're fixed and add tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions