Giter Site home page Giter Site logo

Comments (10)

stamblerre avatar stamblerre commented on July 30, 2024

Are you synced to the most recent version? I'm not able to reproduce this.

from gocode.

malkhamis avatar malkhamis commented on July 30, 2024

I did clone master and ensured that gocode is not running.. I then ran go install while being inside master. If you are unable to reproduce this, then I will suspect that this is an Atom/Go-Plus issue

from gocode.

zmb3 avatar zmb3 commented on July 30, 2024

@malkhamis go-plus uses mdempsky/gocode by default - just wanted to confirm, have you explicitly installed this fork?

from gocode.

malkhamis avatar malkhamis commented on July 30, 2024

@zmb3 I performed the following steps to ensure that this fork is used:

$ gocode exit
$ rm ~/go/bin/gocode
$ gocode
> bash: gocode: command not found...
$ rm -rf ~/go/src/github.com/stamblerre/
$ mkdir ~/go/src/github.com/stamblerre/
$ cd ~/go/src/github.com/stamblerre/
$ git clone [email protected]:stamblerre/gocode.git
$ go install ./...
$ gocode -s -debug

Now when I type code in Atom, I observe an output from gocode and everything is fine. This is until I insert a comment in the following line, I get autocompletion suggestions for symbols in the file, but once I type symbol. (i.e. .), the gocode output stops altogether. Things are okay after I remove the comment I inserted in the following line

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

@malkhamis: can you try this in an another editor to confirm that the bug is in Atom? I was not able to reproduce using VSCode.

from gocode.

zmb3 avatar zmb3 commented on July 30, 2024

I cannot reproduce this in Atom either.

2018/12/17 15:41:55 Got autocompletion request for '/Users/zmb3/complete/main.go'
2018/12/17 15:41:55 Cursor at: 48
2018/12/17 15:41:55 -------------------------------------------------------
package main

import "fmt"

func main() {
  fmt.#
  //comment
}
2018/12/17 15:41:55 -------------------------------------------------------
2018/12/17 15:41:55 error in package github.com/zmb3/complete: /Users/zmb3/complete/main.go:6:7:_ not declared by package fmt
2018/12/17 15:41:55 Elapsed duration: 210.343033ms
2018/12/17 15:41:55 Offset: 0
2018/12/17 15:41:55 Number of candidates found: 25
2018/12/17 15:41:55 Candidates are:
2018/12/17 15:41:55   func Errorf(format string, a ...interface{}) error
2018/12/17 15:41:55   func Fprint(w io.Writer, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Fscan(r io.Reader, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Print(a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Printf(format string, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Println(a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Scan(a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Scanf(format string, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Scanln(a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Sprint(a ...interface{}) string
2018/12/17 15:41:55   func Sprintf(format string, a ...interface{}) string
2018/12/17 15:41:55   func Sprintln(a ...interface{}) string
2018/12/17 15:41:55   func Sscan(str string, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Sscanf(str string, format string, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   func Sscanln(str string, a ...interface{}) (n int, err error)
2018/12/17 15:41:55   type Formatter interface
2018/12/17 15:41:55   type GoStringer interface
2018/12/17 15:41:55   type ScanState interface
2018/12/17 15:41:55   type Scanner interface
2018/12/17 15:41:55   type State interface
2018/12/17 15:41:55   type Stringer interface
2018/12/17 15:41:55 =======================================================

from gocode.

malkhamis avatar malkhamis commented on July 30, 2024

@stamblerre
I couldn't reproduce this in VSCode either... However, I noticed that vscode would successfully autocomplete albeit I see no output in the terminal while gocode -s --debug is running. I am not a vscode user, so I am unsure if vscode runs multiple autocompletion daemons/process/programs and tries to intelligently autocomplete with best effort?

@zmb3 After trying vscode, it asked me to install stamblerre/gocode and I noticed a binary called gocode-gomod in my GOPATH/bin.. I tried to delete the gocode binary in there and rename the gocode-gomod binary to gocode... I than ran it in terminal in debug mode... I could observe autocompletion requests from Atom, but the same behavior exists (i.e. no autocompletion beyond what is in the current file if the next line is a comment) :(

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

VSCode runs mdempsky/gocode when users are not in module mode, and it runs this version of gocode, renamed to gocode-gomod to avoid conflicts, in module mode. I'm really unable to reproduce this issue, as you can see from the debug output below.

2018/12/20 13:01:24 Got autocompletion request for '/usr/local/google/home/rstambler/Desktop/gocodetest/main.go'
2018/12/20 13:01:24 Cursor at: 123
2018/12/20 13:01:24 -------------------------------------------------------
package main

import (
	"fmt"

	"rsc.io/quote"
)

func main() {
	fmt.Println("hello")
	quote.Hello()
	quote.Hello()
	quote.#Glass()
}
2018/12/20 13:01:24 -------------------------------------------------------
2018/12/20 13:01:24 error in package github.com/stamblerre/gocodetest: /usr/local/google/home/rstambler/Desktop/gocodetest/main.go:13:8:_ not declared by package quote
2018/12/20 13:01:24 Elapsed duration: 113.23792ms
2018/12/20 13:01:24 Offset: 0
2018/12/20 13:01:24 Number of candidates found: 4
2018/12/20 13:01:24 Candidates are:
2018/12/20 13:01:24   func Glass() string
2018/12/20 13:01:24   func Go() string
2018/12/20 13:01:24   func Hello() string
2018/12/20 13:01:24   func Opt() string
2018/12/20 13:01:24 =======================================================
2018/12/20 13:01:34 Got autocompletion request for '/usr/local/google/home/rstambler/Desktop/gocodetest/main.go'
2018/12/20 13:01:34 Cursor at: 123
2018/12/20 13:01:34 -------------------------------------------------------
package main

import (
	"fmt"

	"rsc.io/quote"
)

func main() {
	fmt.Println("hello")
	quote.Hello()
	quote.Hello()
	quote.#Glass()
	//hello
}
2018/12/20 13:01:34 -------------------------------------------------------
2018/12/20 13:01:34 error in package github.com/stamblerre/gocodetest: /usr/local/google/home/rstambler/Desktop/gocodetest/main.go:13:8:_ not declared by package quote
2018/12/20 13:01:34 Elapsed duration: 104.063464ms
2018/12/20 13:01:34 Offset: 0
2018/12/20 13:01:34 Number of candidates found: 4
2018/12/20 13:01:34 Candidates are:
2018/12/20 13:01:34   func Glass() string
2018/12/20 13:01:34   func Go() string
2018/12/20 13:01:34   func Hello() string
2018/12/20 13:01:34   func Opt() string
2018/12/20 13:01:34 =======================================================
2018/12/20 13:02:53 Got autocompletion request for '/usr/local/google/home/rstambler/Desktop/gocodetest/main.go'
2018/12/20 13:02:53 Cursor at: 144
2018/12/20 13:02:53 -------------------------------------------------------
package main

import (
	"fmt"

	"rsc.io/quote"
)

func main() {
	fmt.Println("hello")
	quote.Hello()
	quote.Hello()
	quote.Glass()
	//hello
}

q#
// hello
2018/12/20 13:02:53 -------------------------------------------------------
2018/12/20 13:02:53 error in package github.com/stamblerre/gocodetest: /usr/local/google/home/rstambler/Desktop/gocodetest/main.go:4:2:"fmt" imported but not used
2018/12/20 13:02:53 error in package github.com/stamblerre/gocodetest: /usr/local/google/home/rstambler/Desktop/gocodetest/main.go:6:2:"rsc.io/quote" imported but not used
2018/12/20 13:02:53 Elapsed duration: 131.963793ms
2018/12/20 13:02:53 Offset: 0
2018/12/20 13:02:53 Number of candidates found: 1
2018/12/20 13:02:53 Candidates are:
2018/12/20 13:02:53   package quote 
2018/12/20 13:02:53 =======================================================
2018/12/20 13:02:54 Got autocompletion request for '/usr/local/google/home/rstambler/Desktop/gocodetest/main.go'
2018/12/20 13:02:54 Cursor at: 149
2018/12/20 13:02:54 -------------------------------------------------------
package main

import (
	"fmt"

	"rsc.io/quote"
)

func main() {
	fmt.Println("hello")
	quote.Hello()
	quote.Hello()
	quote.Glass()
	//hello
}

quote.#
// hello
2018/12/20 13:02:54 -------------------------------------------------------
2018/12/20 13:02:54 error in package github.com/stamblerre/gocodetest: /usr/local/google/home/rstambler/Desktop/gocodetest/main.go:4:2:"fmt" imported but not used
2018/12/20 13:02:54 error in package github.com/stamblerre/gocodetest: /usr/local/google/home/rstambler/Desktop/gocodetest/main.go:6:2:"rsc.io/quote" imported but not used
2018/12/20 13:02:54 Elapsed duration: 126.898834ms
2018/12/20 13:02:54 Offset: 0
2018/12/20 13:02:54 Number of candidates found: 4
2018/12/20 13:02:54 Candidates are:
2018/12/20 13:02:54   func Glass() string
2018/12/20 13:02:54   func Go() string
2018/12/20 13:02:54   func Hello() string
2018/12/20 13:02:54   func Opt() string
2018/12/20 13:02:54 =======================================================

from gocode.

malkhamis avatar malkhamis commented on July 30, 2024

OK I guess I am the only affected by this for some reason.. I will close this issue then. Thanks a lot for your followup.. really appreciate it

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

Sorry, I wasn't able to help! I guess my best advice would be to make sure you're synced to head and maybe rebuild it - try go get -u github.com/stamblerre/gocode?

from gocode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.