quan-xie / goclipse

Automatically exported from code.google.com/p/goclipse
0 stars 0 forks source link

Project with local packages imported can't auto-complete #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a new Go project.
2. Make a "test.go" file and put code in it; see that auto-complete is working 
fine.
3. Make a new folder named "hello" and put a "hello.go" file in it; see that 
auto-complete in the "test.go" file still works.
4. Import "hello" in "test.go"; see that auto-complete fails (for all 
auto-complete, not only the "hello" functions).

Error message received when auto-complete fails:
"Content Assist" did not complete normally.  Please see the log for more 
information.
java.lang.NullPointerException

What is the expected output? What do you see instead?
Auto-complete used to work prior to the current version (before the Go1 
switchover)

What version of the product are you using? On what operating system?
GoClipse 0.7.1.v363
go version weekly.2012-03-27
Kubuntu 11.10 64-bit

Please provide any additional information below.
Simply commenting out the project-local imports will fix auto-complete.  This 
issue didn't exist prior to the package directory changes (it worked back when 
"src/pkg/hello" was the right way to go).

Original issue reported on code.google.com by dustyisa...@gmail.com on 3 Apr 2012 at 2:34

GoogleCodeExporter commented 9 years ago
Also useful to know:  I did a nice fresh install of gocode as well by deleting 
the old gocode binary and re-running "go get -u github.com/nsf/gocode".  gocode 
runs nicely except for this specific project-local package issue.

Attached is the simple example that fails.

Original comment by dustyisa...@gmail.com on 3 Apr 2012 at 2:48

Attachments:

GoogleCodeExporter commented 9 years ago
Extra useful information:  If I try to import a package that doesn't exist, it 
also fails, like the example below.  If you remove the "blahblahblah" line, it 
works fine.  It sounds like it thinks that project-local packages are 
non-existent.

The packages and binaries still build just fine, the only problem is in 
auto-complete.  Maybe it's an environment variable problem?  Or a gocode 
problem?

=====

package main

import (
  "blahblahblah"
  "fmt"
)

func main() {
  fmt.<press-ctrlspace-here-will-fail>
}

Original comment by dustyisa...@gmail.com on 3 Apr 2012 at 2:52

GoogleCodeExporter commented 9 years ago
I downloaded your project and also tried your "blahblahblah" example, but 
unfortunately, cannot recreate the problem you're seeing.  I am using Eclipse 
Version: 3.7.1, Ubuntu 11.04, & GoClipse 0.7.1.v363

Can you run gocode from the command line or vi?

Have you set the gocode path variable in the Go preferences?

Original comment by st...@kryas.com on 3 Apr 2012 at 4:53

GoogleCodeExporter commented 9 years ago
The gocode path variable is set.  If it wasn't then no auto-complete would have 
worked at all.

It looks like 
https://groups.google.com/forum/?fromgroups#!topic/goclipse/h02L5ghwaMg has the 
exact same problem.

Original comment by dustyisa...@gmail.com on 3 Apr 2012 at 5:50

GoogleCodeExporter commented 9 years ago
Where is your GOROOT pointing to on your system?

Original comment by st...@kryas.com on 3 Apr 2012 at 6:02

GoogleCodeExporter commented 9 years ago
GOROOT=/usr/lib/go

"go" is installed at /usr/lib/go/bin/go.  "gocode" is installed at 
/usr/lib/go/bin/gocode.

The previous version of GoClipse worked perfectly with this configuration.  The 
only variable that changed was the version of GoClipse.

Original comment by dustyisa...@gmail.com on 3 Apr 2012 at 6:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I removed my Eclipse settings (~/.eclipse) and my workspace, installed 
GoClipse, and tried again with the same result.  I set GOROOT to the same value 
as above and set GOCODE to the right path as well.  I made no custom settings 
to anything else, I'm running a stock Ubuntu-distro install of Eclipse 3.7.0.

Original comment by dustyisa...@gmail.com on 3 Apr 2012 at 6:52

GoogleCodeExporter commented 9 years ago
If I get a chance tonight, I'll reconfigure my environment with Go under 
/usr/lib and debug it.

Original comment by st...@kryas.com on 3 Apr 2012 at 1:27

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
If you are on Ubuntu (which it seems you are), I recommend using Gustavo 
Niemeyer's PPA for Go at https://launchpad.net/~gophers/+archive/go

That's what I use and it is rather fantastic.  Plus you'd have exactly the same 
environment I have, which might help.  I follow the "golang-weekly" package.

Original comment by dustyisa...@gmail.com on 4 Apr 2012 at 6:43

GoogleCodeExporter commented 9 years ago
Are you running Eclipse from the command line?  If not, will you try that

Original comment by st...@kryas.com on 4 Apr 2012 at 6:58

GoogleCodeExporter commented 9 years ago
I ran eclipse from the command line with and without the -debug flag.  Nothing 
seems to be of interest.  Nothing seems is reported when the auto-complete 
fails.  Here is the -debug output:

dusty@midori:~$ eclipse -debug
Start VM: /usr/bin/java
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-XX:MaxPermSize=256m
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /usr/lib/eclipse/eclipse
-name Eclipse
--launcher.library 
/usr/lib/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.
dist/eclipse_1407.so
-startup /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
--launcher.overrideVmargs
-exitdata b2b8062
-debug
-vm /usr/bin/java
-vmargs
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-XX:MaxPermSize=256m
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar 
Install location:
    file:/usr/lib/eclipse/
Configuration file:
    file:/usr/lib/eclipse/configuration/config.ini loaded
Configuration location:
    file:/home/dusty/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/
Configuration file:
    file:/home/dusty/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/config.ini loaded
Shared configuration location:
    file:/usr/lib/eclipse/configuration/
Framework located:
    file:/usr/lib/eclipse/plugins/org.eclipse.osgi_3.7.0.dist.jar
Framework classpath:
    file:/usr/lib/eclipse/plugins/org.eclipse.osgi_3.7.0.dist.jar
Splash location:
    /usr/lib/eclipse/plugins/org.eclipse.platform_3.7.0.dist/splash.bmp
Gtk-Message: Failed to load module "canberra-gtk-module"
Debug options:
    file:/home/dusty/.options not found
Time to load bundles: 3
Starting application: 759
Application Started: 4288

Original comment by dustyisa...@gmail.com on 5 Apr 2012 at 6:04

GoogleCodeExporter commented 9 years ago
I updated with the newest version of GoClipse and it looks like everything is 
working now.  I didn't change a thing except update GoClipse, so it looks like 
something you did fixed it.  Well done!  If I find a place it's still failing 
I'll report it, but so far so good.

Original comment by dustyisa...@gmail.com on 7 Apr 2012 at 6:01

GoogleCodeExporter commented 9 years ago
Thank you for the feedback.  I am going to close this issue.  If it reoccurs, 
please file a new issue.  

Original comment by st...@kryas.com on 7 Apr 2012 at 6:31