Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: gopls is confused by //line directives #42000

Open
pjweinb opened this issue Oct 15, 2020 · 1 comment
Open

x/tools/gopls: gopls is confused by //line directives #42000

pjweinb opened this issue Oct 15, 2020 · 1 comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@pjweinb
Copy link

pjweinb commented Oct 15, 2020

go1.15.1 darwin/amd64

Files with //line directives confuse gopls, for instance no hover returned, and no diagnostics generated.

In

//line a.y:1
package main

func main() {
	var err error
	err.Error()
}

hovering on Error returns nothing, but it hovers fine without the //line comment.

Likewise, in (the -- <name> -- headers say what the contents of are)

-- a.go --
package consts

const a = 1
-- b.go --
package consts
//line gen.go:5
const a = 2

no errors are generated for b.go as it stands (although the definition in a.go is described as the 'other' definition), while errors are generated correctly without the //line comment.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Oct 15, 2020
@gopherbot gopherbot added this to the Unreleased milestone Oct 15, 2020
@pjweinb
Copy link
Author

pjweinb commented Oct 15, 2020

also noted in #33690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants