Skip to content

Red wave underline prompt about fisrt line of .mod file #2806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
John-zhan opened this issue Jun 9, 2023 · 3 comments
Open

Red wave underline prompt about fisrt line of .mod file #2806

John-zhan opened this issue Jun 9, 2023 · 3 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@John-zhan
Copy link

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

Version Information
* Run `go version` to get version of Go from _the VS Code integrated terminal_.

go version go1.20.3 windows/amd64

  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    `- Build info

golang.org/x/tools/gopls v0.12.1
golang.org/x/tools/[email protected] h1:s4mznBqCHVHeuTYjxGYJhsW3Wp4FYon8YAqiJlwlpTY=
github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/[email protected] h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/[email protected] h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
golang.org/x/exp/[email protected] h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
golang.org/x/[email protected] h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/[email protected] h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/[email protected] h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/[email protected] h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/[email protected] h1:rZCNEwRXLwl4xnXOEYY7jTuTh3+xNnsq8IfB2idOhD0=
golang.org/x/[email protected] h1:A9kONVi4+AnuOr1dopsibH6hLi1Huy54cbeJxnq4vmU=
honnef.co/go/[email protected] h1:6qXr+R5w+ktL5UkwEbPp+fEvfyoMPche6GkOpGHZcLc=
mvdan.cc/[email protected] h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/xurls/[email protected] h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.20.3`

  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
  • vscode version : 1.79.0/b380da4ef1ee00e224a15c1d4d9793e27c2b6302/x64
  • Check your installed extensions to get the version of the VS Code Go extension
  • v0.38.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.

    • `Checking configured tools....
      GOBIN: undefined
      toolsGopath:
      gopath: E:\path\GoPath
      GOROOT: D:\Program Files\GoLang
      PATH: D:\Program Files\python11\Scripts;D:\Program Files\python11;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet;C:\fastboot&adb;C:\Program Files\PuTTY;D:\Program Files\nginx-1.22.0;C:\WINDOWS\System32\OpenSSH;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Calibre2;C:\Program Files\Common Files\Autodesk Shared;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;D:\Program Files\Microsoft VS Code\bin;D:\Program Files\git\PortableGit\cmd;D:\Program Files\GoLang\bin;E:\path\GoPath\bin;C:\Users\W10\AppData\Local\Microsoft\WindowsApps;C:\Users\W10.dotnet\tools;;D:\Program Files\Microsoft VS Code\bin;C:\Users\W10\go\bin

    go: D:\Program Files\GoLang\bin\go.exe: go version go1.20.3 windows/amd64

    gotests: not installed
    gomodifytags: not installed
    impl: not installed
    goplay: not installed
    dlv: E:\path\GoPath\bin\dlv.exe (version: v1.20.2 built with go: go1.20.3)
    staticcheck: E:\path\GoPath\bin\staticcheck.exe (version: v0.4.3 built with go: go1.20.3)
    gopls: E:\path\GoPath\bin\gopls.exe (version: v0.12.2 built with go: go1.20.3)

go env
Workspace Folder (GO_learn): e:\Personaldata\code\Go\learn\github\GO_learn
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\W10\AppData\Local\go-build
set GOENV=C:\Users\W10\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=E:\path\GoPath\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\path\GoPath
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=D:\Program Files\GoLang
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Program Files\GoLang\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.3
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=e:\Personaldata\code\Go\learn\github\GO_learn\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\W10\AppData\Local\Temp\go-build384202488=/tmp/go-build -gno-record-gcc-switches

Workspace Folder (protocbuf): e:\Personaldata\code\Go\learn\github\protocbuf
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\W10\AppData\Local\go-build
set GOENV=C:\Users\W10\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=E:\path\GoPath\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\path\GoPath
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=D:\Program Files\GoLang
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Program Files\GoLang\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.3
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=NUL
set GOWORK=e:\Personaldata\code\Go\learn\github\protocbuf\go.work
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\W10\AppData\Local\Temp\go-build1735756535=/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.
Share all the settings with the go. or ["go"] or gopls prefixes.

Describe the bug

Red wave underline prompt about fisrt line of .mod file. and prompt my module does not contain main module or its selected dependencies. But my module work fine, and go run it is ok.

I don't want that red wave underline about my module line.

Steps to reproduce the behavior:

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

Screenshots or recordings

image

and attach a gopls server log
`[Info - 7:37:46 AM] 2023/06/09 07:37:46 go info for E:\Personaldata\code\Go\learn\github\GO_learn
(go dir E:\Personaldata\code\Go\learn\github\GO_learn)
(go version go version go1.20.3 windows/amd64)
(valid build configuration = true)
(build flags: [])
(selected go env: [GO111MODULE=on, GOCACHE=C:\Users\W10\AppData\Local\go-build, GOFLAGS=, GOMODCACHE=E:\path\GoPath\pkg\mod, GOPATH=E:\path\GoPath, GOPRIVATE=, GOROOT=D:\Program Files\GoLang, GOWORK=])

[Info - 7:37:47 AM] 2023/06/09 07:37:47 go info for E:\Personaldata\code\Go\learn\github\protocbuf
(go dir E:.)
(go version go version go1.20.3 windows/amd64)
(valid build configuration = true)
(build flags: [])
(selected go env: [GO111MODULE=on, GOCACHE=C:\Users\W10\AppData\Local\go-build, GOFLAGS=, GOMODCACHE=E:\path\GoPath\pkg\mod, GOPATH=E:\path\GoPath, GOPRIVATE=, GOROOT=D:\Program Files\GoLang, GOWORK=E:\Personaldata\code\Go\learn\github\protocbuf\go.work])

[Info - 7:37:47 AM] 2023/06/09 07:37:47 go/packages.Load #2
snapshot=0
directory=file:///E:/Personaldata/code/Go/learn/github/protocbuf
query=[E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto... E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest... E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB... builtin]
packages=4

[Info - 7:37:47 AM] 2023/06/09 07:37:47 go/packages.Load #2: updating metadata for 0 packages

[Error - 7:37:47 AM] 2023/06/09 07:37:47 initial workspace load failed: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

[Info - 7:37:47 AM] 2023/06/09 07:37:47 go/packages.Load #1
snapshot=0
directory=file:///E:/Personaldata/code/Go/learn/github/GO_learn
query=[E:\Personaldata\code\Go\learn\github\GO_learn... builtin]
packages=100

[Info - 7:37:47 AM] 2023/06/09 07:37:47 go/packages.Load #1: updating metadata for 198 packages

[Error - 7:37:47 AM] 2023/06/09 07:37:47 tidy: diagnosing file:///E:/Personaldata/code/Go/learn/github/GO_learn/go.mod: err: exit status 1: stderr: go: finding module for package google.golang.org/grpc
goLearn/myTest/packageUse/grpc/WithTransportCredentials/chatGPT/demo01 imports
google.golang.org/grpc: cannot find module providing package google.golang.org/grpc: module lookup disabled by GOPROXY=off

[Error - 7:37:47 AM] 2023/06/09 07:37:47 errors loading workspace: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

snapshot=0
directory=file:///E:/Personaldata/code/Go/learn/github/protocbuf

[Error - 7:37:48 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:37:48 AM] Request textDocument/semanticTokens/full failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:37:48 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Error - 7:37:49 AM] 2023/06/09 07:37:49 errors loading workspace: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

snapshot=1
directory=file:///E:/Personaldata/code/Go/learn/github/protocbuf

[Error - 7:44:49 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:44:49 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Info - 7:50:34 AM] 2023/06/09 07:50:34 go/packages.Load #5
snapshot=1
directory=file:///E:/Personaldata/code/Go/learn/github/GO_learn
query=[goLearn/myTest/packageUse/grpc/WithTransportCredentials/chatGPT/demo01]
packages=1

[Info - 7:50:34 AM] 2023/06/09 07:50:34 go/packages.Load #5
snapshot=1
directory=file:///E:/Personaldata/code/Go/learn/github/GO_learn
package="goLearn/myTest/packageUse/grpc/WithTransportCredentials/chatGPT/demo01"
files=[E:\Personaldata\code\Go\learn\github\GO_learn\myTest\packageUse\grpc\WithTransportCredentials\chatGPT\demo01\main.go]

[Info - 7:50:34 AM] 2023/06/09 07:50:34 go/packages.Load #5: updating metadata for 1 packages

[Info - 7:50:34 AM] 2023/06/09 07:50:34 reloadOrphanedFiles reloading
files=[file:///F:/softbackup/gitrepositry/watch/XTLS/REALITY/common.go]

[Info - 7:50:34 AM] 2023/06/09 07:50:34 go/packages.Load #4
snapshot=1
directory=file:///E:/Personaldata/code/Go/learn/github/GO_learn
query=[file=F:\softbackup\gitrepositry\watch\XTLS\REALITY\common.go]
packages=1

[Info - 7:50:34 AM] 2023/06/09 07:50:34 go/packages.Load #4
snapshot=1
directory=file:///E:/Personaldata/code/Go/learn/github/GO_learn
package="command-line-arguments"
files=[F:\softbackup\gitrepositry\watch\XTLS\REALITY\common.go]

[Info - 7:50:34 AM] 2023/06/09 07:50:34 go/packages.Load #4: updating metadata for 2 packages

[Error - 7:50:34 AM] Request textDocument/codeAction failed.
Message: context canceled
Code: 0
[Error - 7:50:34 AM] Request textDocument/semanticTokens/full failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:50:34 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:50:35 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:50:35 AM] 2023/06/09 07:50:35 tidy: diagnosing file:///E:/Personaldata/code/Go/learn/github/GO_learn/go.mod: err: exit status 1: stderr: go: finding module for package google.golang.org/grpc
goLearn/myTest/packageUse/grpc/WithTransportCredentials/chatGPT/demo01 imports
google.golang.org/grpc: cannot find module providing package google.golang.org/grpc: module lookup disabled by GOPROXY=off

[Error - 7:50:38 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Error - 7:50:39 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:50:39 AM] Request textDocument/semanticTokens/full failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:50:39 AM] 2023/06/09 07:50:39 tidy: diagnosing file:///E:/Personaldata/code/Go/learn/github/GO_learn/go.mod: err: exit status 1: stderr: go: finding module for package google.golang.org/grpc
goLearn/myTest/packageUse/grpc/WithTransportCredentials/chatGPT/demo01 imports
google.golang.org/grpc: cannot find module providing package google.golang.org/grpc: module lookup disabled by GOPROXY=off

[Info - 7:51:03 AM] 2023/06/09 07:51:03 background imports cache refresh starting

[Info - 7:51:04 AM] 2023/06/09 07:51:04 background refresh finished after 982.1245ms

[Error - 7:51:36 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Error - 7:51:36 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:51:36 AM] Request textDocument/semanticTokens/full failed.
Message: semantictokens are disabled
Code: 0
[Error - 7:59:59 AM] 2023/06/09 07:59:59 errors loading workspace: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

snapshot=2
directory=file:///E:/Personaldata/code/Go/learn/github/protocbuf

[Error - 8:07:12 AM] Request textDocument/semanticTokens/full failed.
Message: semantictokens are disabled
Code: 0
[Error - 8:07:12 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Error - 8:07:12 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 8:07:13 AM] 2023/06/09 08:07:13 errors loading workspace: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

snapshot=3
directory=file:///E:/Personaldata/code/Go/learn/github/protocbuf

