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: const tokenized as a string #42715

stamblerre opened this issue Nov 19, 2020 · 2 comments

x/tools/gopls: const tokenized as a string #42715

stamblerre opened this issue Nov 19, 2020 · 2 comments


Copy link

@stamblerre stamblerre commented Nov 19, 2020

Screen Shot 2020-11-19 at 12 55 41 AM

In the above screenshot, the mod const is tokenized as a string, leading it to appear the same as a string in the given function.

To repro, add the following to any file in

func TestUseOfInvalidMetadata(t *testing.T) {
	const mod = `
-- go.mod --

go 1.12
-- main.go --
package main

import ""

func _() {
-- a/a.go --
package a

func Hello() {}
	run(t, mod, func(t *testing.T, env *Env) {


/cc @pjweinb

@stamblerre stamblerre added this to the gopls/unplanned milestone Nov 19, 2020
@pjweinb pjweinb self-assigned this Nov 19, 2020
Copy link

@pjweinb pjweinb commented Nov 19, 2020

And also the assignment of tokens to predeclared identifiers is inconsistent. (true, false, nil, iota)

Copy link

@gopherbot gopherbot commented Nov 24, 2020

Change mentions this issue: internal/lsp: revise some semantic token details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants