GithubHelp home page GithubHelp logo

mdempsky / gocode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nsf/gocode

908.0 39.0 89.0 1.46 MB

An autocompletion daemon for the Go programming language

License: MIT License

Go 68.47% Shell 1.87% Python 4.49% Emacs Lisp 19.67% Vim Script 5.50%

gocode's Introduction

IMPORTANT: This repository is currently in maintenance mode.

For a better autocompletion experience with Go, we suggest you use the Go language server, gopls.

If you are looking for a version of gocode that works with Go modules, please see stamblerre/gocode.


Build Status

github.com/mdempsky/gocode

This version of gocode is a fork of the original, which is no longer supported. This fork should work for all versions of Go > 1.8. It only works for $GOPATH projects. For a version of gocode that works with Modules, please see github.com/stamblerre/gocode.

An autocompletion daemon for the Go programming language

Gocode is a helper tool which is intended to be integrated with your source code editor, like vim, neovim and emacs. It provides several advanced capabilities, which currently includes:

  • Context-sensitive autocompletion

It is called daemon, because it uses client/server architecture for caching purposes. In particular, it makes autocompletions very fast. Typical autocompletion time with warm cache is 30ms, which is barely noticeable.

Also watch the demo screencast.

Gocode in vim

Gocode in emacs

Setup

  1. You should have a correctly installed Go compiler environment and your personal workspace ($GOPATH). If you have no idea what $GOPATH is, take a look here. Please make sure that your $GOPATH/bin is available in your $PATH. This is important, because most editors assume that gocode binary is available in one of the directories, specified by your $PATH environment variable. Otherwise manually copy the gocode binary from $GOPATH/bin to a location which is part of your $PATH after getting it in step 2.

    Do these steps only if you understand why you need to do them:

    export GOPATH=$HOME/goprojects

    export PATH=$PATH:$GOPATH/bin

  2. Then you need to install gocode:

    go get -u github.com/mdempsky/gocode (-u flag for "update")

    Windows users should consider doing this instead:

    go get -u -ldflags -H=windowsgui github.com/mdempsky/gocode

    That way on the Windows OS gocode will be built as a GUI application and doing so solves hanging window issues with some of the editors.

    Note: If you are updating your version of gocode, you will need to run gocode close to restart it.

  3. Next steps are editor specific. See below.

Vim setup

Vim manual installation

Note: As of go 1.5 there is no $GOROOT/misc/vim script. Suggested installation is via vim-go plugin.

In order to install vim scripts, you need to fulfill the following steps:

  1. Install official Go vim scripts from $GOROOT/misc/vim. If you did that already, proceed to the step 2.

  2. Install gocode vim scripts. Usually it's enough to do the following:

    2.1. vim/update.sh

    update.sh script does the following:

    #!/bin/sh
    mkdir -p "$HOME/.vim/autoload"
    mkdir -p "$HOME/.vim/ftplugin/go"
    cp "${0%/*}/autoload/gocomplete.vim" "$HOME/.vim/autoload"
    cp "${0%/*}/ftplugin/go/gocomplete.vim" "$HOME/.vim/ftplugin/go"
    

    2.2. Alternatively, you can create symlinks using symlink.sh script in order to avoid running update.sh after every gocode update.

    symlink.sh script does the following:

    #!/bin/sh
    cd "${0%/*}"
    ROOTDIR=`pwd`
    mkdir -p "$HOME/.vim/autoload"
    mkdir -p "$HOME/.vim/ftplugin/go"
    ln -s "$ROOTDIR/autoload/gocomplete.vim" "$HOME/.vim/autoload/"
    ln -s "$ROOTDIR/ftplugin/go/gocomplete.vim" "$HOME/.vim/ftplugin/go/"
    
  3. Make sure vim has filetype plugin enabled. Simply add that to your .vimrc:

    filetype plugin on

  4. Autocompletion should work now. Use <C-x><C-o> for autocompletion (omnifunc autocompletion).

Using Vundle in Vim

Add the following line to your .vimrc:

Plugin 'mdempsky/gocode', {'rtp': 'vim/'}

And then update your packages by running :PluginInstall.

Using vim-plug in Vim

Add the following line to your .vimrc:

Plug 'mdempsky/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' }

And then update your packages by running :PlugInstall.

Other

Alternatively take a look at the vundle/pathogen friendly repo: https://github.com/Blackrush/vim-gocode.

Neovim setup

Neovim manual installation

Neovim users should also follow Vim manual installation, except that you should goto gocode/nvim in step 2, and remember that, the Neovim configuration file is ~/.config/nvim/init.vim.

Using Vundle in Neovim

Add the following line to your init.vim:

Plugin 'mdempsky/gocode', {'rtp': 'nvim/'}

And then update your packages by running :PluginInstall.

Using vim-plug in Neovim

Add the following line to your init.vim:

Plug 'mdempsky/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' }

And then update your packages by running :PlugInstall.

Emacs setup

In order to install emacs script, you need to fulfill the following steps:

  1. Install auto-complete-mode

  2. Copy emacs/go-autocomplete.el file from the gocode source distribution to a directory which is in your 'load-path' in emacs.

  3. Add these lines to your .emacs:

    (require 'go-autocomplete)
    (require 'auto-complete-config)
    (ac-config-default)
    

Also, there is an alternative plugin for emacs using company-mode. See emacs-company/README for installation instructions.

If you're a MacOSX user, you may find that script useful: https://github.com/purcell/exec-path-from-shell. It helps you with setting up the right environment variables as Go and gocode require it. By default it pulls the PATH, but don't forget to add the GOPATH as well, e.g.:

(when (memq window-system '(mac ns))
  (exec-path-from-shell-initialize)
  (exec-path-from-shell-copy-env "GOPATH"))

Sublime Text 3 setup

A plugin for Sublime Text 3 is provided in the subl3 directory of this repository. To install it:

  1. Copy the plugin into your Sublime Text 3 Packages directory:

    $ cp -r $GOPATH/src/github.com/mdempsky/gocode/subl3 ~/.config/sublime-text-3/Packages/
    
  2. Rename the plugin directory from subl3 to gocode:

    $ mv ~/.config/sublime-text-3/Packages/subl3 ~/.config/sublime-text-3/Packages/gocode
    
  3. Open the Command Pallete (Ctrl+Shift+P) and run the Package Control: List Packages command. You should see gocode listed as an active plugin.

Debugging

If something went wrong, the first thing you may want to do is manually start the gocode daemon with a debug mode enabled and in a separate terminal window. It will show you all the stack traces, panics if any and additional info about autocompletion requests. Shutdown the daemon if it was already started and run a new one explicitly with a debug mode enabled:

gocode exit

gocode -s -debug

Please, report bugs, feature suggestions and other rants to the github issue tracker of this project.

Developing

There is Guide for IDE/editor plugin developers.

If you have troubles, please, contact me and I will try to do my best answering your questions. You can contact me via email. Or for short question find me on IRC: #go-nuts @ freenode.

Misc

  • It's a good idea to use the latest git version always. I'm trying to keep it in a working state.
  • Use go install (not go build) for building a local source tree. The objects in pkg/ are needed for Gocode to work.

gocode's People

Contributors

adamfaulkner avatar bad-ptr avatar bradwright avatar danielmorsing avatar dougm avatar ebfe avatar frou avatar fumiyas avatar ghiden avatar kodx avatar kostya-sh avatar mattn avatar mdempsky avatar mikelikespie avatar mk0x9 avatar mozhonghua avatar myitcv avatar naoina avatar negronjl avatar nhooyr avatar nsf avatar purcell avatar sbinet avatar segevfiner avatar stamblerre avatar syohex avatar tiziano88 avatar vanackere avatar wmji avatar yasuyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gocode's Issues

autocomplete fails in shorthand slice syntax

package repro

type S struct {
	Foo int
}

var _ = []S{
	/* S */ { /* autocomplete here */ },
}

If I comment in the S, autocomplete correctly suggests Foo, but not without it. This was supposedly already fixed in nsf#422, but apparently there was a regression at some point.

I'm using this in the context of VSCode on a Mac, if that makes any difference.

expected selector or type assertion, found ';'

https://github.com/jinzhu/gorm is a orm library for golang, using this library require implementing from it's gorm.Model and gocode failed with that.

sample code (go build with no problem):

package main

import (
	"github.com/jinzhu/gorm"
)

type T struct {
	gorm.Model

	X string
}

func main() {
	t := T{}
	t.X = "abc"
}

error log from gocode:

2018/09/17 23:04:41 -------------------------------------------------------
package main

import (
	"github.com/jinzhu/gorm"
)

type T struct {
	gorm.Model

	X string
}

func main() {
	t := T{}
	t.X = "abc"
	t.#
}
2018/09/17 23:04:41 -------------------------------------------------------
2018/09/17 23:04:41 Error parsing input file (outer block):
2018/09/17 23:04:41  /Users/xxxxx/go/src/bitbucket.org/xxxx/xxxx/test.go:16:4: expected selector or type assertion, found ';'
goroutine 50 [running]:
runtime/debug.Stack(0xb, 0xc000211200, 0x1)
	/usr/local/Cellar/go/HEAD-43f54c8/libexec/src/runtime/debug/stack.go:24 +0xa7
runtime/debug.PrintStack()
	/usr/local/Cellar/go/HEAD-43f54c8/libexec/src/runtime/debug/stack.go:16 +0x22
main.(*Server).AutoComplete.func1(0xc000202640)
	/Users/jackwang/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/gocode/server.go:71 +0x94
panic(0x142bbc0, 0x1551820)
	/usr/local/Cellar/go/HEAD-43f54c8/libexec/src/runtime/panic.go:513 +0x1b9
github.com/mdempsky/gocode/lookdot.walk(0x1556980, 0xc0001fa930, 0xc0001f0101, 0xc0002117d0)
	/Users/jackwang/go/src/github.com/mdempsky/gocode/lookdot/lookdot.go:77 +0xaec
github.com/mdempsky/gocode/lookdot.Walk(0xc000211830, 0xc0002117d0, 0x87)
	/Users/jackwang/go/src/github.com/mdempsky/gocode/lookdot/lookdot.go:12 +0xd2
github.com/mdempsky/gocode/suggest.(*Config).Suggest(0xc000211a70, 0xc000222000, 0x37, 0xc000224000, 0x89, 0x89, 0x86, 0x14760a0, 0xc00005ea88, 0xc00005eb80, ...)
	/Users/jackwang/go/src/github.com/mdempsky/gocode/suggest/suggest.go:45 +0x58f
main.(*Server).AutoComplete(0x1885620, 0xc0001fc0d0, 0xc000202640, 0x0, 0x0)
	/Users/jackwang/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/gocode/server.go:102 +0x215
reflect.Value.call(0xc0000b6360, 0xc0000b4550, 0x13, 0x14d37c8, 0x4, 0xc00005ef18, 0x3, 0x3, 0xc0001f8040, 0x0, ...)
	/usr/local/Cellar/go/HEAD-43f54c8/libexec/src/reflect/value.go:447 +0x450
reflect.Value.Call(0xc0000b6360, 0xc0000b4550, 0x13, 0xc000166718, 0x3, 0x3, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/HEAD-43f54c8/libexec/src/reflect/value.go:308 +0xa4
net/rpc.(*service).call(0xc0000a98c0, 0xc00013e000, 0xc0000a7878, 0xc0000a7890, 0xc0000e2200, 0xc0000bcc40, 0x1417d00, 0xc0001fc0d0, 0x16, 0x1417cc0, ...)
	/usr/local/Cellar/go/HEAD-43f54c8/libexec/src/net/rpc/server.go:384 +0x14e
created by net/rpc.(*Server).ServeCodec
	/usr/local/Cellar/go/HEAD-43f54c8/libexec/src/net/rpc/server.go:481 +0x47e

gocode is slow in vim

I find gocode is slow(about 1.7s in project) and I try to find the reason.
Then, I find the function cfg.Check() (in internal/suggest/suggest.go line 121) use about 99% time.
It's seem standard library's function and hardly optimize it, so I wonder know if I didn't configure correctly or It's normal phenomenon? thinks for your answer.

gocode and company-go are not work correctly

hi guys, i tried gocode and company-go a few months ago, it works fine, but with the golang'version updated, all of these tools goes wrong, can anyone supports a fully solution for emacser to write go
3ks

gocode: serverless mode

Currently gocode is a thin client that talks to a server process using net/rpc.

However as far as I can tell the server (unlike the original nsf/gocode version) doesn't cache anything.

A client that uses suggest package to find the list of candidates is going to be simpler and probably even a few ms faster.

I suggest to implement a serverless mode for the client first (e.g. by passing -addr=none on the command line).

If it proves to be fast and usable enough maybe the server can be removed alltogether.

Thoughts?

suggest: incomplete scanning of composite literal types

Given struct type T, suggest currently incorrectly thinks []T{ is a struct literal context, so it suggests completions for T's field names. However, this is actually a slice literal context. The cursor deduction logic for composite literal types needs to continue scanning until it finds a token that can't be part of a type name.

Panic with Go 1.10 With Deoplete-Go and NVim

I'm having a lot of issues with gocode panicking. I'll have freshly opened Vim in a Go project and start typing. Neovim will get flooded with messages about how gocode's panicked.

Here are the logs from the debug:

panic: runtime error: slice bounds out of range

goroutine 28 [running]:
runtime/debug.Stack(0xb, 0xc42005e820, 0x1)
	/usr/local/Cellar/go/1.10.3/libexec/src/runtime/debug/stack.go:24 +0xa7
runtime/debug.PrintStack()
	/usr/local/Cellar/go/1.10.3/libexec/src/runtime/debug/stack.go:16 +0x22
main.(*Server).AutoComplete.func1(0xc42022e340)
	/Users/catherinecai/go/src/github.com/mdempsky/gocode/server.go:72 +0x94
panic(0x141cf60, 0x16fab90)
	/usr/local/Cellar/go/1.10.3/libexec/src/runtime/panic.go:502 +0x229
main.(*Server).AutoComplete(0x172a070, 0xc42018ac30, 0xc42022e340, 0x0, 0x0)
	/Users/catherinecai/go/src/github.com/mdempsky/gocode/server.go:84 +0x9ac
reflect.Value.call(0xc4201c4000, 0xc420168038, 0x13, 0x149d878, 0x4, 0xc42005ef18, 0x3, 0x3, 0xc42015e2c0, 0x13f65e0, ...)
	/usr/local/Cellar/go/1.10.3/libexec/src/reflect/value.go:447 +0x969
reflect.Value.Call(0xc4201c4000, 0xc420168038, 0x13, 0xc42004cf18, 0x3, 0x3, 0x14688a0, 0x147f201, 0xc42015f440)
	/usr/local/Cellar/go/1.10.3/libexec/src/reflect/value.go:308 +0xa4
net/rpc.(*service).call(0xc42016e0c0, 0xc420178050, 0xc42017ee48, 0xc42017ee60, 0xc42017c080, 0xc420164180, 0x13e24c0, 0xc42018ac30, 0x16, 0x13e2480, ...)
	/usr/local/Cellar/go/1.10.3/libexec/src/net/rpc/server.go:384 +0x14e
created by net/rpc.(*Server).ServeCodec
	/usr/local/Cellar/go/1.10.3/libexec/src/net/rpc/server.go:480 +0x43a
2018/07/21 11:36:21 Got autocompletion request for '/Users/catherinecai/go/src/gitlab.com/catherinetcai/rekognize/server/server/face.go'
2018/07/21 11:36:21 Cursor at: 190
2018/07/21 11:36:21 -------------------------------------------------------

What I'm running:

Go: go version go1.10.3 darwin/amd64
Neovim Version:

NVIM v0.3.0
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/build/config -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/src -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/build/src/nvim/auto -I/tmp/neovim-20180612-71518-1f95nfa/neovim-0.3.0/build/include
Compiled by [email protected]

I've already checked over with the folks working on deoplete-go, and they directed me here since it's a gocode issue. Not sure where to go next with this...

Reports zero candidates for syscall/js in 1.11

I originally opened this bug under VSCode here but there trouble shooting implies it's upstream in your project. Despite setting various VSCode settings to ensure the GOOS and GOARCH were set properly. For posterity, here's that bug cut and paste here:

package main

import (
	"syscall/js"
)

func main() {
	js.Global().Call("alert", "Hello World")
}

When built with GOOS=js GOARCH=wasm go build main.go using Go 1.11 this produces a WASM binary without error. However VSCode shows that there's an error:

could not import syscall/js (can't find import: "syscall/js")

I think this has to do with that namespace being experimental while wasm support stabilizes over the coming versions. I'm given very little details about the error.

As a result of the namespace not being found, intellisense also doesn't work.

I'm running VSCode 1.26.1 on Linux Mint 19 x64 with Go 1.11

I reopened the project to investigate further and when I moused over the import with it's red squiggly line, I got this error:

build constraints exclude all Go files in /usr/local/go/src/syscall/js

I think the plugin doesn't use an altered GOOS and GOARCH when checking the code for errors.

I tried setting go.toolsEnvVars in the project settings but I'm still getting the could not import error on the import.

In Output I see:

/home/corey/src/goprojects/src/wasm-hw>Finished running tool: /home/corey/src/goprojects/bin/golint

/home/corey/src/goprojects/src/wasm-hw>Finished running tool: /usr/local/go/bin/go build -i -o /tmp/go-code-check.198072839 wasm-hw
go build runtime/internal/atomic: mkdir /usr/local/go/pkg/js_wasm: permission denied
go build runtime/internal/sys: open /usr/local/go/pkg/js_wasm/runtime/internal/sys.a: no such file or directory
go build internal/race: mkdir /usr/local/go/pkg/js_wasm: permission denied
go build sync/atomic: mkdir /usr/local/go/pkg/js_wasm: permission denied
go build internal/cpu: open /usr/local/go/pkg/js_wasm/internal/cpu.a: no such file or directory

/home/corey/src/goprojects/src/wasm-hw>Finished running tool: /usr/local/go/bin/go vet ./...

I've set my go.toolsEnvVars as follows:

{
  "go.toolsEnvVars": {
    "GOOS": "js",
    "GOARCH": "wasm",
    "GOROOT": "/usr/local/go",
    "GOPATH": "/home/corey/src/goprojects"
  }
}

GoRoot and GoPath reflect what the normal env variables are. I'm still getting the could not import error. I'm not sure why it's trying to do things in my /usr/local/go folder or how to tell it to build those files in $GOPATH/pkg.

Adding write privileges to the $GOROOT/pkg folder not only feels like a bad move, but it also doesn't entirely fix the problem. The error goes away but there's no intellisense for anything under js.

Massive CPU Usage

Go version:

go version go1.10.2 linux/amd64

Go environment:

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/naftuli/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/naftuli/devel"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build045151416=/tmp/go-build -gno-record-gcc-switches"

I am using dep:

dep:
 version     : v0.4.1
 build date  : 2018-01-24
 git hash    : 37d9ea0a
 go version  : go1.9.1
 go compiler : gc
 platform    : linux/amd64

I'm using NeoVim 0.2.2:

NVIM v0.2.2
Build type: RelWithDebInfo
LuaJIT 2.0.4
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=2 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim-HJnLxJ/neovim-0.2.2/build/config -I/build/neovim-HJnLxJ/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim-HJnLxJ/neovim-0.2.2/build/src/nvim/auto -I/build/neovim-HJnLxJ/neovim-0.2.2/build/include
Compiled by [email protected]

Features: +acl +iconv +jemalloc +tui 
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

screenshot from 2018-07-20 11 44 24

I have wiped /tmp/go-build* and ~/.cache/go-build.

Here's what I observe:

  1. Completion takes a very long time.
  2. While waiting for completion, CPU spikes.
  3. It doesn't seem to get better.

Any ideas on why it's killing my CPU and taking so long? I haven't changed anything.

Not completing external packages

I switched over to this fork as nsf/gocode wasn't working at all after go 1.10. Local completion works fine, as does the standard library but as soon as i try to complete an external library or type (e.g github.com/sirupsen/logrus) gocode tells me that 0 candidates were found. I tried a complete clean install but nothing seems to work.

suggest: include receiver parameter info in method hints

It might be desirable to include receiver parameter information in hints for methods. At the very least, when hinting the type of a method expression, we should probably indicate that the method parameter has become a normal parameter.

For example, currently for bytes.Buffer.Write, we hint func Write(p []byte) (n int, err error), but the method expression's type is actually func (*bytes.Buffer, []byte) (int, error).

suggest: support gb

During my rewrite, I removed support for gb for simplicity. I'd like to add it back though.

Problems with gb-based repositories.

Not quite sure why it happens. But on all of my gb-based code base I get this when running gocode -s -debug:

panic: inconsistent import:
        const net/http.StatusUnauthorized untyped int
previously imported as:
        const StatusUnauthorized untyped int

And similar messages for standard lib types. Maybe it has something to do with vendoring? I don't know. Have no reproducable test case yet. Will drop a note here when I do.

But maybe you have some ideas where it may come from?

high cpu consumption/slowness on emacs using Go tip

Hi

When I tried to use gocode (compiled with tip version of Go on Linux/amd64), I noticed that it is consuming a lot of cpu and it is freezing/slowing down emacs.

$ go version
go version devel +fb3cf5c Mon Jul 11 15:11:44 2016 +0000 linux/amd64

$emacs --version
GNU Emacs 25.0.94.1
Copyright (C) 2016 Free Software Foundation, Inc.

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/rjammalamadaka/gocode"
GORACE=""
GOROOT="/home/rjammalamadaka/go"
GOTOOLDIR="/home/rjammalamadaka/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build120557061=/tmp/go-build"
CXX="g++"
CGO_ENABLED="1"

Not sure if anyone else noticed this. Here is what I tried to type: https://play.golang.org/p/2j5PPxh9UN
I use goimports to manage the imports.

Here is the debug info from gocode, please let me know if you need anything else.

$ ~/gocode/bin/gocode -s -debug
2016/07/11 12:28:49 Got autocompletion request for '/home/rjammalamadaka/tchannel.go'
2016/07/11 12:28:49 Cursor at: 45
2016/07/11 12:28:49 -------------------------------------------------------
package main

func main() {

http.HandleFunc#("dnsfile", 

}
2016/07/11 12:28:49 -------------------------------------------------------
2016/07/11 12:28:49 Error parsing input file (outer block):
2016/07/11 12:28:49 /home/rjammalamadaka/tchannel.go:5:28: expected ')', found ','
2016/07/11 12:28:50 Elapsed duration: 601.813606ms
2016/07/11 12:28:50 Offset: 0
2016/07/11 12:28:50 Number of candidates found: 0
2016/07/11 12:28:50 Candidates are:
2016/07/11 12:28:50 =======================================================
2016/07/11 12:28:57 Got autocompletion request for '/home/rjammalamadaka/tchannel.go'
2016/07/11 12:28:57 Cursor at: 49
2016/07/11 12:28:57 -------------------------------------------------------
package main

func main() {

http.HandleFunc("/f#

}

suggest: better test coverage

$ go test -cover github.com/mdempsky/gocode/suggest
ok      github.com/mdempsky/gocode/suggest  0.239s  coverage: 66.5% of statements

That percentage should be higher.

The biggest coverage offenders are the various formatting methods and for import path suggestions.

I'm suspicious of whether import path suggestions even work. If not, the code for them should be removed.

Packages in /vendor not autocompleting

After using dep init I don't get autocomplete results for packages inside vendor directory. The program still builds and runs fine and is using the code in vendor as I would expect. If I rename vendor to vendored then the autocomplete works fine.

Running go version go1.10.4 darwin/amd64

Completion in context of `if` boolean expressions

My question/request is best explained via a couple of examples.

// example 1
package main

type S struct {
    *T
}

func (s *S) DoSomething() {
    // eg 1
    s.
      ^
}

type T int

If completion is attempted at the position indicated by ^, completion successfully returns the full list of candidates:

func DoSomething()
var T *T

Now consider:

// example 2
package main

type S struct {
    *T
}

func (s *S) DoSomething() {
    // eg 1
    if s.
         ^
}

type T int

This time we only get the single candidate:

func DoSomething()

This appears to be because the declaration of type T follows the currently invalid if statement; in the case of example 2, this affects parsing sufficiently so as to cause gocode to consider the type of the anonymous field (the fact that it's anonymous I don't believe is relevant) declared as *T as invalid.

Is there a way to avoid this/improve things? I'm guessing this might be tricky given we end up straying into core go/parser territory?

Support Go Modules

Context: I maintain Atom's go-plus package for go support. I know @ramya-rao-a is also interested in ensuring vscode-go works well with go modules.

There are a variety of failure scenarios for the current master version of gocode when using go modules support (in particular without using vendor mode).

Over time, we may want to edit this issue to describe each of the failure modes and validate that they are fixed. My assumption is that the cache branch and a switch to use golang.org/x/tools/go/packages will both be required to get to completion. @mdempsky do you have specific plans here?

go-langserver + gocode integration

Hi, recently I updated go-langserver to use gocode suggest API. go-langserver is directly using internal/suggest api since it doesn't need to run daemon with server-client.

Here are few problems I see.

  1. Current repository contains integrations for vim, neovim, sublime etc. which are not needed for go-langserver.
  2. It contains server-client daemon which is not needed for go-langserver.
  3. Since I want to help improve gocode and go-langserver currently I will need to make PR in this repo and then copy-paste code to go-langserver. It's time consuming.

My suggestions:

  1. Move internal/suggest to public pkg/suggest.
  2. Make it go-gettable go get github.com/mdempsky/gocode/pkg/suggest.
  3. Vendor this new package in go-langserver.

@mdempsky
I could make PR for this change.

suggest: test.0011 fails with Go 1.11

Go 1.11 added a new MapRange method to reflect.Value, which causes the expectations to fail.

Unfortunately we can't just add this to the expectations because that would cause the test to fail on earlier Go releases, which we still want to maintain compatibility with. Maybe we can add support for version-specific expected outputs.

Looking at the commit where this test case was added (ddfc180), it seems the intent was to check something related to reflect.Value's embedding of the reflect.flag type. Maybe there's another type that can test the same criteria.

autocomplete -f=godit does not return explicit package name where one is used

Consider the following main.go:

package main

import (
    "fmt"
    banana "go/ast"
)

func main() {
    var x *banana.Package
    fmt.Println(x)
    //          ^
}

If we invoke gocode as follows (101 represents the offset as indicated by the caret above):

/path/to/gocode' -sock unix '-in=/my/gopath/src/mydomain.com/g/cmd/banana/main.go' '-f=godit' 'autocomplete' '/my/gopath/src/mydomain.com/g/cmd/banana/main.go' '101'

we get the following:

1,,1
var x *ast.Package,,x

However, as you can see we have explicitly defined the package name for the "go/ast" import here... even though the underlying type is indeed *go/ast.Package

As a suggestion, I think the reported type should actually be the package qualified type and not the package name qualified type (else the "fix" is more complicated because the output is dependent on the context, explicit package names etc)

Under this proposal the above output would have been:

1,,1
var x *go/ast.Package,,x

Raising this issue in order to get feedback on this proposal as a first step.

Thanks

autocompletion failure. -debug dump included.

2018/07/12 20:19:06 Got autocompletion request for '/home/agu/gopath_work/src/github.com/AnimusPEXUS/aipsetup/buildercollection/xfs.go'
2018/07/12 20:19:06 Cursor at: 715
2018/07/12 20:19:06 -------------------------------------------------------
package buildercollection

import (
	"github.com/AnimusPEXUS/aipsetup/basictypes"
	"github.com/AnimusPEXUS/utils/logger"
)

func init() {
	Index["xfs"] = func(bs basictypes.BuildingSiteCtlI) (basictypes.BuilderI, error) {
		return NewBuilder_xfs(bs), nil
	}
}

type Builder_xfs struct {
	*Builder_std
}

func NewBuilder_xfs(bs basictypes.BuildingSiteCtlI) *Builder_xfs {
	self := new(Builder_xfs)

	self.Builder_std = NewBuilder_std(bs)

	self.EditDistributeArgsCB = self.EditDistributeArgs

	//	self.ForcedAutogen = true

	return self
}

func (self *Builder_xfs) ActionCompletePreconfiguration(
	log *logger.Logger,
) error {
	//	info, err := self.bs.ReadInfo()
	//	if err != nil {
	//		return err
	//	}

	self.bs.#

	return nil
}

func (self *Builder_xfs) EditDistributeArgs(
	log *logger.Logger,
	ret []string,
) (
	[]string,
	error,
) {

	info, err := self.bs.ReadInfo()
	if err != nil {
		return nil, err
	}

	ret = make([]string, 0)

	ret = append(ret, "install")

	// NOTE: looks like install-lib and install-dev has been deprecated

	{
		add_install_dev := true
		for _, i := range []string{"acl", "attr"} {
			if info.PackageName == i {
				add_install_dev = false
				break
			}
		}
		if add_install_dev {
			ret = append(ret, "install-dev")
		}
	}

	//	{
	//		add_install_lib := true
	//		for _, i := range []string{"acl", "attr", "xfsprogs", "xfsdump", "dmapi"} {
	//			if info.PackageName == i {
	//				add_install_lib = false
	//				break
	//			}
	//		}
	//		if add_install_lib {
	//			ret = append(ret, "install-lib")
	//		}
	//	}

	ret = append(ret, "DESTDIR="+self.bs.GetDIR_DESTDIR())

	return ret, nil
}
2018/07/12 20:19:06 -------------------------------------------------------
2018/07/12 20:19:06 Error parsing input file (outer block):
2018/07/12 20:19:06  /home/agu/gopath_work/src/github.com/AnimusPEXUS/aipsetup/buildercollection/xfs.go:38:10: expected selector or type assertion, found ';'
2018/07/12 20:19:06  /home/agu/gopath_work/src/github.com/AnimusPEXUS/aipsetup/buildercollection/xfs.go:40:2: expected ';', found 'return'
2018/07/12 20:19:06 Elapsed duration: 34.593214ms
2018/07/12 20:19:06 Offset: 0
2018/07/12 20:19:06 Number of candidates found: 0
2018/07/12 20:19:06 Candidates are:
2018/07/12 20:19:06 =======================================================


Panics with Go 1.11beta1/2: unknown export format version -1 ("i\x00\xf9")

Apparently, in Go 1.11 the binary format for the archives was changed (see also nsf#521 (comment)), any chance you may have time (or know someone) who could adapt the parser for the format? That'd be awesome! Not having any code completion in 1.11 made me realize how important this is...

The error and stacktrace is as follows:

$ gocode -s -debug
[...]
2018/07/21 13:42:36 Found "github.com/restic/restic/internal/test" at "/home/fd0/shared/work/go/pkg/linux_amd64/github.com/restic/restic/internal/test.a"
panic: unknown export format version -1 ("i\x00\xf9")
1(runtime.call32): /home/fd0/sdk/go1.11beta2/src/runtime/asm_amd64.s:522
2(runtime.gopanic): /home/fd0/sdk/go1.11beta2/src/runtime/panic.go:513
3(main.(*gc_bin_parser).parse_export): /home/fd0/shared/work/go/src/mod/github.com/nsf/[email protected]/package_bin.go:126
4(main.(*package_file_cache).process_package_data): /home/fd0/shared/work/go/src/mod/github.com/nsf/[email protected]/package.go:132
5(main.(*package_file_cache).update_cache): /home/fd0/shared/work/go/src/mod/github.com/nsf/[email protected]/package.go:92
6(main.update_packages.func1): /home/fd0/shared/work/go/src/mod/github.com/nsf/[email protected]/autocompletecontext.go:455
7(runtime.goexit): /home/fd0/sdk/go1.11beta2/src/runtime/asm_amd64.s:1333

Is there anything else I can do to get this resolved?

:GoInstallBinaries installs without .exe on Windows with GVIM

Did the following:

  • Installed Go freshly on a new laptop with the official msi (Windows 10 x64)
  • Installed vim-go with plug on GVIM 8.1
  • Ran :GoInstallBinaries in gvim

all binaries installed don't end with .exe resulting in vim-go features not functioning.

Running something like go get -u github.com/mdempsky/gocode from cmd seems to do the job as expected.

suggest: implement caching

In generating suggestions for cmd/compile/internal/ssa, the two big time overheads are:

  1. Parsing the sibling source files within the package
  2. Loading imports

If we could cache these results, then we'd be on par with nsf/gocode for suggestion performance.

Go1.11 Hangs when `-source` flag is provided

See: fatih/vim-go#2001

I have the same issues here as @pavannaganna and I have an almost identical setup (r.e. Go version and OS).

For me it actually hangs and gives 0 suggestions. The only fix being to turn off the source flag via the g:go_gocode_propose_source = 0.

I only raise this issue as prior to moving to go1.11 I never even knew this option existed and now I depend on it. Otherwise, the hang up talking to gocode constantly messes up my vim buffer.

auto install doesn't always work

Most of the time I'm working on multiple packages in the same time and the work flow goes like this:

  • libA: I need func libB.XX()
  • switch to libB and add XX
  • switch back to libA, try to auto complete and either I get completion without the new func or get "libB is not a valid type".
  • switch to libB and run go install ./... manually.
  • libA's libB completion works now.

I'm using VSCode, however the issue is mainly with gocode, I got the same result with neovim.

suggest: disambiguate struct literal contexts from function contexts

nsf/gocode committed nsf/gocode@1a78dd6 to handle completions like

func f() StructType {
   @
}

Currently, suggest thinks this is a StructType literal context (and so it suggests StructType's fields), but actually it's the start of a function block context (so it should suggest in-scope identifiers).

The above commit is incomplete, however. It doesn't handle cases like:

package p

func f() int

type T struct { g int }
func (T) m() int

var _ = f() * T{ @ }.m()

This should suggest "var g int", but nsf/gocode suggests "func f()" and "type T struct".

reference packages cannot be completed

Hi mdempsky๏ผThe reference package complete also cannot use,I use deoplete. These is Ok when I input fmt . ,the deoplete will prompt lot of method ๏ผŒIt's OKใ€‚
wx20180913-195712
but when i import package ,the method or variable which in the import package , the deoplete is not ok๏ผŒIt can't prompt these method ,variable and so on. I do not know if I have expressed clearly๏ผŒyou can see the pictures,this is my problem.
wx20180913-200000
I added this setting let g:deoplete#sources#go#source_importer = 1๏ผŒ It work๏ผŒBut the deoplete is a lot slowerใ€‚
wx20180913-200205
My go version 1.11 ,How to fix it, let the deoplete work without setting this, so the deoplete will not slow down.

suggest: fix hint for func-typed fields

Given

var ctx build.Context
ctx.IsD@

we currently hint:

var IsDir(path string) bool

That should be:

var IsDir func(path string) bool

At least in Emacs using company-go.

No candidates for package syscall/js

It seemed that gocode failed to provide autocompletion candidates for syscall/js package.

2018/09/11 10:56:31 Got autocompletion request for '/home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go'
2018/09/11 10:56:31 Cursor at: 99
2018/09/11 10:56:31 -------------------------------------------------------
package main

import (
        "fmt"
        "syscall/js"
)

func main() {
        fmt.Println("loaded")
        js.Global()
        j#
}
2018/09/11 10:56:31 -------------------------------------------------------
2018/09/11 10:56:31 Elapsed duration: 1.838556ms
2018/09/11 10:56:31 Offset: 0
2018/09/11 10:56:31 Number of candidates found: 1
2018/09/11 10:56:31 Candidates are:
2018/09/11 10:56:31   package js
2018/09/11 10:56:31 =======================================================
2018/09/11 10:56:32 Got autocompletion request for '/home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go'
2018/09/11 10:56:32 Cursor at: 101
2018/09/11 10:56:32 -------------------------------------------------------
package main

import (
        "fmt"
        "syscall/js"
)

func main() {
        fmt.Println("loaded")
        js.Global()
        js.#
}
2018/09/11 10:56:32 -------------------------------------------------------
2018/09/11 10:56:32 Error parsing input file (outer block):
2018/09/11 10:56:32  /home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go:11:5: expected selector or type assertion, found ';'
2018/09/11 10:56:32 Elapsed duration: 1.581609ms
2018/09/11 10:56:32 Offset: 0
2018/09/11 10:56:32 Number of candidates found: 0
2018/09/11 10:56:32 Candidates are:
2018/09/11 10:56:32 =======================================================
2018/09/11 10:56:32 Got autocompletion request for '/home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go'
2018/09/11 10:56:32 Cursor at: 121
2018/09/11 10:56:32 -------------------------------------------------------
package main
import "syscall/js"

import (
        "fmt"
        "syscall/js"
)

func main() {
        fmt.Println("loaded")
        js.Global()
        js.#
}
2018/09/11 10:56:32 -------------------------------------------------------
2018/09/11 10:56:32 Error parsing input file (outer block):
2018/09/11 10:56:32  /home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go:12:5: expected selector or type assertion, found ';'
2018/09/11 10:56:32 Elapsed duration: 1.676812ms
2018/09/11 10:56:32 Offset: 0
2018/09/11 10:56:32 Number of candidates found: 0
2018/09/11 10:56:32 Candidates are:
2018/09/11 10:56:32 =======================================================
2018/09/11 10:56:44 Got autocompletion request for '/home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go'
2018/09/11 10:56:44 Cursor at: 99
2018/09/11 10:56:44 -------------------------------------------------------
package main

import (
        "fmt"
        "syscall/js"
)

func main() {
        fmt.Println("loaded")
        js.Global()
        f#
}
2018/09/11 10:56:44 -------------------------------------------------------
2018/09/11 10:56:44 Elapsed duration: 1.977122ms
2018/09/11 10:56:44 Offset: 0
2018/09/11 10:56:44 Number of candidates found: 4
2018/09/11 10:56:44 Candidates are:
2018/09/11 10:56:44   const false untyped bool
2018/09/11 10:56:44   package fmt
2018/09/11 10:56:44   type float32 float32
2018/09/11 10:56:44   type float64 float64
2018/09/11 10:56:44 =======================================================
2018/09/11 10:56:44 Got autocompletion request for '/home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go'
2018/09/11 10:56:44 Cursor at: 102
2018/09/11 10:56:44 -------------------------------------------------------
package main

import (
        "fmt"
        "syscall/js"
)

func main() {
        fmt.Println("loaded")
        js.Global()
        fmt.#
}
2018/09/11 10:56:44 -------------------------------------------------------
2018/09/11 10:56:44 Error parsing input file (outer block):
2018/09/11 10:56:44  /home/ef/code/go/src/github.com/eternal-flame-AD/hellowasm/main.go:11:6: expected selector or type assertion, found ';'
2018/09/11 10:56:44 Elapsed duration: 2.87345ms
2018/09/11 10:56:44 Offset: 0
2018/09/11 10:56:44 Number of candidates found: 25
2018/09/11 10:56:44 Candidates are:
2018/09/11 10:56:44   func Errorf(format string, a ...interface{}) error
2018/09/11 10:56:44   func Fprint(w io.Writer, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Fscan(r io.Reader, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Print(a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Printf(format string, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Println(a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Scan(a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Scanf(format string, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Scanln(a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Sprint(a ...interface{}) string
2018/09/11 10:56:44   func Sprintf(format string, a ...interface{}) string
2018/09/11 10:56:44   func Sprintln(a ...interface{}) string
2018/09/11 10:56:44   func Sscan(str string, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Sscanf(str string, format string, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   func Sscanln(str string, a ...interface{}) (n int, err error)
2018/09/11 10:56:44   type Formatter interface
2018/09/11 10:56:44   type GoStringer interface
2018/09/11 10:56:44   type ScanState interface
2018/09/11 10:56:44   type Scanner interface
2018/09/11 10:56:44   type State interface
2018/09/11 10:56:44   type Stringer interface
2018/09/11 10:56:44 =======================================================

external packages cannot complete

I use neovim with deoplete. my go version is 1.10.3,

package abc
import "fmt"
func Test(){
fmt.Println("test gocode")}

I use package abc,the gocode can't work

package contro
import"EasyBlog/abc"
func Tdd(){
abc.
}

gocode -s -debug I got these

// Package contro provides ...
package contro
import(
"fmt"
"EasyBlog/abc"
)
func Tdd() {
abc.#
}
2018/09/16 22:35:29 -------------------------------------------------------
2018/09/16 22:35:29 Error parsing input file (outer block):
2018/09/16 22:35:29 /Users/marblues/workspace/src/EasyBlog/contro/index.go:8:6: expected selector or type assertion, found ';'
2018/09/16 22:35:29 Elapsed duration: 1.014442ms
2018/09/16 22:35:29 Offset: 0
2018/09/16 22:35:29 Number of candidates found: 0
2018/09/16 22:35:29 Candidates are:
2018/09/16 22:35:29 =======================================================

No code completions offered

I'm unclear on what causes completions not to be offered in the case below, hence I can't really reduce it down to a smaller test case (run within a Docker container to remove any conflict with pre-existing gocode instances):

$ export GOPATH=/tmp/tmp.SyFTUbXR6k
$ cd /tmp/tmp.bTi1vLg9Uo
$ mkdir -p src/example.com/hello
$ cd src/example.com/hello
$ export GOBIN=/tmp/tmp.bTi1vLg9Uo/src/example.com/hello/.bin
$ export PATH=/tmp/tmp.bTi1vLg9Uo/src/example.com/hello/.bin:/root/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ echo "package main" >pkg.go
$ go get github.com/mdempsky/gocode
$ pushd /tmp/tmp.bTi1vLg9Uo/src/github.com/mdempsky/gocode
/tmp/tmp.bTi1vLg9Uo/src/github.com/mdempsky/gocode /tmp/tmp.bTi1vLg9Uo/src/example.com/hello
$ git checkout 00e7f5ac290aeb20a3d8d31e737ae560a191a1d5
HEAD is now at 00e7f5a... internal/suggest: remove unnecessary candidates field
$ go install
$ popd
/tmp/tmp.bTi1vLg9Uo/src/example.com/hello
$ echo 'cGFja2FnZSBtYWluCgppbXBvcnQgKAoJImZsYWciCgkiZm10IgoJImdvL3R5cGVzIgoJIm9zIgoK
CSJnb2xhbmcub3JnL3gvdG9vbHMvZ28vcGFja2FnZXMiCikKCnR5cGUgRnJ1aXQgc3RydWN0IHsK
CU5hbWUgc3RyaW5nIGBoZWxsbzoid29ybGQiYAoJQWdlICBpbnQKfQoKdmFyIEJhbmFuYSAqRnJ1
aXQKCmZ1bmMgbWFpbigpIHsKCWZsYWcuUGFyc2UoKQoKCS8vIE1hbnkgdG9vbHMgcGFzcyB0aGVp
ciBjb21tYW5kLWxpbmUgYXJndW1lbnRzIChhZnRlciBhbnkgZmxhZ3MpCgkvLyB1bmludGVycHJl
dGVkIHRvIHBhY2thZ2VzLkxvYWQgc28gdGhhdCBpdCBjYW4gaW50ZXJwcmV0IHRoZW0KCS8vIGFj
Y29yZGluZyB0byB0aGUgY29udmVudGlvbnMgb2YgdGhlIHVuZGVybHlpbmcgYnVpbGQgc3lzdGVt
LgoJY2ZnIDo9ICZwYWNrYWdlcy5Db25maWd7TW9kZTogcGFja2FnZXMuTG9hZFR5cGVzfQoJcGtn
cywgZXJyIDo9IHBhY2thZ2VzLkxvYWQoY2ZnLCBmbGFnLkFyZ3MoKS4uLikKCWlmIGVyciAhPSBu
aWwgewoJCWZtdC5GcHJpbnRmKG9zLlN0ZGVyciwgImxvYWQ6ICV2XG4iLCBlcnIpCgkJb3MuRXhp
dCgxKQoJfQoJaWYgcGFja2FnZXMuUHJpbnRFcnJvcnMocGtncykgPiAwIHsKCQlvcy5FeGl0KDEp
Cgl9CgoJcGtnIDo9IHBrZ3NbMF0KCgliYW5hbmEgOj0gcGtnLlR5cGVzLlNjb3BlKCkuTG9va3Vw
KCJCYW5hbmEiKQoKCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCBiYW5hbmEuVHlwZSgpLCBiYW5h
bmEuVHlwZSgpKQoKCXggOj0gYmFuYW5hLlR5cGUoKS4oKnR5cGVzLlBvaW50ZXIpLkVsZW0oKS4o
KnR5cGVzLk5hbWVkKS5PYmooKS4KCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCB4LCB4KQp9Cg==' | base64 --decode >main.go
$ cat main.go
package main

import (
        "flag"
        "fmt"
        "go/types"
        "os"

        "golang.org/x/tools/go/packages"
)

type Fruit struct {
        Name string `hello:"world"`
        Age  int
}

var Banana *Fruit

func main() {
        flag.Parse()

        // Many tools pass their command-line arguments (after any flags)
        // uninterpreted to packages.Load so that it can interpret them
        // according to the conventions of the underlying build system.
        cfg := &packages.Config{Mode: packages.LoadTypes}
        pkgs, err := packages.Load(cfg, flag.Args()...)
        if err != nil {
                fmt.Fprintf(os.Stderr, "load: %v\n", err)
                os.Exit(1)
        }
        if packages.PrintErrors(pkgs) > 0 {
                os.Exit(1)
        }

        pkg := pkgs[0]

        banana := pkg.Types.Scope().Lookup("Banana")

        fmt.Printf("%T :: %v\n", banana.Type(), banana.Type())

        x := banana.Type().(*types.Pointer).Elem().(*types.Named).Obj().
        fmt.Printf("%T :: %v\n", x, x)
}
$ offset=812
$ tail -c +812 main.go
.Obj().
        fmt.Printf("%T :: %v\n", x, x)
}
$ gocode -in /tmp/tmp.bTi1vLg9Uo/src/example.com/hello/main.go autocomplete /tmp/tmp.bTi1vLg9Uo/src/example.com/hello/main.go 812
Found 7 candidates:
  func AddMethod(m *types.Func)
  func Method(i int) *types.Func
  func NumMethods() int
  func Obj() *types.TypeName
  func SetUnderlying(underlying types.Type)
  func String() string
  func Underlying() types.Type
$ offset=818
$ tail -c +818 main.go
.
        fmt.Printf("%T :: %v\n", x, x)
}
$ gocode -in /tmp/tmp.bTi1vLg9Uo/src/example.com/hello/main.go autocomplete /tmp/tmp.bTi1vLg9Uo/src/example.com/hello/main.go 818
Nothing to complete.

It doesn't appear to be anything to do with the completion being attempt at a line end because:

$ echo 'cGFja2FnZSBtYWluCgppbXBvcnQgKAoJImZsYWciCgkiZm10IgoJImdvL3R5cGVzIgoJIm9zIgoK
CSJnb2xhbmcub3JnL3gvdG9vbHMvZ28vcGFja2FnZXMiCikKCnR5cGUgRnJ1aXQgc3RydWN0IHsK
CU5hbWUgc3RyaW5nIGBoZWxsbzoid29ybGQiYAoJQWdlICBpbnQKfQoKdmFyIEJhbmFuYSAqRnJ1
aXQKCmZ1bmMgbWFpbigpIHsKCWZsYWcuUGFyc2UoKQoKCS8vIE1hbnkgdG9vbHMgcGFzcyB0aGVp
ciBjb21tYW5kLWxpbmUgYXJndW1lbnRzIChhZnRlciBhbnkgZmxhZ3MpCgkvLyB1bmludGVycHJl
dGVkIHRvIHBhY2thZ2VzLkxvYWQgc28gdGhhdCBpdCBjYW4gaW50ZXJwcmV0IHRoZW0KCS8vIGFj
Y29yZGluZyB0byB0aGUgY29udmVudGlvbnMgb2YgdGhlIHVuZGVybHlpbmcgYnVpbGQgc3lzdGVt
LgoJY2ZnIDo9ICZwYWNrYWdlcy5Db25maWd7TW9kZTogcGFja2FnZXMuTG9hZFR5cGVzfQoJcGtn
cywgZXJyIDo9IHBhY2thZ2VzLkxvYWQoY2ZnLCBmbGFnLkFyZ3MoKS4uLikKCWlmIGVyciAhPSBu
aWwgewoJCWZtdC5GcHJpbnRmKG9zLlN0ZGVyciwgImxvYWQ6ICV2XG4iLCBlcnIpCgkJb3MuRXhp
dCgxKQoJfQoJaWYgcGFja2FnZXMuUHJpbnRFcnJvcnMocGtncykgPiAwIHsKCQlvcy5FeGl0KDEp
Cgl9CgoJcGtnIDo9IHBrZ3NbMF0KCgliYW5hbmEgOj0gcGtnLlR5cGVzLlNjb3BlKCkuTG9va3Vw
KCJCYW5hbmEiKQoKCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCBiYW5hbmEuVHlwZSgpLCBiYW5h
bmEuVHlwZSgpKQoKCXggOj0gYmFuYW5hLlR5cGUoKS4oKnR5cGVzLlBvaW50ZXIpLkVsZW0oKS4o
KnR5cGVzLk5hbWVkKS4KCWZtdC5QcmludGYoIiVUIDo6ICV2XG4iLCB4LCB4KQp9Cg==' | base64 --decode >main.go
$ cat main.go
package main

import (
        "flag"
        "fmt"
        "go/types"
        "os"

        "golang.org/x/tools/go/packages"
)

type Fruit struct {
        Name string `hello:"world"`
        Age  int
}

var Banana *Fruit

func main() {
        flag.Parse()

        // Many tools pass their command-line arguments (after any flags)
        // uninterpreted to packages.Load so that it can interpret them
        // according to the conventions of the underlying build system.
        cfg := &packages.Config{Mode: packages.LoadTypes}
        pkgs, err := packages.Load(cfg, flag.Args()...)
        if err != nil {
                fmt.Fprintf(os.Stderr, "load: %v\n", err)
                os.Exit(1)
        }
        if packages.PrintErrors(pkgs) > 0 {
                os.Exit(1)
        }

        pkg := pkgs[0]

        banana := pkg.Types.Scope().Lookup("Banana")

        fmt.Printf("%T :: %v\n", banana.Type(), banana.Type())

        x := banana.Type().(*types.Pointer).Elem().(*types.Named).
        fmt.Printf("%T :: %v\n", x, x)
}
$ offset=812
$ tail -c +812 main.go
.
        fmt.Printf("%T :: %v\n", x, x)
}
$ gocode -in /tmp/tmp.jbHDztmOya/src/example.com/hello/main.go autocomplete /tmp/tmp.jbHDztmOya/src/example.com/hello/main.go 812
Found 7 candidates:
  func AddMethod(m *types.Func)
  func Method(i int) *types.Func
  func NumMethods() int
  func Obj() *types.TypeName
  func SetUnderlying(underlying types.Type)
  func String() string
  func Underlying() types.Type

Fully repro script can be found here:

https://gist.github.com/myitcv/a8977ab43dccf7a9c425ffde372c1e11

No completions for packages in the import block

When using nsf/gocode, we get completions for packages in the import block. The same isn't available when using mdempsky/gocode.

For example: In the below code, trigger completions from inside the "" in the import block

package main

import (
	""
)

func main() {
	
}

nsf/gocode gives:

screen shot 2018-07-15 at 5 31 48 pm

mdempsky/gocode gives:
screen shot 2018-07-15 at 5 30 41 pm

Builtins are suggested too eagerly

Hi there - Thanks for adding the -builtin flag - it's a good feature.

I notice, though, that builtins seem to be suggested too eagerly in a situation where I wouldn't expect them to be. For example, in the following, the completions false, make, uintptr, etc don't make sense.

2018/07/16 10:38:23 =======================================================
2018/07/16 10:38:33 Got autocompletion request for ''
2018/07/16 10:38:33 Cursor at: 50
2018/07/16 10:38:33 -------------------------------------------------------
package main

import "fmt"

func main() {
    fmt.#

}
2018/07/16 10:38:33 -------------------------------------------------------
2018/07/16 10:38:33 Error parsing input file (outer block):
2018/07/16 10:38:33  6:9: expected selector or type assertion, found ';'
2018/07/16 10:38:33 Elapsed duration: 0s
2018/07/16 10:38:33 Offset: 0
2018/07/16 10:38:33 Number of candidates found: 64
2018/07/16 10:38:33 Candidates are:
2018/07/16 10:38:33   const false untyped bool
2018/07/16 10:38:33   const iota untyped int
2018/07/16 10:38:33   const nil untyped nil
2018/07/16 10:38:33   const true untyped bool
2018/07/16 10:38:33   func Errorf(format string, a ...interface{}) error
2018/07/16 10:38:33   func Fprint(w io.Writer, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Fscan(r io.Reader, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Print(a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Printf(format string, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Println(a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Scan(a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Scanf(format string, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Scanln(a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Sprint(a ...interface{}) string
2018/07/16 10:38:33   func Sprintf(format string, a ...interface{}) string
2018/07/16 10:38:33   func Sprintln(a ...interface{}) string
2018/07/16 10:38:33   func Sscan(str string, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Sscanf(str string, format string, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func Sscanln(str string, a ...interface{}) (n int, err error)
2018/07/16 10:38:33   func append(slice []Type, elems ..Type) []Type
2018/07/16 10:38:33   func cap(v Type) int
2018/07/16 10:38:33   func close(c chan<- Type)
2018/07/16 10:38:33   func complex(real FloatType, imag FloatType) ComplexType
2018/07/16 10:38:33   func copy(dst []Type, src []Type) int
2018/07/16 10:38:33   func delete(m map[Key]Type, key Key)
2018/07/16 10:38:33   func imag(c ComplexType) FloatType
2018/07/16 10:38:33   func len(v Type) int
2018/07/16 10:38:33   func make(Type, size IntegerType) Type
2018/07/16 10:38:33   func new(Type) *Type
2018/07/16 10:38:33   func panic(v interface{})
2018/07/16 10:38:33   func print(args ...Type)
2018/07/16 10:38:33   func println(args ...Type)
2018/07/16 10:38:33   func real(c ComplexType) FloatType
2018/07/16 10:38:33   func recover() interface{}
2018/07/16 10:38:33   type Formatter interface
2018/07/16 10:38:33   type GoStringer interface
2018/07/16 10:38:33   type ScanState interface
2018/07/16 10:38:33   type Scanner interface
2018/07/16 10:38:33   type State interface
2018/07/16 10:38:33   type Stringer interface
2018/07/16 10:38:33   type bool bool
2018/07/16 10:38:33   type byte byte
2018/07/16 10:38:33   type complex128 complex128
2018/07/16 10:38:33   type complex64 complex64
2018/07/16 10:38:33   type error interface
2018/07/16 10:38:33   type float32 float32
2018/07/16 10:38:33   type float64 float64
2018/07/16 10:38:33   type int int
2018/07/16 10:38:33   type int16 int16
2018/07/16 10:38:33   type int32 int32
2018/07/16 10:38:33   type int64 int64
2018/07/16 10:38:33   type int8 int8
2018/07/16 10:38:33   type rune rune
2018/07/16 10:38:33   type string string
2018/07/16 10:38:33   type uint uint
2018/07/16 10:38:33   type uint16 uint16
2018/07/16 10:38:33   type uint32 uint32
2018/07/16 10:38:33   type uint64 uint64
2018/07/16 10:38:33   type uint8 uint8
2018/07/16 10:38:33   type uintptr uintptr
2018/07/16 10:38:33 =======================================================

Does not work with deoplete-go

I'm not quite sure what the issue is, but this version of gocode doesn't seem to work with deoplete-go. I've opened an issue there too. I'm happy to help debug, develop fixes, whatever, I'm just not sure where to start.

Gabage completion items when cursor is at the end of a keyword.

Normal result of company-diag:

Emacs 26.1.50 (x86_64-pc-linux-gnu) of 2018-08-19 on centos7.home
Company 0.9.6

company-backends: (company-go company-dabbrev-code)

Used backend: company-go
Major mode: go-mode
Prefix: "don"
Completions:
  #("done_chan" 0 9 (meta "var done_chan chan bool")) " chan bool"

Garbage completion after keyword "case":

Emacs 26.1.50 (x86_64-pc-linux-gnu) of 2018-08-19 on centos7.home
Company 0.9.6

company-backends: (company-go company-dabbrev-code)

Used backend: company-go
Major mode: go-mode
Prefix: "case"
Completions:
  #("Client_Handshake_timeout" 0 24 (meta "const Client_Handshake_timeout ")) " "
  #("Client_KeepAlive_timeout" 0 24 (meta "const Client_KeepAlive_timeout ")) " "
  #("MAX_DATA_pkt_size" 0 17 (meta "const MAX_DATA_pkt_size ")) " "
  #("MAX_Http_pkt_size" 0 17 (meta "const MAX_Http_pkt_size ")) " "
  #("OP_BINARY" 0 9 (meta "const OP_BINARY ")) " "
  #("OP_CLOSE" 0 8 (meta "const OP_CLOSE ")) " "
  #("OP_CONTINUE" 0 11 (meta "const OP_CONTINUE ")) " "
  #("OP_DATA_MAX" 0 11 (meta "const OP_DATA_MAX ")) " "
  #("OP_MAX" 0 6 (meta "const OP_MAX ")) " "
  #("OP_PING" 0 7 (meta "const OP_PING ")) " "
  #("OP_PONG" 0 7 (meta "const OP_PONG ")) " "
  #("OP_TEXT" 0 7 (meta "const OP_TEXT ")) " "

GO 1.11 PANIC - embedded struct field without name?

I'm not exactly sure what other tools gocode depends on, but this functionality works with go 1.10.4, then when I update to go 1.11, followed by vscode updating the following tools, I get a panic when auto-completing the following example (even via the command line).

Tools updated after updating to go 1.11:

  gocode
  gopkgs
  go-outline
  go-symbols
  guru
  gorename
  dlv
  godef
  godoc
  goreturns
  golint
  gomodifytags

Demo code:
src/main.go:

package main

import "service"

type Service struct {
    service.CommonService
}

func (svc *Service) GetName() {
    svc. // TRYING TO AUTO-COMPLETE THIS LINE
}

func main() {}

src/service/service.go:

package service


type CommonService struct {
    Name string
}

Then I ran this command:
./bin/gocode -in='./src/main.go' autocomplete ./src/main.go 123

and I get the following output:

Found 1 candidates:
  PANIC PANIC PANIC

If I run the server via ./bin/gocode -s -debug and make the request via vscode, I get the following panic info:

2018/09/28 01:28:24 Got autocompletion request for '/home/kevin/panic_demo/src/main.go'
2018/09/28 01:28:24 Cursor at: 123
2018/09/28 01:28:24 -------------------------------------------------------
package main

import "service"

type Service struct {
    service.CommonService
}

func (svc *Service) GetName() {
    svc.# // TRYING TO AUTO-COMPLETE THIS LINE
}

func main() {}
2018/09/28 01:28:24 -------------------------------------------------------
2018/09/28 01:28:24 Error parsing input file (outer block):
2018/09/28 01:28:24  /home/kevin/panic_demo/src/main.go:10:9: expected selector or type assertion, found ';'
panic: embedded struct field without name?

goroutine 35 [running]:
runtime/debug.Stack(0xb, 0xc00019b228, 0x1)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
runtime/debug.PrintStack()
	/usr/local/go/src/runtime/debug/stack.go:16 +0x22
main.(*Server).AutoComplete.func1(0xc00014c780)
	/home/kevin/panic_demo/src/github.com/mdempsky/gocode/server.go:72 +0x94
panic(0x82b980, 0x9500e0)
	/usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/mdempsky/gocode/internal/lookdot.walk(0x955000, 0xc000148850, 0xc000140101, 0xc00019b7f8)
	/home/kevin/panic_demo/src/github.com/mdempsky/gocode/internal/lookdot/lookdot.go:77 +0xaef
github.com/mdempsky/gocode/internal/lookdot.Walk(0xc00019b858, 0xc00019b7f8, 0x7c)
	/home/kevin/panic_demo/src/github.com/mdempsky/gocode/internal/lookdot/lookdot.go:12 +0xd2
github.com/mdempsky/gocode/internal/suggest.(*Config).Suggest(0xc00019ba90, 0xc0001463f0, 0x22, 0xc0001ae000, 0xb3, 0xb3, 0x7b, 0x4ae270, 0xc5eb40, 0x875000, ...)
	/home/kevin/panic_demo/src/github.com/mdempsky/gocode/internal/suggest/suggest.go:47 +0x5ac
main.(*Server).AutoComplete(0xc7cb78, 0xc00017c410, 0xc00014c780, 0x0, 0x0)
	/home/kevin/panic_demo/src/github.com/mdempsky/gocode/server.go:104 +0x210
reflect.Value.call(0xc0001421e0, 0xc00014e038, 0x13, 0x8d22bd, 0x4, 0xc00018cf18, 0x3, 0x3, 0xc00014a240, 0x82bc40, ...)
	/usr/local/go/src/reflect/value.go:447 +0x449
reflect.Value.Call(0xc0001421e0, 0xc00014e038, 0x13, 0xc000043718, 0x3, 0x3, 0x8a2260, 0x8b2101, 0xc00014a140)
	/usr/local/go/src/reflect/value.go:308 +0xa4
net/rpc.(*service).call(0xc00014a0c0, 0xc0000d4500, 0xc000150028, 0xc000150050, 0xc00017e000, 0xc00014c0e0, 0x817a40, 0xc00017c410, 0x16, 0x817a00, ...)
	/usr/local/go/src/net/rpc/server.go:384 +0x14e
created by net/rpc.(*Server).ServeCodec
	/usr/local/go/src/net/rpc/server.go:481 +0x47e

panic: types.Named.SetUnderlying: underlying type must not be *Named

Getting this with latest Go tip:

panic: types.Named.SetUnderlying: underlying type must not be *Named

goroutine 21 [running]:
runtime/debug.Stack(0xb, 0xc42046a218, 0x1)
    /Users/dan.peterson/Projects/go/project/go/src/runtime/debug/stack.go:24 +0x79
runtime/debug.PrintStack()
    /Users/dan.peterson/Projects/go/project/go/src/runtime/debug/stack.go:16 +0x22
main.(*Server).AutoComplete.func1(0xc420192200)
    /Users/dan.peterson/Projects/go/src/github.com/mdempsky/gocode/server.go:69 +0x9e
panic(0x3edf40, 0xc4201f3d40)
    /Users/dan.peterson/Projects/go/project/go/src/runtime/panic.go:458 +0x243
go/types.(*Checker).handleBailout(0xc4200d0380, 0xc42046b440)
    /Users/dan.peterson/Projects/go/project/go/src/go/types/check.go:213 +0xae
panic(0x3edf40, 0xc4201f3d40)
    /Users/dan.peterson/Projects/go/project/go/src/runtime/panic.go:458 +0x243
go/types.(*Named).SetUnderlying(0xc420209530, 0x672de0, 0xc42014a2d0)
    /Users/dan.peterson/Projects/go/project/go/src/go/types/type.go:418 +0x95
go/internal/gcimporter.(*importer).typ(0xc4202a0000, 0x0, 0x2b819a, 0xc4202a0000)
    /Users/dan.peterson/Projects/go/project/go/src/go/internal/gcimporter/bimport.go:287 +0x274
go/internal/gcimporter.(*importer).obj(0xc4202a0000, 0xfffffffffffffffd)
    /Users/dan.peterson/Projects/go/project/go/src/go/internal/gcimporter/bimport.go:187 +0x74f
go/internal/gcimporter.BImportData(0xc4201569c0, 0xc4202b8000, 0x3b46a, 0x3fe00, 0xc420196281, 0x30, 0x0, 0x30, 0x0, 0x1200000000)
    /Users/dan.peterson/Projects/go/project/go/src/go/internal/gcimporter/bimport.go:86 +0x34c
go/internal/gcimporter.Import(0xc4201569c0, 0xc420196281, 0x30, 0xc4200c72d0, 0x64, 0x0, 0x0, 0x0)
    /Users/dan.peterson/Projects/go/project/go/src/go/internal/gcimporter/gcimporter.go:166 +0x551
go/importer.gcimports.ImportFrom(0xc4201569c0, 0xc420196281, 0x30, 0xc4200c72d0, 0x64, 0x0, 0x30, 0xc41ffdf122, 0xc420276c00)
    /Users/dan.peterson/Projects/go/project/go/src/go/importer/importer.go:70 +0x67
github.com/mdempsky/gocode/gbimporter.(*importer).ImportFrom(0xc420196100, 0xc420196281, 0x30, 0xc4200c72d0, 0x64, 0x0, 0x0, 0x0, 0x0)
    /Users/dan.peterson/Projects/go/src/github.com/mdempsky/gocode/gbimporter/gbimporter.go:82 +0x35d
go/types.(*Checker).collectObjects(0xc4200d0380)
    /Users/dan.peterson/Projects/go/project/go/src/go/types/resolver.go:191 +0x81d
go/types.(*Checker).checkFiles(0xc4200d0380, 0xc420086660, 0x1, 0x1, 0x0, 0x0)
    /Users/dan.peterson/Projects/go/project/go/src/go/types/check.go:225 +0xaa
go/types.(*Checker).Files(0xc4200d0380, 0xc420086660, 0x1, 0x1, 0xc4201c0c60, 0xc42018d4c8)
    /Users/dan.peterson/Projects/go/project/go/src/go/types/check.go:218 +0x49
go/types.(*Config).Check(0xc4201bd640, 0x0, 0x0, 0xc420196140, 0xc420086660, 0x1, 0x1, 0xc4201c2460, 0xc4201c4c40, 0x8, ...)
    /Users/dan.peterson/Projects/go/project/go/src/go/types/api.go:344 +0x19f
github.com/mdempsky/gocode/suggest.(*Suggester).analyzePackage(0xc42046b8b3, 0xf581d8, 0xc420196100, 0xc4200c72d0, 0x6c, 0xc420198000, 0x1c6d, 0x1c6d, 0x1398, 0x0, ...)
    /Users/dan.peterson/Projects/go/src/github.com/mdempsky/gocode/suggest/suggest.go:110 +0x6bc
github.com/mdempsky/gocode/suggest.(*Suggester).Suggest(0xc42046b8b3, 0xf581d8, 0xc420196100, 0xc4200c72d0, 0x6c, 0xc420198000, 0x1c6d, 0x1c6d, 0x1398, 0x0, ...)
    /Users/dan.peterson/Projects/go/src/github.com/mdempsky/gocode/suggest/suggest.go:37 +0xcf
main.(*Server).AutoComplete(0x6b5a38, 0xc420104c30, 0xc420192200, 0x0, 0x0)
    /Users/dan.peterson/Projects/go/src/github.com/mdempsky/gocode/server.go:89 +0x188
reflect.Value.call(0xc420164300, 0xc42014e038, 0x13, 0x486b08, 0x4, 0xc42046bec0, 0x3, 0x3, 0x13d38, 0x0, ...)
    /Users/dan.peterson/Projects/go/project/go/src/reflect/value.go:434 +0x5c9
reflect.Value.Call(0xc420164300, 0xc42014e038, 0x13, 0xc42046bec0, 0x3, 0x3, 0x9, 0x9, 0x1000)
    /Users/dan.peterson/Projects/go/project/go/src/reflect/value.go:302 +0xa4
net/rpc.(*service).call(0xc420152340, 0xc420152100, 0xc4200758d0, 0xc420170180, 0xc420103820, 0x3de2e0, 0xc420104c30, 0x16, 0x3de2a0, 0xc420192200, ...)
    /Users/dan.peterson/Projects/go/project/go/src/net/rpc/server.go:383 +0x148
created by net/rpc.(*Server).ServeCodec
    /Users/dan.peterson/Projects/go/project/go/src/net/rpc/server.go:477 +0x421

go get fails for Go 1.8

Below is the logs from travis when trying to install gocode for Go 1.8

image

@stamblerre Did something change upstream that is causing this? There was no problem 2 days ago.

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.