Skip to content

LuaJIT - extension for "loadfile" not recognized #620

@Feez

Description

@Feez

Describe the bug
According to https://luajit.org/extensions.html, LuaJIT's loadfile supports the Lua 5.2 version of it which is documented as: loadfile(filename [,mode [,env]]). Currently, the language server does not seem to recognize the additional 2 parameters after filename.

image

I also have my vscode workspace settings.json file setup with:

{
    "Lua.runtime.version":"LuaJIT"
}

I think this is the case for some of the other extensions included as well (i.e. for loadstring, math.log, string.rep, etc)

To Reproduce
Steps to reproduce the behavior:

  1. Create new workspace with vscode settings Lua.runtime.version set to LuaJIT
  2. Try to use loadfile with 3 parameters (filename, mode, env)

Expected behavior.
Hover shows the valid parameters and doesn't make the text more transparent, and ideally links to the Lua 5.2 documentation for the LuaJIT extensions specifically.

Environment (please complete the following information):
VSCode:
Version: 1.58.2 (system setup)
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:10:15.214Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19042

Extension version: v2.3.2
(Not remote)

Additional context
LuaJIT's API is taken mostly from Lua 5.1 but includes some extensions for supporting Lua 5.2 specific API. All of it does not seem to be recognized by the extension at the moment.

Provide logs
No bug/error so I don't believe log is relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions