Skip to content

Latest commit

 

History

History
96 lines (65 loc) · 2.88 KB

README.md

File metadata and controls

96 lines (65 loc) · 2.88 KB

mpv-types-lua

Lua type declarations for mpv scripting.

FEATURES

  • Global typed mp object

  • Loading built in submodules with type information via require - e.g. require('mp.msg')

  • Function signatures for all built in functions

  • Documentation comments from mpv man pages

INSTALLATION

Visual Studio Code

Extension Configurations

VSCode does not support Emmylua style type declarations out of the box, and requires one of the following extensions.

Lua - sumneko.lua - Marketplace - Github

  /* mpv builds with 5.1, 5.2, or luajit */
  "Lua.runtime.version": "Lua 5.1",

  /* Declarations can also be placed in workspace subdirectory */
  "Lua.workspace.library": {
    ".../path/to/mpv-lua-types/@types/": true
  },

  /* Recommended */
  "Lua.completion.enable": true,
  "Lua.signatureHelp.enable": true,
  "Lua.hover.enable": true,

EmmyLua - tangzx.emmylua - Marketplace - GitHub

  /* Declarations can also be placed in workspace subdirectory */
  "emmylua.source.roots": {
    ".../path/to/mpv-lua-types/@types/": true
  },

LuaPanda - stuartwang.luapanda - Marketplace - GitHub

  /* Declarations can also be placed in workspace subdirectory */
  "luaide-lite.apiFolders": [
    ".../path/to/mpv-types-lua/@types"
  ],
  "luaide-lite.core": "emmy",

luaide-lite - wellshsu.luaide-lite - Marketplace - GitHub

  • Declaration files must be in subdirectory of workspace.
  "lua_analyzer.codeLinting.luaVersion": "5.1",
  "lua_analyzer.codeLinting.enable": true

Intellij

Required Extensions

Installation

Create a new Lua Zip Library and attach the the @types folder.

TODO