Skip to content

Support LuaJIT v3 syntax backported to v2.1 #3434

Description

@vaisest

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

LuaJIT v3 is adding new syntax: LuaJIT/LuaJIT#1092

This is not yet very relevant, but parts of the syntax was already backported to v2.1: LuaJIT/LuaJIT#1476

LuaJIT uses a rolling release, which means this will slowly become a bigger problem. I believe most of the v3 features will not be backported, but these were due to it being required for LuaJIT development. I couldn't find any issues about it here, and it seems like the syntax isn't accepted in VSCode.

Here's a list of the currently backported extensions:

Backported extensions:

  • Bit Operators: unary ~, binary & | ~ << >> ~>>
  • Customary Operators ! && || !=
  • Ternary ?: conditional operator
  • Safe Navigation Operator ?.
  • nil-Coalescing Operator ??
  • Compound Assignment Operators += -= *= …
  • continue Statement
  • const Declaration
  • Short Function Expression
  • Underscores in Number Literals

Actual Behaviour

Unexpected symbol

Reproduction steps

See attached PRs.

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions