Add lua support through local-lua-debugger-vscode
Add the lua adapter to gadgets.py and installer.py, update the README.md file and create basic tests using lua, luajit and love.
This commit is contained in:
parent
2bdb30a45e
commit
2819e224e7
7 changed files with 185 additions and 4 deletions
17
support/test/lua/love/.vimspector.json
Normal file
17
support/test/lua/love/.vimspector.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json#",
|
||||
"configurations": {
|
||||
"love": {
|
||||
"adapter": "lua-local",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"type": "lua-local",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"program": {
|
||||
"command": "love"
|
||||
},
|
||||
"args": ["${workspaceFolder}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
support/test/lua/love/main.lua
Normal file
21
support/test/lua/love/main.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
if pcall(require, 'lldebugger') then
|
||||
require('lldebugger').start()
|
||||
end
|
||||
|
||||
local rect = {0, 0, 64, 64}
|
||||
|
||||
|
||||
function love.update(dt)
|
||||
rect[1] = rect[1] + 10 * dt
|
||||
rect[2] = rect[2] + 10 * dt
|
||||
end
|
||||
|
||||
|
||||
function love.draw()
|
||||
love.graphics.rectangle('fill', rect[1], rect[2], rect[3], rect[4])
|
||||
end
|
||||
|
||||
|
||||
function love.keypressed()
|
||||
love.event.quit()
|
||||
end
|
||||
29
support/test/lua/simple/.vimspector.json
Normal file
29
support/test/lua/simple/.vimspector.json
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json#",
|
||||
"configurations": {
|
||||
"lua": {
|
||||
"adapter": "lua-local",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"type": "lua-local",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"program": {
|
||||
"lua": "lua",
|
||||
"file": "simple.lua"
|
||||
}
|
||||
}
|
||||
},
|
||||
"luajit": {
|
||||
"adapter": "lua-local",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"type": "lua-local",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"program": {
|
||||
"lua": "luajit",
|
||||
"file": "simple.lua"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
support/test/lua/simple/simple.lua
Normal file
25
support/test/lua/simple/simple.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
if pcall(require, 'lldebugger') then
|
||||
require('lldebugger').start()
|
||||
end
|
||||
|
||||
local separator = ' '
|
||||
|
||||
|
||||
local function createMessage()
|
||||
local words = {}
|
||||
table.insert(words, 'Hello')
|
||||
table.insert(words, 'world')
|
||||
return table.concat(words, separator)
|
||||
end
|
||||
|
||||
|
||||
local function withEmphasis(func)
|
||||
return function()
|
||||
return func() .. '!'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
createMessage = withEmphasis(createMessage)
|
||||
|
||||
print(createMessage())
|
||||
Loading…
Add table
Add a link
Reference in a new issue