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: mark source comments as semantic token type "comment" #45860

Closed
leitzler opened this issue Apr 29, 2021 · 2 comments
Closed

x/tools/gopls: mark source comments as semantic token type "comment" #45860

leitzler opened this issue Apr 29, 2021 · 2 comments
Assignees
Milestone

Comments

@leitzler
Copy link
Contributor

@leitzler leitzler commented Apr 29, 2021

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

$ go version
go version devel go1.17-756e2b1529 Fri Apr 9 19:11:12 2021 +0000 darwin/amd64
% go list -m golang.org/x/tools golang.org/x/tools/gopls
golang.org/x/tools v0.1.1-0.20210422170518-f946a157eefe
golang.org/x/tools/gopls v0.0.0-20210422170518-f946a157eefe

Does this issue reproduce with the latest release?

Yes

What did you do?

Called textDocument/semanticTokens/full with the following main.go:

package main

type Foo struct {
    A int `json:"xyz"`
}

// Foobar
func main() {
    /* comment
       with
       multiple
       lines
    */
}

(The client do report client capability support for comment token type)

What did you expect to see?

Token type comment used for all comments.

What did you see instead?

Only struct tags marked as comments.

[Trace - 21:58:20.124 PM] Sending request 'textDocument/semanticTokens/full - (2)'.
Params: {"textDocument":{"uri":"file:///private/var/folders/j4/l2j99h6d5qd6knjlllql0bb80000gn/T/tmp.Z3OfVXaR/main.go"}}


[Trace - 21:58:20.126 PM] Received response 'textDocument/semanticTokens/full - (2)' in 2ms.
Result: {"resultId":"2021-04-29 21:58:20.126462 +0200 CEST m=+7285.539207045","data":[0,0,7,15,0,0,8,4,0,0,2,0,4,15,0,0,5,3,1,2,0,4,6,15,0,1,1,1,8,2,0,2,3,1,512,0,4,12,17,0,4,0,4,15,0,0,5,4,12,2]}
@gopherbot gopherbot added this to the Unreleased milestone Apr 29, 2021
@leitzler
Copy link
Contributor Author

@leitzler leitzler commented Apr 29, 2021

/cc @pjweinb

@pjweinb pjweinb self-assigned this Apr 29, 2021
@suzmue suzmue modified the milestones: Unreleased, gopls/v0.6.11 Apr 30, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented May 1, 2021

Change https://golang.org/cl/315989 mentions this issue: internal/lsp: add semantic tokens for comments and multiline strings

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
5 participants