Skip to content

Can't autocomplete,gocode debug can't find import package  #789

Closed
@ymakedaq

Description

@ymakedaq

Please direct general questions to:

Please review the documentation before filing an issue.
Helpful pages include:

Please answer these questions before submitting your issue. Thanks!

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.15.2 linux/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • September 2020 (version 1.50)
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.17.2
  • Run go env to get the go development environment details
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build111005529=/tmp/go-build -gno-record-gcc-switches"

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.

{
    "go.inferGopath": false,
    "go.gopath": "/data/project/cmdb",
    "go.autocompleteUnimportedPackages": true,
    "go.goroot": "/usr/local/go",
    "go.formatTool": "goimports",
    "go.toolsGopath": "/data/gotools_gopath/bin/",
    "go.gotoSymbol.includeImports": true,
    "go.useCodeSnippetsOnFunctionSuggest": true,
    // "go.useLanguageServer": true,
}

Describe the bug

Can't autocomplete
gocode debug gbimporter: no package found for github.com/ServiceComb/go-chassis/core/lager: can't find import
,variables prompt invaild type.
My vendor package is ok, build success

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. See error

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions