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

Comments

@pjweinb
Copy link

@pjweinb 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 this to the Unreleased milestone Oct 15, 2020
@pjweinb
Copy link
Author

@pjweinb pjweinb commented Oct 15, 2020

also noted in #33690

@stamblerre stamblerre removed this from the Unreleased milestone Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.