[Error - 8:10:07 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 8:10:07 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Error - 8:10:10 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0
[Error - 8:10:10 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Error - 8:10:45 AM] Request textDocument/inlayHint failed.
Message: 3 modules have errors:
helloProto:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto...: directory prefix ..\protocbuf\bilibili\qimiao\helloProto does not contain main module or its selected dependencies
qimiaoGPRCtest:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoGPRCtest does not contain main module or its selected dependencies
qimiaoPB:pattern E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB...: directory prefix ..\protocbuf\bilibili\qimiao\qimiaoPB does not contain main module or its selected dependencies

Code: 0
[Error - 8:10:45 AM] Request textDocument/semanticTokens/range failed.
Message: semantictokens are disabled
Code: 0 `

@gopherbot gopherbot added this to the Untriaged milestone Jun 9, 2023
@hyangah
Copy link
Contributor

hyangah commented Jun 9, 2023

Thanks for sharing the screenshot and gopls trace. @John-zhan

  • Can you share the contents of your go.work file (E:\Personaldata\code\Go\learn\github\protocbuf\go.work) to help repro?

  • Can you also try to open only E:\Personaldata\code\Go\learn\github\protocbuf from a separate window instead of using multiple workspace folders and see if that works?

We rarely saw environment set up involving multi-folder workspace + go.work + nested multiple modules all at once, so it's possible that we are not handling this case well yet.

cc @golang/tools-team @findleyr

Looks like the window was open from E:\ and has two workspace folders. (GO_learn and protocbuf) and protocbuf has go.work.

+  E:\Personaldata\code\Go\learn\github\GO_learn
+  E:\Personaldata\code\Go\learn\github\protocbuf
     +  go.work
     +  bilibili\qimiao
            + helloProto
                 + go.mod
            + qimiaoGPRCtest
                 + go.mod
            + qimiaoPB
                 + go.mod

I noticed a couple of suspicious things but I am not yet sure if they are relevant to the root cause.

  1. the second vscode workspace folder (protocbuf) has E: as the view's working directory ((go dir E:.)). The first folder has reasonable directory on the other hand.
[Info - 7:37:47 AM] 2023/06/09 07:37:47 go info for E:\Personaldata\code\Go\learn\github\protocbuf
(go dir E:.)
(go version go version go1.20.3 windows/amd64)
(valid build configuration = true)
(build flags: [])
(selected go env: [GO111MODULE=on, GOCACHE=C:\Users\W10\AppData\Local\go-build, GOFLAGS=, GOMODCACHE=E:\path\GoPath\pkg\mod, GOPATH=E:\path\GoPath, GOPRIVATE=, GOROOT=D:\Program Files\GoLang, GOWORK=E:\Personaldata\code\Go\learn\github\protocbuf\go.work])

but the following go/packages.Load message shows a different folder as the directory. Which directory gopls would use when running go commands?

  1. the package loading query patterns seem strange. "E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto... " is not a valid pattern. I think this may be just a logging error (wrongly printing the windows separator?)
[Info - 7:37:47 AM] 2023/06/09 07:37:47 go/packages.Load #2
snapshot=0
directory=file:///E:/Personaldata/code/Go/learn/github/protocbuf
query=[E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto... E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest... E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB... builtin]
packages=4

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 9, 2023
@John-zhan
Copy link
Author

here is my go.work
image

@John-zhan
Copy link
Author

Thanks for sharing the screenshot and gopls trace. @John-zhan

  • Can you share the contents of your go.work file (E:\Personaldata\code\Go\learn\github\protocbuf\go.work) to help repro?
  • Can you also try to open only E:\Personaldata\code\Go\learn\github\protocbuf from a separate window instead of using multiple workspace folders and see if that works?

We rarely saw environment set up involving multi-folder workspace + go.work + nested multiple modules all at once, so it's possible that we are not handling this case well yet.

cc @golang/tools-team @findleyr

Looks like the window was open from E:\ and has two workspace folders. (GO_learn and protocbuf) and protocbuf has go.work.

+  E:\Personaldata\code\Go\learn\github\GO_learn
+  E:\Personaldata\code\Go\learn\github\protocbuf
     +  go.work
     +  bilibili\qimiao
            + helloProto
                 + go.mod
            + qimiaoGPRCtest
                 + go.mod
            + qimiaoPB
                 + go.mod

I noticed a couple of suspicious things but I am not yet sure if they are relevant to the root cause.

  1. the second vscode workspace folder (protocbuf) has E: as the view's working directory ((go dir E:.)). The first folder has reasonable directory on the other hand.
[Info - 7:37:47 AM] 2023/06/09 07:37:47 go info for E:\Personaldata\code\Go\learn\github\protocbuf
(go dir E:.)
(go version go version go1.20.3 windows/amd64)
(valid build configuration = true)
(build flags: [])
(selected go env: [GO111MODULE=on, GOCACHE=C:\Users\W10\AppData\Local\go-build, GOFLAGS=, GOMODCACHE=E:\path\GoPath\pkg\mod, GOPATH=E:\path\GoPath, GOPRIVATE=, GOROOT=D:\Program Files\GoLang, GOWORK=E:\Personaldata\code\Go\learn\github\protocbuf\go.work])

but the following go/packages.Load message shows a different folder as the directory. Which directory gopls would use when running go commands?

  1. the package loading query patterns seem strange. "E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto... " is not a valid pattern. I think this may be just a logging error (wrongly printing the windows separator?)
[Info - 7:37:47 AM] 2023/06/09 07:37:47 go/packages.Load #2
snapshot=0
directory=file:///E:/Personaldata/code/Go/learn/github/protocbuf
query=[E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\helloProto... E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoGPRCtest... E:\Personaldata\code\Go\learn\github\protocbuf\bilibili\qimiao\qimiaoPB... builtin]
packages=4

when open only E:\Personaldata\code\Go\learn\github\protocbuf from a separate window instead of using multiple workspace folders, this problem not prompt, just like everything is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants