Skip to content

x/tools/gopls: errors in go.mod file prevents initial workspace load #36531

@ridersofrohan

Description

@ridersofrohan

What version of Go are you using (go version)?

$ go version
go version devel +8ac98e7b3f Thu Jan 9 18:00:06 2020 +0000 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

-- go.mod --
module mod.com

require golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042

yo

-- main.go --
package main

import "golang.org/x/tools/go/packages"

func Yo() {
	var _ packages.Config
}

What did you expect to see?

I expected the go.mod error to surface with the initial workspace load.

What did you see instead?

I saw that gopls logged the error due to the initial call packages.load call when the view is created. However, since there was an error with that initial load all the LSP features break. The error shows up once you save a .go file or start making edits in the go.mod file.

/cc @stamblerre

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions