You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Continuing the discussion started in #1944 and #2164 in a new issue.
With "go.toolsEnvVars": { "GO111MODULE": "on" }, gocode-gomod is being launched now, which is good.
But, it still fails to give suggestions to the package functions before you save the file.
Prerequisits Ext. version: 0.7.1-beta.5 OS: macOS 10.14.1
Latest vscode, Go 1.11.2, all Go tools updated through vscode-go.
Create simple main.go with empty main(), enable modules by go mod init.
Steps to reproduce:
Action: Start writing fm Expect:fmt package should be suggested to be imported Result: success - got the suggestion:
Action: Import fmt, write . to have function suggestions Expect:fmt package functions should be suggested Result: failure - nothing happens:
gocode-gomod -s -debug output (doubled for some reason?..):
2018/12/07 16:41:00 Got autocompletion request for '/Users/nezorflame/Go/src/test-project/main.go'
2018/12/07 16:41:00 Cursor at: 52
2018/12/07 16:41:00 -------------------------------------------------------
package main
import (
"fmt"
)
func main() {
fmt.#
}
2018/12/07 16:41:00 -------------------------------------------------------
2018/12/07 16:41:00 error in package test-project: /Users/nezorflame/Go/src/test-project/main.go:4:2:could not import fmt (no metadata for fmt)
2018/12/07 16:41:00 Elapsed duration: 103.788631ms
2018/12/07 16:41:00 Offset: 0
2018/12/07 16:41:00 Number of candidates found: 0
2018/12/07 16:41:00 Candidates are:
2018/12/07 16:41:00 =======================================================
2018/12/07 16:41:00 Got autocompletion request for '/Users/nezorflame/Go/src/test-project/main.go'
2018/12/07 16:41:00 Cursor at: 65
2018/12/07 16:41:00 -------------------------------------------------------
package main
import "fmt"
import (
"fmt"
)
func main() {
fmt.#
}
2018/12/07 16:41:00 -------------------------------------------------------
2018/12/07 16:41:00 error in package test-project: /Users/nezorflame/Go/src/test-project/main.go:2:8:could not import fmt (no metadata for fmt)
2018/12/07 16:41:00 error in package test-project: /Users/nezorflame/Go/src/test-project/main.go:5:2:fmt redeclared in this block
2018/12/07 16:41:00 error in package test-project: /Users/nezorflame/Go/src/test-project/main.go:2:8: other declaration of fmt
2018/12/07 16:41:00 Elapsed duration: 98.44108ms
2018/12/07 16:41:00 Offset: 0
2018/12/07 16:41:00 Number of candidates found: 0
2018/12/07 16:41:00 Candidates are:
2018/12/07 16:41:00 =======================================================
But, if you save the file and try again, it will work this time!
Action: Save the file, delete the . and insert it again: Expect:fmt package functions should be suggested Result: success - got the functions now:
The text was updated successfully, but these errors were encountered:
nezorflame
changed the title
Autocompletion doesn't work for pacakges which were imported before saving the file
Autocompletion doesn't work for packages which were imported before saving the file
Dec 7, 2018
@nezorflame The fix for this has been pushed in the upstream. Can you run the command Go: Install/Update Tools, choose gocode-gomod, press Ok to update it and try again?
Continuing the discussion started in #1944 and #2164 in a new issue.
With
"go.toolsEnvVars": { "GO111MODULE": "on" }
,gocode-gomod
is being launched now, which is good.But, it still fails to give suggestions to the package functions before you save the file.
Prerequisits
Ext. version: 0.7.1-beta.5
OS: macOS 10.14.1
Latest vscode, Go 1.11.2, all Go tools updated through
vscode-go
.Create simple
main.go
with emptymain()
, enable modules bygo mod init
.Steps to reproduce:
fm
Expect:
fmt
package should be suggested to be importedResult: success - got the suggestion:
fmt
, write.
to have function suggestionsExpect:
fmt
package functions should be suggestedResult: failure - nothing happens:
gocode-gomod -s -debug
output (doubled for some reason?..):But, if you save the file and try again, it will work this time!
.
and insert it again:Expect:
fmt
package functions should be suggestedResult: success - got the functions now:
The text was updated successfully, but these errors were encountered: