Skip to content

cant jump to define on mac big sur vscode #919

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

Closed
Kurt-Shiwz opened this issue Nov 14, 2020 · 12 comments
Closed

cant jump to define on mac big sur vscode #919

Kurt-Shiwz opened this issue Nov 14, 2020 · 12 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@Kurt-Shiwz
Copy link

os: mac big sur
go extension: 0.18.1
go:1.42 (go mod)

vscode:
Version: 1.51.1
Commit: e5a624b
Date: 2020-11-11T01:11:34.018Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 20.1.0

@stamblerre
Copy link
Contributor

Can you please share the Go related settings you have added/edited? You can do so by running Preferences: Open Settings (JSON) command to open your settings.json file. Please share all the settings with the go. or ["go"] or gopls prefixes.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 14, 2020
@Kurt-Shiwz
Copy link
Author

Kurt-Shiwz commented Nov 16, 2020

Can you please share the Go related settings you have added/edited? You can do so by running Preferences: Open Settings (JSON) command to open your settings.json file. Please share all the settings with the go. or ["go"] or gopls prefixes.

befor i upgrade mac to big sur, it works

// user setting
"go.useLanguageServer": true,
"go.goroot": "/usr/local/opt/go/libexec",
"go.toolsGopath": "/Users/${env:USER}/go",
"go.docsTool": "guru",
"go.formatTool": "goimports",
// "go.formatFlags": [
// "-s"
// ],
"go.lintOnSave": "workspace",
"go.languageServerExperimentalFeatures": {
"diagnostics": true,
"documentLink": true
},
"go.toolsEnvVars": {
"GO111MODULE": "auto"
},
"[go]": {
"editor.snippetSuggestions": "top",
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},

// workspace
{
"go.lintOnSave": "off",
"files.autoSave": "off",
// "go.gopath": "/Users/kurt/project/gocode/lcode",
"go.useLanguageServer": false,
"go.toolsEnvVars": {
"GO111MODULE": "auto"
},
"terminal.integrated.env.osx": {
"GO111MODULE": "auto"
},
}

@stamblerre
Copy link
Contributor

Is there a reason that you have "go.useLanguageServer": false in your workspace settings, but "go.useLanguageServer": true in your user settings? I would recommend using the language server if you can.

@Kurt-Shiwz
Copy link
Author

Is there a reason that you have "go.useLanguageServer": false in your workspace settings, but "go.useLanguageServer": true in your user settings? I would recommend using the language server if you can.

it is not the reason. because use LanguageServer is slowly,.
so i close it and run "go mod vendor " then open "go.gopath": "/Users/kurt/project/gocode/lcode", it work well befor.

now i set useLanguageServer to true and unset gopath , it doesn't work yet.

@stamblerre
Copy link
Contributor

stamblerre commented Nov 17, 2020

The extension is transitioning to always using the language server, so it's probably best to figure out why it's not working. Can you please follow the troubleshooting steps and share a log? https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs

@Kurt-Shiwz
Copy link
Author

The extension is transitioning to always using the language server, so it's probably best to figure out why it's not working. Can you please follow the troubleshooting steps and share a log? https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs

// workspace setting
{
"go.lintOnSave": "off",
"files.autoSave": "off",
// "go.gopath": "/Users/kurt/project/gocode/lcode",
"go.useLanguageServer": true,
"go.toolsEnvVars": {
"GO111MODULE": "auto"
},
"terminal.integrated.env.osx": {
"GO111MODULE": "auto"
},
"go.languageServerFlags": [
"-rpc.trace"
]
}

// go.mod
// on src run "go mod init github.com/lcode"
module github.com/lcode

go 1.14

// code:
// main.go:/Users/kurt/project/gocode/lcode/src/lcode/main.go
// code_heap.go:/Users/kurt/project/gocode/lcode/src/lcode/code_heap/code_heap.go
package main

import (
"fmt"

"github.com/lcode/code/code_heap"

)

func main() {
fmt.Printf("HeapSort:%+v\n", code_heap.HeapSort([]int{10, 29, 4, 2, 6, 1, 7, 3, 19, 15}))
}

// log:
[Trace - 23:30:16.984 PM] Sending request 'initialize - (0)'.
Params: {"processId":5880,"clientInfo":{"name":"vscode","version":"1.51.1"},"rootPath":"/Users/kurt/project/gocode/lcode","rootUri":"file:///Users/kurt/project/gocode/lcode","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"complexDiagnosticCodeSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveAdditionalTextEditsSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]}},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","member","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}}}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///Users/kurt/project/gocode/lcode","name":"lcode"}]}

[Trace - 23:30:16.985 PM] Received response 'initialize - (0)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"executeCommandProvider":{"commands":["gopls.generate","gopls.fill_struct","gopls.regenerate_cgo","gopls.test","gopls.tidy","gopls.undeclared_name","gopls.add_dependency","gopls.upgrade_dependency","gopls.remove_dependency","gopls.vendor","gopls.extract_variable","gopls.extract_function","gopls.gc_details","gopls.generate_gopls_mod"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{"path":"golang.org/x/tools/gopls","version":"v0.5.3","sum":"h1:C8QSrqjqaVzlVoHL1R9yWbROoOApRgI8gN1G+cHlPuw=","deps":[{"path":"github.com/BurntSushi/toml","version":"v0.3.1","sum":"h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ="},{"path":"github.com/google/go-cmp","version":"v0.5.1","sum":"h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k="},{"path":"github.com/sergi/go-diff","version":"v1.1.0","sum":"h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0="},{"path":"golang.org/x/mod","version":"v0.3.0","sum":"h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4="},{"path":"golang.org/x/sync","version":"v0.0.0-20201020160332-67f06af15bc9","sum":"h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck="},{"path":"golang.org/x/tools","version":"v0.0.0-20201110032815-ae45d7cf37a9","sum":"h1:S0ATUNSw92bO7f5Z+1tSQsq48TdQs2Ye2rTGJdtf5qc="},{"path":"golang.org/x/xerrors","version":"v0.0.0-20200804184101-5ec99f83aff1","sum":"h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE="},{"path":"honnef.co/go/tools","version":"v0.0.1-2020.1.6","sum":"h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc="},{"path":"mvdan.cc/gofumpt","version":"v0.0.0-20200927160801-5bfeb2e70dd6","sum":"h1:z+/YqapuV7VZPvBb3GYmuEJbA88M3PFUxaHilHYVCpQ="},{"path":"mvdan.cc/xurls/v2","version":"v2.2.0","sum":"h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A="}]}"}}

[Trace - 23:30:17.100 PM] Sending notification 'initialized'.
Params: {}

[Trace - 23:30:17.101 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go","languageId":"go","version":1,"text":"package main\n\nimport (\n\t"fmt"\n\n\t"github.com/lcode/code/code_heap"\n)\n\nfunc main() {\n\tfmt.Printf("HeapSort:%+v\n", code_heap.HeapSort([]int{10, 29, 4, 2, 6, 1, 7, 3, 19, 15}))\n\t// fmt.Printf("MergeSort:%+v\n", code_mergesort.MergeSort([]int{10, 29, 4, 2, 6, 1, 7, 3, 19, 15}))\n\t// mtrix := [][]int{{3, 8, 6, 0, 5, 9, 9, 6, 3, 4, 0, 5, 7, 3, 9, 3}, {0, 9, 2, 5, 5, 4, 9, 1, 4, 6, 9, 5, 6, 7, 3, 2}, {8, 2, 2, 3, 3, 3, 1, 6, 9, 1, 1, 6, 6, 2, 1, 9}, {1, 3, 6, 9, 9, 5, 0, 3, 4, 9, 1, 0, 9, 6, 2, 7}, {8, 6, 2, 2, 1, 3, 0, 0, 7, 2, 7, 5, 4, 8, 4, 8}, {4, 1, 9, 5, 8, 9, 9, 2, 0, 2, 5, 1, 8, 7, 0, 9}, {6, 2, 1, 7, 8, 1, 8, 5, 5, 7, 0, 2, 5, 7, 2, 1}, {8, 1, 7, 6, 2, 8, 1, 2, 2, 6, 4, 0, 5, 4, 1, 3}, {9, 2, 1, 7, 6, 1, 4, 3, 8, 6, 5, 5, 3, 9, 7, 3}, {0, 6, 0, 2, 4, 3, 7, 6, 1, 3, 8, 6, 9, 0, 0, 8}, {4, 3, 7, 2, 4, 3, 6, 4, 0, 3, 9, 5, 3, 6, 9, 3}, {2, 1, 8, 8, 4, 5, 6, 5, 8, 7, 3, 7, 7, 5, 8, 3}, {0, 7, 6, 6, 1, 2, 0, 3, 5, 0, 8, 0, 8, 7, 4, 3}, {0, 4, 3, 4, 9, 0, 1, 9, 7, 7, 8, 6, 4, 6, 9, 5}, {6, 5, 1, 9, 9, 2, 2, 7, 4, 2, 7, 2, 2, 3, 7, 2}, {7, 1, 9, 6, 1, 2, 7, 0, 9, 6, 6, 4, 4, 5, 1, 0}, {3, 4, 9, 2, 8, 3, 1, 2, 6, 9, 7, 0, 2, 4, 2, 0}, {5, 1, 8, 8, 4, 6, 8, 5, 2, 4, 1, 6, 2, 2, 9, 7}}\n\t// fmt.Printf("min sum:%d\n", code.MinPathSum(mtrix))\n\t// fmt.Printf("findMedianSortedArrays:%+v\n", code.FindMedianSortedArrays([]int{}, []int{2, 3}))\n\t// fmt.Printf("findMedianSortedArrays:%+v\n", code.FindMedianSortedArrays([]int{}, []int{1}))\n\t// fmt.Printf("findMedianSortedArrays:%+v\n", code.FindMedianSortedArrays([]int{1, 2}, []int{3, 4}))\n\t// fmt.Printf("findMedianSortedArrays:%+v\n", code.FindMedianSortedArrays([]int{1, 3}, []int{2}))\n\t// fmt.Printf("findMedianSortedArrays:%+v\n", code.FindMedianSortedArrays([]int{2}, []int{}))\n\t// fmt.Printf("IsPalindrome:%+v\n", code_9.IsPalindrome(121))\n\t// fmt.Printf("LongestPalindrome:%+v\n", code_5.LongestPalindrome("aaaa"))\n\t// "github.com/lcode/code"\n\t// "github.com/lcode/code/code_5"\n\t// "github.com/lcode/code/code_9"\n\t// "github.com/lcode/code/code_heap"\n\t// "github.com/lcode/code/code_mergesort"\n\t// "lcode/code"\n\t// "lcode/code/code_5"\n\t// "lcode/code/code_9"\n\t// "lcode/code/code_heap"\n\t// "lcode/code/code_mergesort"\n}\n"}}

[Trace - 23:30:17.101 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5577006791947779410"}

[Trace - 23:30:17.125 PM] Sending response 'window/workDoneProgress/create - (1)' in 23ms.
Result:

[Trace - 23:30:17.127 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}

[Trace - 23:30:17.127 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///Users/kurt/project/gocode/lcode","section":"gopls"},{"scopeUri":"file:///Users/kurt/project/gocode/lcode","section":"gopls-lcode"}]}

[Trace - 23:30:17.197 PM] Sending response 'workspace/configuration - (2)' in 69ms.
Result: [null,null]

[Trace - 23:30:17.300 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:17 go env for /Users/kurt/project/gocode/lcode\n(root /Users/kurt/project/gocode/lcode)\n(go version go version go1.14.2 darwin/amd64)\n(valid build configuration = false)\n(build flags: [])\nGONOPROXY=.persional.net\nGOPRIVATE=.persional.net\nGOINSECURE=\nGONOSUMDB=*.persional.net\nGOCACHE=/Users/kurt/Library/Caches/go-build\nGOFLAGS=\nGOMOD=\nGOMODCACHE=\nGOPATH=/Users/kurt/go\nGOROOT=/usr/local/opt/go/libexec\nGOSUMDB=sum.golang.org\nGOPROXY=https://goproxy.cn\nGO111MODULE=auto\n\n"}

[Trace - 23:30:17.301 PM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7}]}}]}

