LuaLS / lua.tmbundle

TextMate support for Lua
MIT License
7 stars 5 forks source link

Hi, I believe the fixed grammar does not fix the issues depicted below? What is wrong there IMO: #3

Closed sumneko closed 2 years ago

sumneko commented 2 years ago

Hi, I believe the fixed grammar does not fix the issues depicted below? What is wrong there IMO:

  1. the function name in the declaration and the function callsites have the same color - pretty sure this didn't use to be the case..? See function foo and the callsite.
  2. standard modules such as table and string have some sort of special treatment, which results in problems like depicted - string is colorized differently from other functions. I don't think the built-in modules should be special cased, because you don't have to open them by default. My example is contrived, but we actually had a real world use-case where this showed up.

Code_SCbvesKzQ9

Originally posted by @sammalt in https://github.com/sumneko/lua.tmbundle/issues/2#issuecomment-1061523816

sumneko commented 2 years ago

2. standard modules such as table and string have some sort of special treatment, which results in problems like depicted - string is colorized differently from other functions. I don't think the built-in modules should be special cased, because you don't have to open them by default. My example is contrived, but we actually had a real world use-case where this showed up.

This is a bug, I will fix it.

sumneko commented 2 years ago
  1. the function name in the declaration and the function callsites have the same color - pretty sure this didn't use to be the case..? See function foo and the callsite.

The token of call used to be support.function.any-method.lua, but now it is entity.name.function.lua, I will fix it

sumneko commented 2 years ago

Please install this extension to check if it fixed: https://marketplace.visualstudio.com/items?itemName=sumneko.lua-grammar Make sure the version of the extension is 0.0.2

sammalt commented 2 years ago

Wow, that was fast. Yep, it looks good, thank you! With the default Dark theme, the function name and the calls look the same, but with some other themes the colors are now different. The built-in module problem is gone as well.