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: need better error message than "expected operand, found 'ILLEGAL'" #61450

Closed
hyangah opened this issue Jul 19, 2023 · 1 comment
Assignees
Labels
FeatureRequest gopls/parsing Issues related to parsing / poor parser recovery. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Jul 19, 2023

go version: go1.20rc3
gopls version: v0.12.4

what did I do

I copy&pasted some code from google doc, and quotation marks were U+201C and U+201D.
gopls reported this error, but without sufficient details.

Screenshot 2023-07-19 at 2 42 27 PM

go command on the other hand reports helpful details:

$ go build
# example.com/foo
./main.go:27:15: invalid character U+201C '“' in identifier
./main.go:27:15: undefined: “FOOBAR”
./main.go:27:24: invalid character U+201D '”' in identifier

It would be nice if we can surface more details when encountering this type of parse errors.

@hyangah hyangah added FeatureRequest gopls/parsing Issues related to parsing / poor parser recovery. labels Jul 19, 2023
@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 Jul 19, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jul 19, 2023
@jamalc jamalc modified the milestones: Unreleased, gopls/later Jul 20, 2023
@gopherbot
Copy link

Change https://go.dev/cl/512855 mentions this issue: go/scanner: give specific error for curvy “abc” quotes

@adonovan adonovan self-assigned this Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls/parsing Issues related to parsing / poor parser recovery. 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

4 participants