Skip to content

x/tools/gopls: bad completion with syntax errors #39721

Open
@kzhui125

Description

@kzhui125

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)
}

1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/parsingIssues related to parsing / poor parser recovery.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions