golang/go

x/tools/gopls: bad completion with syntax errors

Aperta

#39.721 aperta il 19 giu 2020

 (7 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
Toolsgoplsgopls/parsinghelp wanted

Metriche repository

Star
 (133.883 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor