CfxLua support for VSCode (and FXCode)

  • Install the Lua Language Server extension
  • Press Ctrl + Shift + P and click `Preferences: Open Settings (JSON)
  • Add the following settings to the object, and set the plugin and library directory
    "Lua.diagnostics.enable": true,
    "Lua.runtime.nonstandardSymbol": ["/**/", "`", "+=", "-=", "*=", "/="],
    "Lua.runtime.plugin": "{{YOUR DIRECTORY}}/plugin.lua",
    "Lua.runtime.version": "Lua 5.4",
    "Lua.completion.autoRequire": false,
    "Lua.IntelliSense.traceBeSetted": true,
    "Lua.IntelliSense.traceLocalSet": true,
    "Lua.IntelliSense.traceFieldInject": true,
    "Lua.IntelliSense.traceReturn": true,
    "Lua.workspace.preloadFileSize": 2000,
    "Lua.workspace.ignoreDir": [".vscode", ".github", ".git", "**/node_modules"],
    "Lua.workspace.library": ["{{YOUR DIRECTORY}}/library"],
    "Lua.workspace.useGitIgnore": true,
    "Lua.diagnostics.disable": ["lowercase-global", "undefined-field", "undefined-global"],
    "Lua.workspace.checkThirdParty": false,
    "Lua.telemetry.enable": true,
    "Lua.diagnostics.globals": ["source"]

image

WIP support for non-standard functions and types from LuaGLM

Thanks to CitizenFX, and gottfriedleibniz

  • vectors
  • quat (partial)
  • matrix (partial)
  • safe navigation
  • extended API
  • extended string

Native declarations

  • Install NodeJS
  • Download JetbrainIDE-CFX.RE
  • Open a terminal in the folder containing JetbrainIDE-CFX.RE
  • Execute the following commands, in order
    • npm i
    • npm install -g ts-node
    • npm install -g typescript
  • Once all dependencies have been installed, execute npm run start and follow the prompts
  • You will want to build CFX as well as game natives
  • Once the files have been built, move them to cfxlua-vscode/library/natives

image

Thanks to CitizenFX, alloc8or, iTexZoz, and TasoOneAsia