[Trace - 23:30:17.328 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:17 go/packages.Load\n\tsnapshot=0\n\tdirectory=/Users/kurt/project/gocode/lcode\n\tquery=[./ builtin]\n\tpackages=2\n"}

[Trace - 23:30:17.332 PM] Received notification '$/progress'.
Params: {"token":"5577006791947779410","value":{"kind":"end","message":"Finished loading packages."}}

[Trace - 23:30:17.375 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:17 go/packages.Load\n\tsnapshot=0\n\tdirectory=/Users/kurt/project/gocode/lcode\n\tquery=[./]\n\tpackages=1\n"}

[Info - 11:30:17 PM] 2020/11/17 23:30:17 go env for /Users/kurt/project/gocode/lcode
(root /Users/kurt/project/gocode/lcode)
(go version go version go1.14.2 darwin/amd64)
(valid build configuration = false)
(build flags: [])
GONOPROXY=.persional.net
GOPRIVATE=
.persional.net
GOINSECURE=
GONOSUMDB=*.persional.net
GOCACHE=/Users/kurt/Library/Caches/go-build
GOFLAGS=
GOMOD=
GOMODCACHE=
GOPATH=/Users/kurt/go
GOROOT=/usr/local/opt/go/libexec
GOSUMDB=sum.golang.org
GOPROXY=https://goproxy.cn
GO111MODULE=auto

[Info - 11:30:17 PM] 2020/11/17 23:30:17 go/packages.Load
snapshot=0
directory=/Users/kurt/project/gocode/lcode
query=[./ builtin]
packages=2

[Trace - 23:30:17.549 PM] Sending response 'client/registerCapability - (3)' in 248ms.
Result:

[Trace - 23:30:17.549 PM] Sending request 'textDocument/documentSymbol - (1)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"}}

[Trace - 23:30:17.549 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"},{"id":"workspace/didChangeWorkspaceFolders","method":"workspace/didChangeWorkspaceFolders"}]}

[Info - 11:30:17 PM] 2020/11/17 23:30:17 go/packages.Load
snapshot=0
directory=/Users/kurt/project/gocode/lcode
query=[./]
packages=1

[Trace - 23:30:17.843 PM] Sending response 'client/registerCapability - (4)' in 293ms.
Result:

[Trace - 23:30:17.869 PM] Sending request 'textDocument/codeAction - (2)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"},"range":{"start":{"line":9,"character":42},"end":{"line":9,"character":42}},"context":{"diagnostics":[]}}

[Trace - 23:30:17.870 PM] Sending request 'textDocument/documentLink - (3)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"}}

[Trace - 23:30:17.870 PM] Sending request 'textDocument/foldingRange - (4)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"}}

[Trace - 23:30:17.870 PM] Sending request 'textDocument/codeLens - (5)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"}}

[Trace - 23:30:17.929 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:17 go/packages.Load\n\tsnapshot=1\n\tdirectory=/Users/kurt/project/gocode/lcode\n\tquery=[./]\n\tpackages=1\n"}

[Info - 11:30:17 PM] 2020/11/17 23:30:17 go/packages.Load
snapshot=1
directory=/Users/kurt/project/gocode/lcode
query=[./]
packages=1

[Trace - 23:30:18.261 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:18 go/packages.Load\n\tsnapshot=1\n\tdirectory=/Users/kurt/project/gocode/lcode\n\tquery=[file=/Users/kurt/project/gocode/lcode/src/lcode/main.go]\n\tpackages=1\n"}

[Trace - 23:30:18.261 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:18 go/packages.Load\n\tsnapshot=1\n\tpackage_path="command-line-arguments"\n\tfiles=[/Users/kurt/project/gocode/lcode/src/lcode/main.go]\n"}

[Trace - 23:30:18.261 PM] Sending notification '$/cancelRequest'.
Params: {"id":5}

[Info - 11:30:18 PM] 2020/11/17 23:30:18 go/packages.Load
snapshot=1
directory=/Users/kurt/project/gocode/lcode
query=[file=/Users/kurt/project/gocode/lcode/src/lcode/main.go]
packages=1

[Trace - 23:30:18.301 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:18 go/packages.Load\n\tsnapshot=1\n\tpackage_path="command-line-arguments"\n\tfiles=[/Users/kurt/project/gocode/lcode/src/lcode/main.go]\n"}

[Trace - 23:30:18.301 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/11/17 23:30:18 go/packages.Load\n\tsnapshot=1\n\tdirectory=/Users/kurt/project/gocode/lcode\n\tquery=[file=/Users/kurt/project/gocode/lcode/src/lcode/main.go]\n\tpackages=1\n"}

[Info - 11:30:18 PM] 2020/11/17 23:30:18 go/packages.Load
snapshot=1
package_path="command-line-arguments"
files=[/Users/kurt/project/gocode/lcode/src/lcode/main.go]

[Info - 11:30:18 PM] 2020/11/17 23:30:18 go/packages.Load
snapshot=1
package_path="command-line-arguments"
files=[/Users/kurt/project/gocode/lcode/src/lcode/main.go]

[Info - 11:30:18 PM] 2020/11/17 23:30:18 go/packages.Load
snapshot=1
directory=/Users/kurt/project/gocode/lcode
query=[file=/Users/kurt/project/gocode/lcode/src/lcode/main.go]
packages=1

[Trace - 23:30:18.348 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/11/17 23:30:18 command-line-arguments: no dep handle for github.com/lcode/code/code_heap: no metadata for github.com/lcode/code/code_heap\n\tsnapshot=1\n"}

[Trace - 23:30:18.377 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/11/17 23:30:18 command-line-arguments: no dep handle for github.com/lcode/code/code_heap: no metadata for github.com/lcode/code/code_heap\n\tsnapshot=1\n"}

[Trace - 23:30:18.696 PM] Received response 'textDocument/documentSymbol - (1)' in 1147ms.
Result: [{"name":"main","detail":"()","kind":12,"range":{"start":{"line":8,"character":0},"end":{"line":30,"character":1}},"selectionRange":{"start":{"line":8,"character":5},"end":{"line":8,"character":9}}}]

[Trace - 23:30:18.701 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go","version":1,"diagnostics":[{"range":{"start":{"line":5,"character":1},"end":{"line":5,"character":34}},"severity":1,"source":"compiler","message":"could not import github.com/lcode/code/code_heap (no package for import github.com/lcode/code/code_heap)"}]}

[Trace - 23:30:18.701 PM] Received response 'textDocument/codeAction - (2)' in 831ms.
Result: null

[Trace - 23:30:18.714 PM] Received response 'textDocument/documentLink - (3)' in 844ms.
Result: [{"range":{"start":{"line":3,"character":2},"end":{"line":3,"character":5}},"target":"https://pkg.go.dev/fmt"},{"range":{"start":{"line":5,"character":2},"end":{"line":5,"character":33}},"target":"https://pkg.go.dev/github.com/lcode/code/code_heap"},{"range":{"start":{"line":20,"character":5},"end":{"line":20,"character":26}},"target":"https://github.com/lcode/code"},{"range":{"start":{"line":21,"character":5},"end":{"line":21,"character":33}},"target":"https://github.com/lcode/code/code_5"},{"range":{"start":{"line":22,"character":5},"end":{"line":22,"character":33}},"target":"https://github.com/lcode/code/code_9"},{"range":{"start":{"line":23,"character":5},"end":{"line":23,"character":36}},"target":"https://github.com/lcode/code/code_heap"},{"range":{"start":{"line":24,"character":5},"end":{"line":24,"character":41}},"target":"https://github.com/lcode/code/code_mergesort"}]

[Trace - 23:30:18.716 PM] Received response 'textDocument/foldingRange - (4)' in 845ms.
Result: [{"startLine":2,"startCharacter":8,"endLine":5,"endCharacter":34,"kind":"imports"},{"startLine":8,"startCharacter":13,"endLine":9,"endCharacter":90},{"startLine":10,"startCharacter":100,"endLine":29,"endCharacter":31,"kind":"comment"}]

[Error - Received] 23:30:18.716 PM #5 JSON RPC cancelled

[Error - 11:30:18 PM] 2020/11/17 23:30:18 command-line-arguments: no dep handle for github.com/lcode/code/code_heap: no metadata for github.com/lcode/code/code_heap
snapshot=1

[Trace - 23:30:18.743 PM] Sending request 'textDocument/codeLens - (6)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"}}

[Trace - 23:30:18.744 PM] Received response 'textDocument/codeLens - (6)' in 0ms.
Result: null

[Error - 11:30:18 PM] 2020/11/17 23:30:18 command-line-arguments: no dep handle for github.com/lcode/code/code_heap: no metadata for github.com/lcode/code/code_heap
snapshot=1

[Trace - 23:30:19.065 PM] Sending request 'textDocument/codeAction - (7)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"},"range":{"start":{"line":9,"character":42},"end":{"line":9,"character":42}},"context":{"diagnostics":[]}}

[Trace - 23:30:19.066 PM] Received response 'textDocument/codeAction - (7)' in 0ms.
Result: null

[Trace - 23:30:19.614 PM] Sending request 'textDocument/documentSymbol - (8)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"}}

[Trace - 23:30:19.615 PM] Received response 'textDocument/documentSymbol - (8)' in 0ms.
Result: [{"name":"main","detail":"()","kind":12,"range":{"start":{"line":8,"character":0},"end":{"line":30,"character":1}},"selectionRange":{"start":{"line":8,"character":5},"end":{"line":8,"character":9}}}]

[Trace - 23:30:20.942 PM] Sending request 'textDocument/definition - (9)'.
Params: {"textDocument":{"uri":"file:///Users/kurt/project/gocode/lcode/src/lcode/main.go"},"position":{"line":9,"character":42}}

[Error - Received] 23:30:20.943 PM #9 no object found for ident HeapSort: no object found

[Error - 11:30:20 PM] Request textDocument/definition failed.
Message: no object found for ident HeapSort: no object found
Code: 0

@stamblerre
Copy link
Contributor

It looks like your project root is /Users/kurt/project/gocode/lcode, but your go.mod is in /Users/kurt/project/gocode/lcode/src/lcode/go.mod. Can you try opening the /Users/kurt/project/gocode/lcode/src/lcode/ directory instead?

@Kurt-Shiwz
Copy link
Author

It looks like your project root is /Users/kurt/project/gocode/lcode, but your go.mod is in /Users/kurt/project/gocode/lcode/src/lcode/go.mod. Can you try opening the /Users/kurt/project/gocode/lcode/src/lcode/ directory instead?

i run "go mod init github.com/lcode" on "/Users/kurt/project/gocode/lcode" "/Users/kurt/project/gocode/lcode/src" "/Users/kurt/project/gocode/lcode/src/lcode", all of them doesn't work

@stamblerre
Copy link
Contributor

Ideally you want to have only one go.mod file per-project, so I would suggest leaving the go.mod file you want and deleting the others. Then open the editor at the directory that contains the go.mod file.

@Kurt-Shiwz
Copy link
Author

Ideally you want to have only one go.mod file per-project, so I would suggest leaving the go.mod file you want and deleting the others. Then open the editor at the directory that contains the go.mod file.

you are right, it work.but i have two question:
1 in mac big sur, go mod and gopath cant allow work together ?
2 the mac in my home, dont have some pkg(in big sur vpn app dont work, so i cant download private pkg now), it cant jump to define now. using the language server depand on all the pkg download, if less some cant jump?

@stamblerre
Copy link
Contributor

in mac big sur, go mod and gopath cant allow work together ?

I'm not sure what you mean--can you give an example? You can definitely create a module in your GOPATH/src folder.

the mac in my home, dont have some pkg(in big sur vpn app dont work, so i cant download private pkg now), it cant jump to define now. using the language server depand on all the pkg download, if less some cant jump?

You can't jump to the definition unless you already have the package downloaded on your machine, yes. If you have a specific issue you'd like to investigate, the easiest way would probably be to share another log.

@Kurt-Shiwz
Copy link
Author

Kurt-Shiwz commented Nov 18, 2020

in mac big sur, go mod and gopath cant allow work together ?

it solved. should set go.toolsEnvVars.GO111MODULE to off

the mac in my home, dont have some pkg(in big sur vpn app dont work, so i cant download private pkg now), it cant jump to define now. using the language server depand on all the pkg download, if less some cant jump?

i download all pkg,it work.

so thank you, now can close the issue.

@golang golang locked and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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