LuaLS / LuaLS/lua-language-server

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

Open
#910 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the identifier definitions in newparser.lua, grammar.lua, luadoc.lua, and tokens.lua, especially CharMapWord, defs.NameBody, name, and Word. Determine whether the requested extension setting or a shared constant can cover all four locations, then verify that characters such as $ and @ are recognized consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.