lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

New setting to expand identifier / name / word and/or consolidation of constant

Open hendrikp opened this issue 3 years ago • 1 comments

Some Lua based domain specific languages use an extended character set for identifiers, this is easily achieved by modifying e.g. alnum in luaconf.h, similar in LuaJIT and also is adjustable through compact modifications in ZeroBrane.

In Sumneko it was easy to modify as well until recently (through parser/grammar.lua), but with the latest patch the definition of which characters an identifier/word/lua-name represents is all over the place.

  • newparser.lua - CharMapWord,
  • grammar.lua - defs.NameBody
  • luadoc.lua - name
  • tokens.lua - Word

As sample e.g. adding support for $ and @ characters in the identifiers: \x24-\x24 and \x40-\x40 or the single character versions are added to the listings.

It would be better to have a extension setting where this can be listed, or alternatively at least a single file where this is defined as constant (similar to how its able to be overridden/extended through luaconf.h)

hendrikp avatar Jan 17 '22 17:01 hendrikp

You could use plugin for now, see https://github.com/sumneko/lua-language-server/wiki/Plugin

sumneko avatar Jan 18 '22 09:01 sumneko