LuaLS / LuaLS/lua-language-server

Allow type `T1?|T2?`

Open
#3,177 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

`T1?|T2?` is now parsed as `T1?`, whose correct form should be `(T1|T2)?` or `T1|T2|nil` or `field? T1|T2`.

But many libraries (e.g. neovim plugins) are using this incorrect form.

This misuse is so prevalent that should we consider making this form legal?

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

The issue does not name a file, test, or entry point. Begin by locating the parser handling for `T1?|T2?`, then determine whether the language should accept that form and how it should relate to `(T1|T2)?`, `T1|T2|nil`, and `field? T1|T2`; completion requires an explicit syntax decision and corresponding parser coverage.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.