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

spurious unresolved symbol errors for multi-file package #108

Closed
skybrian opened this issue Aug 5, 2012 · 3 comments
Closed

spurious unresolved symbol errors for multi-file package #108

skybrian opened this issue Aug 5, 2012 · 3 comments

Comments

@skybrian
Copy link

skybrian commented Aug 5, 2012

I have a Go package containing "expr.go" and "expr_test.go" In the test, all references to symbols in "expr.go" are unresolved.

This is using a single-module package with the content root at $GOPATH and one src directory named "src". Previously I had a module's content root at the same directory as the source files, and it worked.

@skybrian
Copy link
Author

skybrian commented Aug 5, 2012

I found a workaround: put the module's content root at $GOPATH/src instead of $GOPATH.

@mtoader
Copy link
Member

mtoader commented Aug 5, 2012

That's how it should work. Unfortunately it was tedious to have the completion / resolving work based only on existing *.a packages. Right now for this to work we need the sources. And the sources should be in the proper places usually.

@mtoader mtoader closed this as completed Aug 5, 2012
@skybrian
Copy link
Author

skybrian commented Aug 6, 2012

Oops, let me explain better. My source files have always been in the right places, relative to $GOPATH. The difference is just in the IntelliJ module configuration.

When I select File->Project Structure and click on a Go module, I would expect that I can click "Add content root" and put it anywhere I want. Then browse in the directory tree (on the right hand side) to find the "src" directory, right-click and select "Sources". Then when resolving Go symbols, IntelliJ should look for directories marked "Sources" or "Test Sources" and resolve paths from there. (This is based on how it works for Java modules.)

I think what might be happening instead is that it starts from content roots and source root settings are ignored?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants