Skip to content

LuaJit nonstandard symbol // for floor division has wrong behavior #3504

Open

Description

@filloax

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

Write // with LuaJIT runtime version + extensions on, and // added to nonstandard symbols, and see it recognized as floor division as per here LuaJIT/LuaJIT#1475

Actual Behaviour

It gets recognized as comment delimiter instead, breaking syntax

Reproduction steps

  1. Set runtime version to LuaJIT
  2. Enable LuaJIT extensions
  3. Add // to non standard symbols setting

Additional Notes

I am using LuaJIT runtime version with the extension enabled, and // added to nonStandardSymbols. It gets detected as a comment starter rather than a floor-division operator though, as seen here: filloax/isaac-lua-api-vscode#43

The LuaJIT version I am working with uses that syntax extension; I am not sure how standard it is, but could this be fixed? EIther by changing behavior, or if other runtimes really do have // as comment then adding an alt value to the enum such as // (floor division)

Log File

file_d%3A_Documenti_Temp_sample.log

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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