golang/go

x/tools/gopls: bad completion with syntax errors

Open

#39,721 opened on Jun 19, 2020

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
Toolsgoplsgopls/parsinghelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

  • Run go version to get version of Go
    • go version go1.14.3 darwin/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.46.0
    • a5d1cc28bb5da32ec67e86cc50f84c67cc690321
    • x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.14.4

full code:

package main

import "fmt"

type result struct {
	value interface{}
	err   error
}

func getResult() (interface{}, error) {
	return "test", nil
}

func main() {
	var res result
	res.value, res.err = getResult()
	fmt.Println(res)
}

When I type "res.", I expect "err" will appear.

But now the code completion stop working, I have to type "err" manually.

Please fix the bug, thanks.

Contributor guide