-
Notifications
You must be signed in to change notification settings - Fork 141
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
[master] Special treatment for "C" package. #44
base: master
Are you sure you want to change the base?
Conversation
It works, for me, thx |
It has no effect in go1.7 linux/amd64. |
@applee How does it look on your side? It's a hard-coded workaround for "C". It cannot jump to definition on "C" but at least parses for other definitions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this worked for me
@@ -1967,6 +1967,9 @@ func parseImportSpec(p *parser, doc *ast.CommentGroup, decl *ast.GenDecl, _ int) | |||
if declIdent == nil { | |||
filename := p.fset.Position(path.Pos()).Filename | |||
name, err := p.pathToName(litToString(path), filepath.Dir(filename)) | |||
if litToString(path) == "C" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe only do this if name is also "" (and would therefore fail otherwise)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds reasonable.
This fixed it for me as well. Can this be merged? |
I had the same issue with https://github.com/aarzilli/golua. This PR fixes it. (On 1.7 as well, btw.) |
At least for me, this patch doesn't work anymore with vendor directories.
|
Since the |
I am encountering this problem, too.
Go version is 1.8 ( also wrong in 1.7, too).
#44 fixes the "C" import problem, but hit another problem:
|
@jwendel @shahuwang you might like to try #61 as an alternative solution |
Now I believe this is obsoleted by #62 |
Fixes #41 (at least for me).
import "C"
is not a real package. Sogodef
cannot correctly parse any package that saysimport "C"
. This adds a special treatment for this package and circumvents this problem.