-
Notifications
You must be signed in to change notification settings - Fork 645
Autocomplete is missing after using gocode-gomod #2148
Comments
I have the same problem 0² tree -L 1
.
├── go.mod
└── main.go
0 directories, 2 files 0² go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/shaodahong/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/shaodahong/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/shaodahong/Workspace/demo/go.mod"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/j3/1mmzgr1j51s_kgdg28ksn7b40000gn/T/go-build815312150=/tmp/go-build -gno-record-gcc-switches -fno-common" 0² go version
go version go1.11.2 darwin/amd64 |
cc @stamblerre |
@avence12: in your case, I notice that @shaodahong: I added some additional logging to gocode-gomod in stamblerre/gocode@02c18bb. Could you try syncing to head and pasting in the output of |
0² gocode-gomod -s -debug
2018/11/27 12:17:51 Got autocompletion request for '/Users/shaodahong/Workspace/demo/main.go'
2018/11/27 12:17:51 Cursor at: 49
2018/11/27 12:17:51 -------------------------------------------------------
package main
import (
"fmt"
)
func main() {
f#
}
2018/11/27 12:17:51 -------------------------------------------------------
2018/11/27 12:17:51 Elapsed duration: 214.123096ms
2018/11/27 12:17:51 Offset: 0
2018/11/27 12:17:51 Number of candidates found: 4
2018/11/27 12:17:51 Candidates are:
2018/11/27 12:17:51 const false untyped bool
2018/11/27 12:17:51 package fmt
2018/11/27 12:17:51 type float32 float32
2018/11/27 12:17:51 type float64 float64
2018/11/27 12:17:51 =======================================================
2018/11/27 12:17:52 Got autocompletion request for '/Users/shaodahong/Workspace/demo/main.go'
2018/11/27 12:17:52 Cursor at: 52
2018/11/27 12:17:52 -------------------------------------------------------
package main
import (
"fmt"
)
func main() {
fmt.#
}
2018/11/27 12:17:52 -------------------------------------------------------
2018/11/27 12:17:52 Elapsed duration: 177.578011ms
2018/11/27 12:17:52 Offset: 0
2018/11/27 12:17:52 Number of candidates found: 25
2018/11/27 12:17:52 Candidates are:
2018/11/27 12:17:52 func Errorf(format string, a ...interface{}) error
2018/11/27 12:17:52 func Fprint(w io.Writer, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Fscan(r io.Reader, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Print(a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Printf(format string, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Println(a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Scan(a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Scanf(format string, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Scanln(a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Sprint(a ...interface{}) string
2018/11/27 12:17:52 func Sprintf(format string, a ...interface{}) string
2018/11/27 12:17:52 func Sprintln(a ...interface{}) string
2018/11/27 12:17:52 func Sscan(str string, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Sscanf(str string, format string, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 func Sscanln(str string, a ...interface{}) (n int, err error)
2018/11/27 12:17:52 type Formatter interface
2018/11/27 12:17:52 type GoStringer interface
2018/11/27 12:17:52 type ScanState interface
2018/11/27 12:17:52 type Scanner interface
2018/11/27 12:17:52 type State interface
2018/11/27 12:17:52 type Stringer interface
2018/11/27 12:17:52 =======================================================
|
@shaodahong: ok, so it seems like it's working for you actually. So I think your problem is probably the one being discussed on #1944, so let's move the discussion there. |
I realize I posted $ go env
GOARCH="amd64"
GOBIN="/Users/avence12/devel/opensource/gotools/bin"
GOCACHE="/Users/avence12/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/avence12/devel/opensource/gotools"
GOPROXY=""
GORACE=""
GOROOT="/Users/avence12/.gvm/gos/go1.11.1"
GOTMPDIR=""
GOTOOLDIR="/Users/avence12/.gvm/gos/go1.11.1/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/tmp/golang-exmaple/go.mod"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/tx/y15w994j5cjg8r1nxh2704940000gn/T/go-build481121418=/tmp/go-build -gno-record-gcc-switches -fno-common" After upgrading to stamblerre/gocode@02c18bb, I can see some new information. |
@avence12: I don't think it should matter, but it's worth noting that you have a typo: From your |
I have fixed the typo but no luck. $ go list -json -compiled
{
"Dir": "/private/tmp/golang-example",
"ImportPath": "golang-example",
"Name": "main",
"Target": "/Users/avence12/devel/opensource/gotools/bin/golang-example",
"Module": {
"Path": "golang-example",
"Main": true,
"Dir": "/private/tmp/golang-example",
"GoMod": "/private/tmp/golang-example/go.mod"
},
"Match": [
"."
],
"Stale": true,
"StaleReason": "build ID mismatch",
"GoFiles": [
"main.go"
],
"CompiledGoFiles": [
"main.go"
],
"Imports": [
"fmt"
],
"Deps": [
"errors",
"fmt",
"internal/bytealg",
"internal/cpu",
"internal/poll",
"internal/race",
"internal/syscall/unix",
"internal/testlog",
"io",
"math",
"math/bits",
"os",
"reflect",
"runtime",
"runtime/internal/atomic",
"runtime/internal/sys",
"strconv",
"sync",
"sync/atomic",
"syscall",
"time",
"unicode",
"unicode/utf8",
"unsafe"
]
} Results of
My workspace settings:
According to stamblerre/gocode@02c18bb, it did not throw error nor load any packages. |
can you try |
Also, I just made a small change, so if you can try syncing to head again, it might fix the issue. (Remember to run |
Autocomplete works well after using Thanks for your awesome support. |
I used solutions of https://github.com/ikgo/gocode and https://github.com/ikgo/gopkgs for my Go Module projects since Oct. and everything goes well.
After upgrade to latest vscode-go and all dependencies of go tools, autocomplete is missing on std/import/local libraries even from scratch.
Information:
Steps to Reproduce:
go mod init golang-example
gocode-gomod close ; gocode-gomod -s -debug
to enable debug modefmt
packagego list -json -compiled
ls $GOPATH/bin
go env
The text was updated successfully, but these errors were encountered: