LuaLS / LuaLS/lua-language-server
Extending alias functionality [Suggestion]
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
Good day, my suggestion is quite unusual - I'm requesting an additional functionality for aliases, basically adding ability to define regexp for string-based aliases. For example I have something like this:
---@alias Identifier string
That makes type check that Identifier is a string, but don't check if identifier need a custom structure, for example if correct structure is something like namespace:path it can't be validated with LLS.
If on another hand I can able to add a regexp to it:
---@alias Identifier string("^[^:]*:[^:]*$")
Then it will automatically check if identifier is valid
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing alias type-checking behavior and how LuaLS represents string-based types. The requested syntax and regexp semantics need to be defined before implementation. Done should include regexp-constrained aliases such as Identifier being validated against the specified pattern.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100