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

Incorrect semantic tokens for table keys #1767

Closed
clason opened this issue Dec 16, 2022 · 1 comment
Closed

Incorrect semantic tokens for table keys #1767

clason opened this issue Dec 16, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@clason
Copy link

clason commented Dec 16, 2022

How are you using the lua-language-server?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Semantic tokens

Description of issue

Consider the following Lua snippet:

local foo = {
  bar = function() end,
}

Here, bar is marked with the semantic token

  • type: method
  • modifier: declaration

I believe both of these are incorrect: a table key is not a variable nor a declaration -- it's assigning an anonymous variable to a property; so it should be

  • type: property (same as, e.g., baz = 'quux')
  • no modifier (also for other table keys)

(Having the bar in foo.bar() be a method is fine, of course.)

@sumneko sumneko added the bug Something isn't working label Dec 16, 2022
@sumneko sumneko added this to the 3.7.0 milestone Dec 16, 2022
@clason
Copy link
Author

clason commented Dec 16, 2022

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants