go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 570 forks source link

If I want to build against to intellij 13,should I download intellij IC-132.947 source code? #264

Closed AlexLuya closed 10 years ago

AlexLuya commented 11 years ago

According to:http://webapp.org.ua/dev/intellij-idea-and-go-plugin/,it is needed,right?

mtoader commented 11 years ago

The latest head compiles against idea 13 but it will run on idea 132.947 and up.

dlsniper commented 11 years ago

I can confirm the latest master works against 132.947. There are some quirks in the plugin but help is welcomed. I can provide a link to the latest binary if @mtoader allows for it. Cheers.

AlexLuya commented 11 years ago

@disniper Would you please send me the complied plugin against 132.947 to save me time to download idea's code source?My email:alexander.luya@gmail.com.

AlexLuya commented 11 years ago

It seems that gopath doesn't get supported still,all packages(.a file) installed from github.com can't be imported.

dlsniper commented 11 years ago

That's something that should be fixed when adding the SDK. Right now, the simplest way to fix this is to go 'Project structure' -> 'SDKs' -> select the GO sdk you are using -> 'Classpath' pane on the right side and add the paths that correspond to where your first $GOPATH entry is set to. As an example, in my case is like this:

/usr/lib/go/src/pkg # exists already
/usr/lib/go/pkg/linux_amd64 # exists already
/home/florin/golang/src # added like described above
/home/florin/golang/pkg/linux_amd64 # added like described above

Feel free to help out ;)

Cheers, Florin


Florin Patan https://github.com/dlsniper http://www.linkedin.com/in/florinpatan

On Mon, Nov 11, 2013 at 3:04 PM, Alex Luya notifications@github.com wrote:

It seems that gopath doesn't get supported still,all packages(.a file) installed from github.com can't be imported.

— Reply to this email directly or view it on GitHubhttps://github.com/mtoader/google-go-lang-idea-plugin/issues/264#issuecomment-28201925 .

AlexLuya commented 11 years ago

workspace 1_011

rambocoder commented 11 years ago

IMHO adding the $GOPATH paths to SDK classpath is not working right now. To resolve the symbols I recommend a workaround:

Create 2 symlinks (your architecture folder might vary):

$GOROOT/src/pkg/github.com -> $GOPATH/src/github.com 
$GOROOT/pkg/linux_amd64/github.com -> $GOPATH/pkg/linux_amd64/github.com
AlexLuya commented 11 years ago

This worked.Thank you very much @mtoader , @dlsniper and @rambocoder

mtoader commented 11 years ago

@AlexLuya just so you know .. the plugin is NOT using the *.a files to provide completion and resolve (it can't do that). What it needs are the source files and the procedure the @dlsniper showed it the one that works right now.

AlexLuya commented 11 years ago

Sorry,I am confused.Based on @rambocoder's suggestion,symbols importing and code competion worked,but compilation doesn't work.In the before,I can right click top directory of project,the click "make module 'xxx'" from context menu to compile project,but right now,after doing this,nothing happened.Why?

dlsniper commented 11 years ago

@AlexLuya compilation doesn't work right now, it's not related to how you import the things in IDEA.

Also, the method @rambocoder indicated will break the expectations of GO, and like @mtoader already said, the plugin doesn't use .a files to provide any kind of value, so I wouldn't recommend it.

Stick to what GO says in the manual, keep $GOPATH and $GOROOT separated and add the first folder in your $GOPATH to the paths used by the SDK.

Any help in fixing the compilation is appreciated, right now I'm trying to fix the formatter first then I might look at the compiler but that's a longer task.

Thanks.

AlexLuya commented 11 years ago

Ok,thanks

rambocoder commented 11 years ago

@dlsniper, you are right. Adding symlinks from $GOPATH to $GOROOT is a bad practice. Using this build https://dl.dropboxusercontent.com/sh/kzcmavr2cmqqdqw/w3xefJRJbe/google-go-language.jar (I wish I could find where I got that dropbox link) and http://download.jetbrains.com/idea/ideaIU-132.1045.tar.gz I have removed the symlinks, added: $GOROOT/src/pkg $GOPATH/src to Sourcepath. Voila, code suggestions work.

dlsniper commented 10 years ago

@rambocoder that's the link to my dropbox where I usually put builds when I finish a certain PR and it's working. I'm using this plugin in my daily activity so it's stable enough but there's no guarantees for it ;) Can this be closed for now?

arvenil commented 10 years ago

Thanks for this tips guys! Maybe this could be added to readme?

dlsniper commented 10 years ago

Docs have been improved a bit and IDEA 13.0.1 is already out (with 13.0.2 on the way).