====== [hemmerling] Lua & eLua 2/3 ====== Related pages: *[[coregames.html|CORE ( COREGAMES ) 1/3]]. *[[coregames02.html|CORE ( COREGAMES ) 2/2 - CORE Application Development]]. *[[coregames03.html|CORE ( COREGAMES ) 3/3 - CORE Apps]]. *[[gamedevelopment.html|Game Development]]. *[[luagames.html|Game Engines and Games with Lua as Scripting Language]]. *[[lua.html|Lua & eLua 1/3]]. *[[lua03.html|Lua & eLua 3/3]]. *[[luaapplications.html|Lua Applications and Applications with Lua as Scripting Language]]. *[[sdevtools.html|Software Development Tools]] => "VisualStudioCode". ===== Tools ===== ==== IDEs & Debuggers ==== === IDEs & Debuggers, some of them suggested by CoreGames === == Atom for CORE == *The OpenSource IDE [[http://www.atom.io/|Atom]]. *[[http://www.atom.io/packages/language-lua|Atom "Lua language support in Atom"]]. *[[http://www.npmjs.com/package/language-lua|npm.js "Lua language support in Atom"]]. *Plugins: -[[http://www.atom.io/packages/language-lua|Atom Packages "language-lua"]]. -[[http://www.atom.io/packages/autocomplete-lua|Atom Packages "autocomplete-lua"]]. -[[http://www.atom.io/packages/linter|Atom Packages "linter"]]. -[[http://www.atom.io/packages/linter-ui-default|Atom Packages "linter-ui-default"]]. -[[http://www.atom.io/packages/linter-luacheck|Atom Packages "linter-luacheck"]]. *Autocomplete ( ".luacompleterc" ) => [[http://docs.coregames.com/extensions/#external-editors|Core Documentation "Core API / Editor Extensions"]]. == Eclipse with LuaEclipse ( no CORE support ) == *[[http://www.eclipse.org/ldt/|The Eclipse Foundation "Lua Development Tools"]]. *[[http://wiki.eclipse.org/LDT|Eclipse Wiki "LDT"]]. *Latest Eclipse release ( Win32, Win64, Linux32, Linux64 ) with LUA support: *[[http://projects.eclipse.org/releases/2019-12|The Eclipse Foundation "Eclipse IDE 2019-12"]]. *[[http://projects.eclipse.org/projects/tools.ldt|The Eclipse Foundation "Eclipse Lua Development Tools"]]. *"LDT is using Metalua". *[[http://underpop.online.fr/l/lua/luaeclipse/|Bate-papo "LuaForge" - "LuaEclipse"]] - "Current version supports Eclipse 3.2.x and 3.3.x and supports Lua 5.1." :-(. *[[http://www.github.com/luaforge/lua-eclipse-ide|GitHub "luaforge / lua-eclipse-ide"]]. *[[http://www.github.com/jasonsantos/LuaEclipse|GitHub "jasonsantos / LuaEclipse"]]. *[[http://luaeclipse.sourceforge.net/|SourceForge "LuaEclipse"]], [[http://www.sourceforge.net/projects/luaeclipse/|SourceForge "LuaEclipse"]]. *The outdated repository [[http://files.luaforge.net/releases/luaeclipse/luaeclipse|LuaForge Files "luaeclipse"]] ( - 2008 ). == IntelliJ IDEA with EmmyLua ( no CORE support ) == *[[http://www.jetbrains.com/idea/|JetBrains "IntelliJ IDEA"]] - "Community Edition". *[[http://emmylua.github.io/|GitHub.io "EmmyLua"]], [[http://www.github.com/EmmyLua/IntelliJ-EmmyLua|GitHub "EmmyLua / IntelliJ-EmmyLua"]]. *[[http://github.com/Benjamin-Dobell/IntelliJ-Luanalysis|GitHub "Benjamin-Dobell / IntelliJ-Luanalysis"]]. *"Type-safe Lua IDE Plugin for IntelliJ IDEA". *"Luanalysis (an EmmyLua fork) for IntelliJ IDEA". == NetBeans 8.0 & NetBeans 7.4 with "Lua Glider NetBeans Edition" ( no CORE support ) == *[[http://netbeans.apache.org/|Apache NetBeans]] ( netbeans.apache.org ). *[[http://plugins.netbeans.apache.org/?search=lua|Apache NetBeans "Plugins" - Search for "NetBeans version 11 or 12" & "lua"]] => 0 results :-(, in 2021-07. *Netbeans ( netbeans.org ). *[[http://web.archive.org/web/*/http://plugins.netbeans.org/plugin/52786/lua-glider-netbeans-edition|Archive.org "NetBeans Plugin 'Lua Glider NetBeans Edition - plugin detail'"]] ( - 2021-03-04 ). *[[http://blogs.oracle.com/geertjan/embedded-development-with-lua-in-netbeans|Oracle Blog "Embedded Development with Lua in NetBeans"]], 2014. == Notepad++ for CORE == *The OpenSource editor [[http://notepad-plus-plus.org/|Notepad++]]. *[[http://www.github.com/notepad-plus-plus/|GitHub "Notepad++"]]. *[[http://www.github.com/notepad-plus-plus/nppPluginList|GitHub "Notepad++" - "Notepad++ Plugin List"]]. == The complete Windows solution ( Visual Studio Code & Luacheck & .luacheckrc ) for CORE == *The OpenSource IDE [[http://code.visualstudio.com/|Visual Studio Code]] for Windows. *[[http://www.github.com/microsoft/vscode|GitHub "Visual Studio Code"]]. *Path on my development computer "C:\int\w64\develop\Microsoft\VSCode". *Plugins recommended by the offical Core Documentation page: -[[http://marketplace.visualstudio.com/items?itemName=ManticoreGames.vscode-core|VisualStudio Marketplace "Core Lua API Autocomplete"]] - "Provides autocomplete support for the Core Games Lua API". -[[http://marketplace.visualstudio.com/items?itemName=trixnz.vscode-lua|Visual Studio Marketplace "vscode-lua"]]. -[[http://marketplace.visualstudio.com/items?itemName=liwangqian.luacoderassist|Visual Studio Marketplace "LuaCoderAssist"]]. *[[http://www.github.com/liwangqian/LuaCoderAssist|GitHub "liwangqian / LuaCoderAssist"]]. *[[https://github.com/liwangqian/LuaCoderAssist/issues/114|GitHub "liwangqian / LuaCoderAssist", Issue "ENABLE => Crash by ''throw er; // Unhandled 'error' event'' ( with VSC 1.57.1 on Windows, LuaCoderAssist v2.3.9 ) #114"]]. -[[http://marketplace.visualstudio.com/items?itemName=dwenegar.vscode-luacheck|Visual Studio Marketplace "vscode-luacheck"]]. *[[http://www.medium.com/roblox-development/how-to-make-vscode-luacheck-work-with-the-luacheck-exe-c3e56700e8ef|Medium "Roblox Development. How to make vscode-luacheck work with the luacheck.exe"]]. *[[http://code.visualstudio.com/docs/getstarted/settings|Visual Studio Code Docs "User and Workspace Settings"]]. *[[http://en.wikipedia.org/wiki/Visual_Studio_Code|EN.Wikipedia "Visual Studio Code"]], [[http://de.wikipedia.org/wiki/Visual_Studio_Code|DE.Wikipedia "Visual Studio Code"]]. *LUA_PATH, LUA_CPATH. *[[http://www.stackoverflow.com/questions/35351885/lua-script-fails-with-module-not-found|StackOverflow "lua script fails with module not found"]]. *[[http://www.thijsschreijer.nl/blog/?p=1025|Tieske. Thijs Schreijer's techie stuff "Lua; configuring path settings"]]. *For running & debugging of Lua script in VSC, with "Lua Debug": -Set the system environment variable "LUA_PATH = ./?.lua" in the SystemProperties, so that VSC finds required Lua scripts in the directory of this Lua script. -"os.exit()" in Lua scripts is not processed properly, by the will of the author of the plugin :-( => See below. *The Linter "luacheck" => See on this page. *".luacheckrc" => [[http://docs.coregames.com/extensions/#external-editors|Core Documentation "Core API / Editor Extensions"]]. Installation instructions: Extract the .luacheckrc file to your "C:\Users\\Documents\My Games\Core\Saved\Maps" folder. *Proper setting in the VSC "settings.json" file: *Template: *"LuaCoderAssist.luacheck.execPath": "PATH TO FOLDER WITH luacheck.exe FILE". *"LuaCoderAssist.luaparse.luaversion": 5.3. *"LuaCoderAssist.luacheck.configFilePath": "PATH TO CORE MAPS FOLDER". *lua.luacheckPath": "PATH TO LUACHECK EXECUTABLE FILE TO BE CALLED ( e.g. 'luacheck.exe' or 'luacheck.bat' )". === Cross-development on Windows and Linux ( Visual Studio Code & Debugger & Luacheck & .luacheckrc ) === == .vscode == *The directory ".vscode" is created in the working directory of VSC. It may contain "launch.json" and "tasks.json". *The reason for the VSC error message "You don´t have an extension for debugging Lua. Should we find a Lua extension in the Marketplace?" is mostly, that there is no "lauch.json" yet ( generated ). *My experience: If you change the debugger, or even change the script to be debugged, best is to start with frech "launch.json" file... == Possible Attributes of "launch.json" == *Comments in the VSC JSON file "launch.json" start with double slash ( "/ /", without space ). *Use IntelliSense to learn about possible attributes. *Hover to view descriptions of existing attributes. *For more information, visit: [[https://go.microsoft.com/fwlink/?linkid=830387|https://go.microsoft.com/fwlink/?linkid=830387]] ( [[http://code.visualstudio.com/docs/editor/debugging#_launch-configurations|VisualStudio Code "Documentation" - "Launch configurations"]] ). == Tom Blind "Local Lua Debugger" == *[[http://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode|Visual Studio Marketplace, tomblind "Local Lua Debugger"]] √. *[[http://www.github.com/tomblind/local-lua-debugger-vscode|GitHub "tomblind / local-lua-debugger-vscode"]]. *Operation: *"To customize Run and Debug, create a launch.json file" => 3 JSON debugging configurations are created automatically: "Debug Lua Interpreter (Scripts)", "Debug Custom Lua Environement (Scripts)", "Debug Current File". *For successful step-by-step debugging ( "Start Debugging" ), you must set a RED breakpoint at the first non-comment line - both on VSC/Linux and VSC/Windows -. The Lua debugger halts, you may then move further step-by-step or run :-). Without a manual breaktpoint, the script is executed without debugging :-(. *OR you insert into your LUA script code, to start the LUA debugger manually: require("lldebugger").start() *The statement "os.exit()" is processed properly :-). *The statement "print(package.path)" prints the contents of the environment variable LUA_PATH, plus some more string contents :-) => See below. == actboy168 "Lua Debug" == *[[http://marketplace.visualstudio.com/items?itemName=actboy168.lua-debug|VisualStudio Marketplace, actboy168 "Lua Debug"]]. *[[http://www.github.com/actboy168/lua-debug|GitHub "actboy168 / lua-debug"]]. *Depends on [[http://marketplace.visualstudio.com/items?itemName=extensionPath|VisualStudio Marketplace, actboy168 "extensionPath"]]. *[[http://www.github.com/actboy168/vscode-extensionPath|GitHub "actboy168 / extensionPath"]]. *Operation: *"To customize Run and Debug, create a launch.json file" => 2 JSON debugging configurations are created automatically: *For Windows: "Debug (Scripts)", "Debug Current File". *For Linux: "Debug", "Debug Current File". *The statement "os.exit()" is not processed properly, both on Windows and Linux, by the will of the author of the plugin :-(. *[[http://www.github.com/actboy168/lua-debug/issues/139|GitHub "actboy168 / lua-debug", Issue "os.exit(0) is not processed properly #139"]]. *Version 1.40.0 does not work properly in "Run Without Debugging" mode :-(: No debug console output :-(. *Version 1.40.0 works properly in "Start Debugging" mode, just if in the step mode. If :-(: If the button "Continue(F5)" is pressed, i.e. the debugger turns into "Run Without Debugging" mode, all debug console output is supressed :-(. *The software author suggests to use os.exit(0, true). *The statement "print(package.path)" doesn't print the contents of the environment variable LUA_PATH. *For the JSON debugging configuration "Debug (Scripts)", there is a fix => See below. *For the JSON debugging configuration "Debug Current File", the fix does not work. *On Debian Linux 10.7, LuaDebug 1.40.0 fails by the error message error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory *[[http://askubuntu.com/questions/1168787/libreadline-so-6-issue-in-ubuntu-18-04|AskUbuntu "libreadline.so.6 issue in ubuntu 18.04"]]. *Fix for Debian Linux 10.7: $whereis libreadline.so.7.0 libreadline.so.7: /usr/lib/x86_64-linux-gnu/libreadline.so.7.0 /usr/lib/x86_64-linux-gnu/libreadline.so.7 $cd /lib/x86_64-linux-gnu/ $sudo ln -s libreadline.so.7.0 libreadline.so.6 == Ravi Programming Language "Lua and Ravi 5.3 Debugger" == *[[http://marketplace.visualstudio.com/items?itemName=ravilang.ravi-debug|Visual Studio Marketplace, Ravi Programming Language "Lua and Ravi 5.3 Debugger"]]. *[[http://www.github.com/dibyendumajumdar/ravi-vscode-debugger|GitHub "dibyendumajumdar / ravi-vscode-debugger"]]. *[[http://www.github.com/dibyendumajumdar/ravi-vscode-debugger/issues/3|GitHub "dibyendumajumdar / ravi-vscode-debugger", Issue "Open source, sometime? #3"]] - "Note that the debugger adapter is part of the Ravi VM; not usable as a generic adapter for Lua". *Operation on Windows: *"To customize Run and Debug, create a launch.json file" => Select "Ravi Debugger". *On Windows, the debugger doesn't handle Spaces ( " " ) in the path of "${workspaceRoot}", properly :-(. Example: "${workspaceRoot}" = "C:/Users//Documents/My Games/CORE/Saved/Maps/test/Data/Scripts/". The debugger aborts by the error message: :-(: Failed to launch C:/Users//Documents/My due to error: cannot open C:/Users//Documents/My: No such file or directory *Modify "launch.json": *'"program": "${workspaceRoot}/main.lua arg1 arg2"' => '"program": "main.lua",'. *'"LUA_PATH": "${workspaceRoot}/?.lua",' => '"LUA_PATH": "${env:LUA_PATH}",' or delete this JSON line. *'"LUA_CPATH": "${workspaceRoot}/?.dll"' => '"LUA_CPATH": "${env:LUA_CPATH}"' or delete this JSON line. *Breakpoints can´t be set, in the editor :-(. *The statement "os.exit()" is processed properly :-). *The statement "print(package.path)" prints the contents of the environment variable LUA_PATH, plus some more string contents :-). *Operation on Linux: *"To customize Run and Debug, create a launch.json file" => Select "Ravi Debugger". *"Run / Start Debugging" or "Run / Run Without Debugging" - Debugging aborts without notice, immediately :-(. == Tangzx "EmmyLua" == *[[http://marketplace.visualstudio.com/items?itemName=tangzx.emmylua|Visual Studio Marketplace, Tangzx "EmmyLua"]]. *[[http://github.com/EmmyLua/VSCode-EmmyLua|GitHub "EmmyLua / VSCode-EmmyLua"]]. *Not suitable for LUA@CORE :-(. *Operation: *"To customize Run and Debug, create a launch.json file" => Select "LuaHelper: Debug". *"Run / Start Debugging" or "Run / Run Without Debugging" *Error message on Linux: Error: connect ECONNREFUSED 127.0.0.1:9966. [Cancel]. [Open "launch.json"] *[[http://www.github.com/EmmyLua/VSCode-EmmyLua/issues/58|GitHub "EmmyLua / VSCode-EmmyLua", Issue "Debugging on Mac? #58"]] - "'emmylua_new' brings up an error 'Error: connect ECONNREFUSED 127.0.0.1.:9966'". *Error message on Windows, with 64-bit EmmyLua DLL path: %1 is not a valid Win32 application. *[[http://www.github.com/mpx/lua-cjson/issues/63|GitHub "Error: error loading module 'cjson' from file %1 is not a valid Win32 application. #63"]] - "Try running it with a 32-bit version... Worked for me with another module". *[[http://www.github.com/protocolbuffers/protobuf/issues/3923|GitHub "%1 is not a valid Win32 application #3923"]]. *[[http://docs.microsoft.com/en-US/windows/win32/debug/system-error-codes--0-499-|Microsoft Documentation "System Error Codes (0-499)"]] - "ERROR_BAD_EXE_FORMAT. 193 (0xC1). %1 is not a valid Win32 application" :-(. *Solution: Add this code to your project, use the 32-bit EmmyLua DLL path for Windows 64-bit: if (package.config:sub(1,1) == "\\") then -- "C:\Users\", with CMD => %homedrive%%homepath%, with PowerShell => $home --package.cpath = package.cpath .. "C:\\Users\\Administrator\\.vscode\\extensions\\tangzx.emmylua-0.3.49\\debugger\\emmy\\windows\\x64\\?.dll" package.cpath = package.cpath .. "C:\\Users\\Administrator\\.vscode\\extensions\\tangzx.emmylua-0.3.49\\debugger\\emmy\\windows\\x86\\?.dll" else package.cpath = package.cpath .. "~/.vscode/extensions/tangzx.emmylua-0.3.49/debugger/emmy/linux/emmy_core.so" end local dbg = require("emmy_core") dbg.tcpListen("localhost", 9966) *"Run / Start Debugging" or "Run / Run Without Debugging" is denied on Windows, if there is no Java8 runtime / Java8 SDK - or newer -, by the VSC error message :-(. My installation of JDK 11 works fine :-): Can´t find Java! Please install Java 1.8 or above and set JAVA_HOME environment variable. Source: EmmyLua (Extension) *Did not yet work for me neither on Windows nor on Linux :-(. == devCAT "Lua Debugger" == *[[http://marketplace.visualstudio.com/items?itemName=devCAT.lua-debug|Visual Studio Marketplace, devCAT "Lua Debugger"]]. *[[http://www.github.com/devcat-studio/VSCodeLuaDebug|GitHub "devcat-studio / VSCodeLuaDebug"]]. *Not suitable for LUA@CORE. *Operation: *"To customize Run and Debug, create a launch.json file" => Select "Lua Debugger". 4 JSON debugging configurations are generated: "launch-lua (Scripts)", "launch-gideros (Scripts)", "wait (Scripts)", "Debug Current File". *Modify "launch.json": *'"executable": "${workspaceRoot}/lua.exe",' => '"executable": "lua.exe",'. *"Run / Start Debugging" or "Run / Run Without Debugging" is denied both on Windows & Linux by the error message :-(: You don´t have an extension for debugging Lua. Should we find a Lua extension in the Marketplace? *Installation instructions: *Requirements: *Installed package: **luasocket**. *Installed package: A JSON library ( **cjson** and **dkjson** are recommended, but you can use other JSON libraries whose interfaces are compatible ). *Your code or third party library should not call **debug.sethook**. *Download the LUA script **vscode-debuggee.lua** and put it in your project. *Include this code in your LUA script file: local json = require 'dkjson' local debuggee = require 'vscode-debuggee' local startResult, breakerType = debuggee.start(json) print('debuggee start ->', startResult, breakerType) *Windows: *On Windows, "luarocks install luasocket" causes compile error with MinGW C/C++ compiler :-(. *Debian Linux: *On Debian Linux, error message "module 'socket.core' not found". *[[http://www.stackoverflow.com/questions/48035241/local-socket-requiresocket-module-socket-not-found|StackOverflow "local socket = require('socket'), module 'socket' not found"]]. *[[http://www.github.com/minetest-mods/irc/issues/29|GitHub "module 'socket.core' not found #29"]]. *Fix for Debian Linux: cd /usr/local/lib/lua sudo ln -s ./5.1 ./5.3 *On Debian Linux, error message "core.so: undefined symbol: luaL_openlib". *[[http://www.stackoverflow.com/questions/19041215/lual-openlib-replacement-for-lua-5-2|StackOverflow "luaL_openlib replacement for Lua 5.2"]]. *[[http://lua-l.lua.narkive.com/hyL7MoEC/where-can-i-get-the-official-introduction-of-lual-openlib-function|Narkive Mailing List Archive "Where can I get the official introduction of 'luaL_openlib' function?"]]. *[[http://www.github.com/diegonehab/luasocket/issues/146GitHub "diegonehab / luasocket" Issue "lua 5.1 got this 'Symbol not found: _luaL_openlib' #146"]]. *I did not yet find a solution :-(. *Did not yet work for me neither on Windows nor on Linux :-(. == BeamNG "Lua/LuaJIT Debugger" == *[[http://marketplace.visualstudio.com/items?itemName=beamng.luadbg|Visual Studio Marketplace, BeamNG "Lua/LuaJIT Debugger"]]. *[[http://www.github.com/BeamNG/VSCodeLuaDebug|GitHub "BeamNG / VSCodeLuaDebug"]] - 'Fork from [[http://www.github.com/devcat-studio/VSCodeLuaDebug|GitHub "devcat-studio / VSCodeLuaDebug"]]'. *Did not yet work for me neither on Windows nor on Linux :-(. == yinfei "Lua Helper" == *[[http://marketplace.visualstudio.com/items?itemName=yinfei.luahelper|Visual Studio Marketplace, yinfei "Lua Helper"]] - "Debug Attach, Debug Single Lua File, Run Single Lua File,...". *[[http://www.github.com/yinfei8/LuaHelper|GitHub "yinfei8 / LuaHelper"]]. *Operation: *"To customize Run and Debug, create a launch.json file" => Select "LuaHelper: Debug". *"Run / Start Debugging" or "Run / Run Without Debugging" - Debugging aborts without notice, immediately :-(. *Did not yet work for me neither on Windows nor on Linux :-(. == Alex D. "Lua Debug" == *[[http://marketplace.visualstudio.com/items?itemName=AlexD77.lua-debug|Visual Studio Marketplace, Alex D. "Lua Debug"]]. *[[http://www.github.com/ASDAlexander77/TypeScriptLua/tree/master/vscode-lua-debug|GitHub "ASDAlexander77 / TypeScriptLua / vscode-lua-debug"]]. *Operation on Windows: *"To customize Run and Debug, create a launch.json file" ⇒ Select "Lua Debug". *"Run / Start Debugging" or "Run / Run Without Debugging" - Debugging aborts without notice, immediately :-(. *Operation on Linux: *"To customize Run and Debug, create a launch.json file" ⇒ Select "Lua Debug". *Debugger starts, error message during debugging: stdin:1: syntax error near '1' *Did not yet work for me neither on Windows nor on Linux :-(. == qing wang "LuaPanda" == *[[http://marketplace.visualstudio.com/items?itemName=stuartwang.luapanda|Visual Studio Marketplace, qing wang "LuaPanda"]]. *[[http://www.github.com/Tencent/LuaPanda|GitHub "Tencent / LuaPanda"]] - "lua debug and code tools for VS Code". *[[http://www.github.com/Tencent/LuaPanda/blob/master/Docs/Manual/quick-use.md|GitHub "Tencent / LuaPanda" - "Manual/quick-use.md"]]. *Operation on Windows and Linux: *"To customize Run and Debug, create a launch.json file" ⇒ Select "LuaPanda". *"Run / Start Debugging" causes a debug mode where I can´t do a step, but just a pause?! *"Run / Run Without Debugging" is denied both on Windows & Linux by the VSC error message :-(: Cannot read property 'join' of undefined *Did not yet work for me neither on Windows nor on Linux :-(. == leafvmaple "Lua Debugger" == -[[http://marketplace.visualstudio.com/items?itemName=leafvmaple.vscode-zlua|Visual Studio Marketplace, leafvmaple "Lua Debugger"]]. *[[http://www.github.com/leafvmaple/vscode-zlua|GitHub "leafvmaple / vscode-zlua"]] - Source code not available :-(. *Operation: *"To customize Run and Debug, create a launch.json file" => Select "Lua Debug". *On Windows, "Run / Start Debugging" or "Run / Run Without Debugging" causes the VSC error message: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at validate String internal/validators.js:124:11) at Object.normalize (path.js 266:5 at c.launchRequest (c\Users\Administrator.vscode extensions\leafvmaple.vscode-zlua-01.5\dist adapte .2243) at c.dispatchRequest (c\Users\Administrator\.vscode extensions\leafvmaple vscode-ziua-0.15\dist adiant..25278) at cdispatchRequest (c\Users\Administrator.vscode extensions leafvmaple vscode-ziua-0.15\dist adapt.14030 at chandleMessage (C\Users\Administrator.vscode extensions leafvmaple.vscode ziua-0.15\distaciant.-10957) at c_handleData (c\Users\Administrator. vscode extensions leaf maple scodela-0.75\dist adiant....12621 at Socket *On Linux, "Run / Start Debugging" or "Run / Run Without Debugging" causes the VSC error message: TypeError (ERR_INVALID ARG_TYPE]: The "path" argument must be of type string. Received undefined at validateString (internal/validators.js:124:11) at Object normalize (path.js:1005:5) at c.launchRequest (/home/node/.vscode/extensions/leafvmaple.vscode- zlua-0.1.5/dist/adapter.js:1:2248) atc dispatchRequest (/home/node8/.vscode/extensions/leafvmaple.vscode zlua 0.1.5/dist/adapter.js:1:25278) at c.dispatchRequest (/home/node/.vscode/extensions/leafvmaple.vscode zlua-0.1.5/dist/adapter.js:1:14630) at chandleMessage (/home/node/.vscode/extensions/leafvmaple vscode- zlua-0.1.5/dist/adapter.js:1:10967) atc. handleData (/home/node/vscode/extensions/leaf maple vscode- zlua 0.1.5/dist/adapter.js:1:12621) at Socket anonymous (/home/node/.vscode/extensions/leafvmaple vscode zlua 0.1.5/dist/adapter.js:1:11300) at Socket emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) CALL STACK *Did not yet work for me neither on Windows nor on Linux :-(. == wellshsu "luaide-lite" == *[[http://marketplace.visualstudio.com/items?itemName=wellshsu.luaide-lite|Visual Studio Marketplace, wellshsu "luaide-lite"]]. *Operation on Windows and Linux: *"To customize Run and Debug, create a launch.json file" ⇒ Select "LuaDebug". 5 JSON debugging configurations are generated: "Unity-Remote (Scripts)", "Cocos-Remote (Scripts)", "Cocos-Launch (Scripts)", "Lua51-Launch (Scripts)", "Debug Current File". *On Windows, the debugger starts by "LuaDebug Server is listening at 7003", but then the debugger aborts by the error messsage: c:\Users\\.vscode\extensions\wellshsu.luaide-lite-0.2.3\res\debug\win32\lua: (command line):1: module 'LuaDebug' not found: *On Linux, the debugger starts by "LuaDebug Server is listening at 7003" but hangs immediately, just the symbols "Pause", "Restart" and "Stop" are active. *Did not yet work for me neither on Windows nor on Linux :-(. == mayishidai "luaide-lite-up" == *[[http://marketplace.visualstudio.com/items?itemName=mayishidai.luaide-lite-up|Visual Studio Marketplace, wellshsu "luaide-lite"]]. *Operation on Windows and Linux: *"To customize Run and Debug, create a launch.json file" ⇒ Select "LuaDebug". 5 JSON debugging configurations are generated: "Unity-Remote (Scripts)", "Cocos-Remote (Scripts)", "Cocos-Launch (Scripts)", "Lua51-Launch (Scripts)", "Debug Current File". *On Windows, the debugger starts by "LuaDebug Server is listening at 7003", but then the debugger aborts by the error messsage: c:\Users\\.vscode\extensions\wellshsu.luaide-lite-0.2.3\res\debug\win32\lua: (command line):1: module 'LuaDebug' not found: *On Linux, the debugger starts by "LuaDebug Server is listening at 7003" but hangs immediately, just the symbols "Pause", "Restart" and "Stop" are active. *Did not yet work for me neither on Windows nor on Linux :-(. == kangping "luaide" == *[[http://marketplace.visualstudio.com/items?itemName=kangping.luaide|Visual Studio Marketplace, kangping "luaide"]]. *Operation on Windows and Linux: *"To customize Run and Debug, create a launch.json file" ⇒ Select "LuaDebug". 8 JSON debugging configurations are generated: "Cocos2-Launch (Scripts)", "COCOS(remote debugging) (Scripts)", "Unity-ulua (Scripts)", "Unity-slua (Scripts)", "Unity-xlua (Scripts)", "OpenResty (Scripts)", "LuaTest (Scripts)", "Debug Current File". *Error message Configuration 'Debug Current File' is missing in 'launch.json'. *The debugger starts, but due to some pop-up messages and input windows in chinese language, I did not manage to operate it. *Did not yet work for me neither on Windows nor on Linux :-(. == OpenLuat Wendal Chen "LuatOS Debug" == *[[http://marketplace.visualstudio.com/items?itemName=openluat-wendal.luatos-debug|Visual Studio Marketplace, OpenLuat Wendal Chen "LuatOS Debug"]]. == OpenLuat colin "Skynet Debugger" == *[[http://marketplace.visualstudio.com/items?itemName=colinsusie.skynet-debugger|Visual Studio Marketplace, colin "Skynet Debugger"]] - "A Lua debugger for skynet". *[[http://www.github.com/colinsusie/skynetda|GitHub "colinsusie / skynetda"]]. == OpenLuat murru "tadpole Debugger" == *[[http://marketplace.visualstudio.com/items?itemName=murru.tadpole-debugger|Visual Studio Marketplace, murru "tadpole Debugger"]] - "A Lua debugger for tadpole". *[[http://www.github.com/colinsusie/skynetda|GitHub "colinsusie / skynetda"]]. == "Test Explorer UI" == *"Test Explorer UI" => See on this page. *Depends on "Lua Debug" :-(. == Proper Setting in the VSC "settings.json" File == *My data for Windows "C:\Users\\AppData\Roaming\Code\User\settings.json": { "LuaCoderAssist.luacheck.configFilePath": "C:\\Users\\Administrator\\Documents\\My Games\\CORE\\Saved\\Maps", "LuaCoderAssist.luacheck.execPath": "C:\\int\\w64\\develop\\lua", "LuaCoderAssist.luaparse.luaversion": 5.3, "lua.targetVersion": "5.3", "lua.luacheckPath": "C:\\int\\w64\\develop\\lua\\luacheck.bat", "lua.debug.settings.luaVersion": "5.3", "lua-local.interpreter": "lua" } *My data for Linux "~/.config/Code/User/settings.json" = "/home//.config/Code/User/settings.json": { "LuaCoderAssist.luacheck.configFilePath": "~/lua", "LuaCoderAssist.luacheck.execPath": "/usr/bin/", "LuaCoderAssist.luaparse.luaversion": 5.3, "lua.targetVersion": "5.3", "lua.luacheckPath": "/usr/bin/luacheck" "lua.debug.settings.luaVersion": "5.3", "lua-local.interpreter": "lua" } == Resources == *[[http://stackoverflow.com/questions/61232474/how-to-debug-lua-in-visual-studio-code|StackOverflow "How to Debug Lua in Visual Studio Code"]]. *[[http://marketplace.visualstudio.com/search?term=lua&target=VSCode|Visual Studio Marketplace, VSCode - Search for "lua"]]. === Some other IDEs & Debuggers === *The commercial IDE & debugger [[http://www.unknownworlds.com/decoda|decoda - A powerful Lua IDE and debugger]] for Windows - 30 days evaluation version. *Eclipse. *[[http://www.eclipse.org/ldt/|Eclipse "Lua Development Tools (LDT)"]]. *[[http://projects.eclipse.org/projects/tools.ldt|Eclipse Projects "Eclipse Lua Development Tools"]]. *[[http://marketplace.eclipse.org/category/free-tagging/lua|Lua Marketplace "Lua"]]. *[[http://www.inf.puc-rio.br/~roberto/ldb.html|Ldb: A debugger for Lua]] - Free use just in academic context. *The free [[http://www.jetbrains.com/idea/|JetBrains "IntelliJ IDEA"]], Community Edition. *Plugins: -[[http://plugins.jetbrains.com/plugin/9768-emmylua|JetBrains Marketplace "EmmyLua"]]. *[[http://www.github.com/EmmyLua/|GitHub "EmmyLua"]] for IntelliJ and VSCode. -[[http://plugins.jetbrains.com/plugin/5055-lua|JetBrains Marketplace "Lua"]] -Experts told me that it is less powerfull than the EmmyLua plugin. *[[http://luaedit.sourceforge.net/|SourceForge "LuaEdit - Free IDE/Debugger/Editor for Lua"]], [[http://www.sourceforge.net/projects/luaedit|SourceForge "LuaEdit"]]. *The discontinued "Lua Glider" IDE. *[[http://www.mydevelopersgames.com/Glider/|Archive.org "The Complete Lua IDE"]] ( - 2017-07-01 ). *[[http://www.innolitics.com/portfolio/glider/|Innolitics LLC "Glider IDE"]]. *[[http://web.archive.org/web/*/http://plugins.netbeans.org/plugin/52786/lua-glider-netbeans-edition|Archive.org "NetBeans Plugin 'Lua Glider NetBeans Edition - plugin detail'"]] ( - 2021-03-04 ). *[[http://en.freedownloadmanager.org/Windows-PC/Lua-Glider-FREE.html|FDM Lib "Lua Glider by M.Y. Developers"]] - "Lua Performance Validator, Canopy Glide or nGlide, which might be similar to Lua Glider". *[[http://forums.solar2d.com/c/glider-ide/|Solar2d Forums - Categories "Glider (IDE)"]]. *The commercial IDE [[http://www.luastudio.net/|NTSQ-Computing, Inc "LuaStudio"]] - "A professional development environment for debugging Lua script in your applications". 30 days evaluation version. *The free [[http://www.scormpool.com/luastudio/|SCORMpool "LuaStudio"]]. *[[http://play.google.com/store/apps/details?id=com.codeservice.app.luastudio|Google Play, Alex Mokrushyn "LuaStudio"]]. *[[http://www.github.com/luastudio/|GitHub "luastudio"]] - Just "Samples for LuaStudio v2.2.x", not the source code. *The OpenSource [[http://www.github.com/luaforge/lua-studio|GitHub "luaforge / lua-studio"]] - "Lua Studio is a simple IDE for Lua. It consists of an editor with syntax coloring, and an integrated debugger. Debugger can step into, step over, step out of the routine, or stop at a breakpoint. This is Windows project written in C++ and MFC". *The beggingware [[http://studio.zerobrane.com/|ZeroBrane Studio]] - "Lua IDE/editor/debugger for Windows, Mac OSX, and Linux". *[[http://studio.zerobrane.com/documentation|ZeroBrane Studio "Documentation"]]. *[[http://studio.zerobrane.com/doc-faq|ZeroBrane Studio "Frequently Asked Questions"]]. *[[http://studio.zerobrane.com/community|ZeroBrane Studio "Community"]]. *[[http://www.twitter.com/zerobrane|Twitter "Paul Kulchenko, @zerobrane"]]. *[[http://www.stackoverflow.com/questions/tagged/zerobrane|StackOverflow - Questions tagged [zerobrane]]]. *[[http://notebook.kulchenko.com/zerobrane/|Paul Kulchenko "ZeroBrane"]]. *[[http://notebook.kulchenko.com/zerobrane/debugging-and-live-coding-with-corona-sdk-applications-and-zerobrane-studio|Paul Kulchenko "ZeroBrane" - "Debugging and live coding with Corona SDK"]]. ==== Decompiler ==== *[[http://www.github.com/viruscamp/luadec|GitHub "viruscamp / luadec"]] - "Lua Decompiler for lua 5.1 , 5.2 and 5.3". ==== Documentation Generator ==== *[[https://www.doxygen.nl/|Doxygen]]. *[[http://www.github.com/alecchen/doxygen-lua|GitHub "alecchen / doxygen-lua"]], 2010 - "Make Doxygen support Lua". ==== EXE Generator ==== *[[http://www.github.com/ers35/luastatic|GitHub "luastatic"]] - "Build a standalone executable from a Lua program". ==== Luacheck - The #1 Linter ==== === Luacheck === *[[http://www.github.com/luarocks/|GitHub "luarocks"]]. *[[http://www.github.com/luarocks/luacheck|GitHub "luarocks/luacheck"]] *Windows. *"For Windows there is single-file 64-bit binary distribution, bundling Lua 5.3.4, Luacheck, LuaFileSystem, and LuaLanes using LuaStatic" => [[http://www.github.com/luarocks/luacheck/releases/|GitHub Releases "luacheck"]] - "luacheck.exe". *[[http://www.github.com/luarocks/luacheck/releases/|GitHub Releases "luarocks/luacheck"]] 0.24 - The binaries for Windows luacheck.exe - 613 KB ( 64-bit ), luacheck32.exe - 642 KB ( 32-bit ) don't work properly: [Linter] Error running Luacheck Error: [string "luacheck.fs"]:3: module 'lfs' not found: no field package.preload['lfs']. no module 'lfs' in luastatic bundle *[[http://www.github.com/luarocks/luacheck/issues/11|GitHub Issues "luarocks/luacheck" - "module 'lfs' not found #11"]]. *[[http://www.github.com/mpeterv/|GitHub "Peter Melnichenko"]]. *[[http://www.github.com/mpeterv/luacheck|GitHub "mpeterv/luacheck"]]. *[[http://www.github.com/mpeterv/luacheck/releases/|GitHub Releases "mpeterv/luacheck"]] 0.23 - The binary for Windows "luacheck.exe" works fine. *Linux. *[[http://packages.debian.org/source/stretch/luacheck|Debian "Source Package: luacheck"]]. *[[http://packages.debian.org/stretch/debhelper|Debian "Package: debhelper"]]. *[[http://packages.debian.org/stretch/dh-lua|Debian "Package: dh-lua"]]. *[[http://packages.debian.org/stretch/python-sphinx|Debian "Package: python-sphinx"]]. *[[http://www.zoomadmin.com/HowToInstall/UbuntuPackage/lua-check|ZoomAdmin "How To Install 'lua-check' Package on Ubuntu"]]. -"sudo apt-get update -y". -"sudo apt-get install -y lua-check". *Error message "E: Unable to locate package lua-check" :-( => See [[linux08.html|Linux 8/8 - Useful Commands & Tricks]]. *[[http://luacheck.readthedocs.io/en/stable/|Readthedocs "Luacheck documentation"]]. *[[http://www.luarocks.org/modules/mpeterv/luacheck|LuaRocks "luacheck"]]. === Resources === *"A tool for linting and static analysis of Lua code". *Experts told me that it is "the" #1 Lint tool for Lua :-). *Please install the 32-bit binaries ( for compatibility with MinGW 6.3 ). *Installation instructions: Install: "copy 'luacheck.exe' to a folder and add it to your PATH environment variable". *[[http://www.gitmemory.com/issue/luarocks/luacheck/11/706987355|GitMemory "module 'lfs' not found "]] - "I assumed that installing luacheck via luarocks installs lfs but I just checked and it doesn't. that was why I assumed it would work". ==== Make ==== *[[http://www.github.com/actboy168/luamake|GitHub "actboy168 / luamake]]". ==== Obfuscators ==== === Tools === *[[http://www.github.com/Direnta/LuaSeel|GitHub "LuaSeel"]] - "A simple lua obfuscator that uses bytecode encryption". *[[http://www.github.com/efrederickson/XFuscator|GitHub "XFuscator"]] - "Most advanced Lua obfuscator". === Free online Services === *[[http://www.glot.io/snippets/f1tt9okm5w|Glot "Lua obfuscator"]]. *[[http://repl.it/|Repl.it - The collaborative browser based IDE]] - "Code, create, and learn together. Use our free, collaborative, in-browser IDE to code in 50+ languages — without spending a second on setup". *[[http://www.repl.it/@1store/Lua-Obfuscator|Repl.it "Lua Obfuscator"]]. *[[http://www.reddit.com/r/roblox/comments/awxjcg/made_a_lua_obfuscator_that_is_partially_good_at/|Reddit "roblox", Thread "Made a lua obfuscator that is partially good at obfuscating scripts"]] - "If you want to protect your roblox game code then use this". *[[http://repl.it/talk/share/Roblox-Lua-Obfuscator/9520|Repl.it "Roblox Lua Obfuscator"]]. === Resources === ==== Packet Manager ==== === LuaDist === *[[http://www.luadist.org/|LuaDist - A distribution of the Lua programming language]] - Discontinued :-(. *[[http://www.github.com/LuaDist|GitHub "The Lua Language distribution [Archived]"]]. *"LuaDist is a true multi-platform package management system that aims to provide both source and binary repository of modules for the Lua programming language". *"The LuaDist project is no longer maintained! Please try [[http://www.luarocks.org/|LuaRocks]] instead". === LuaRocks === *[[http://www.luarocks.org/|LuaRocks]] - "The package manager for Lua modules". *[[http://www.github.com/luarocks/|GitHub "LuaRocks"]]. *[[http://www.luarocks.org/modules|LuaRocks "All Modules"]]. *Installation of packages "luarocks install ". == LuaRocks on Windows == *[[http://www.github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows|GitHub Wiki for "LuaRocks" - "Installation instructions for Windows"]] => "Windows binary download". *[[http://www.stackoverflow.com/questions/41329860/luarocks-installation|StackOverflow "Luarocks Installation"]]. *[[http://www.training-course-material.com/images/1/11/Installing_LuaRocks.pdf|NobleProg "Training Material" - "Installing LuaSocket"]] - "Install LuaRocks". *Suggestion to append some data to the environment settings for LuaRocks. *[[http://www.thijsschreijer.nl/blog/?p=772|Tieske. Thijs Schreijer's techie stuff "Setting up a basic Lua installation on Windows"]]. *LuaDist, LuaRocks, MinGW, LuaSocket, ZeroBrane studio,... *Suggestion to append some data to the environment settings for LuaRocks ( **of 2013, for Lua 5.2 on Win7 & Win8** ). *[[http://www.stackoverflow.com/questions/59155592/how-to-set-require-in-vscode-lua-settings-json|StackOverflow "How to set require in vscode Lua settings.json"]] - Suggestion to add a path to the Lua script variable "package.path" to name the location of Lua files created by LuaRocks when installing packages by LuaRocks. *My proper settings for Lua 5.3 on Win10: PATH = C:\Program Files (x86)\LuaRocks; LUA_PATH = ./; .\?\init.lua; C:\Users\\AppData\Roaming\luarocks\share\lua\5.3\?.lua; C:\Users\\AppData\Roaming\luarocks\share\lua\5.3\?\init.lua; .\?.lua; LUA_CPATH = .\?.dll;C:\Users\\AppData\Roaming\luarocks\lib\lua\5.3\?.dll *When running Lua Scripts by Powershell & CMD on Windows: *A Lua script executing "print(package.path)" prints the contents of the environment string variable "LUA_PATH" as stderr output on a Powershell or CMD console: ./;.\?.lua;.\?\init.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?\init.lua; *Executing Lua scripts with "require()" statements works fine, both for local Lua modules and for Lua modules installed by LuaRocks. *When executing Lua Scripts in VisualStudio Code on Windows, by the VSC plugin "Local Lua Debugger": *A Lua script executing "print(package.path)" prints the contents of the environment string variable "LUA_PATH" and additional "c:\Users\Administrator\.vscode\extensions\tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua" as output on the VSC Debug console: ./;.\?.lua;.\?\init.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?.lua;C:\Users\Administrator\AppData\Roaming\luarocks\share\lua\5.3\?\init.lua;c:\Users\Administrator\.vscode\extensions\tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua *When executing Lua Scripts in VisualStudio Code on Windows, by the VSC plugin "Lua Debug": *A Lua script executing "print(package.path)" prints as output on the VSC Debug console :-(, e.g.: C:\Users\\WorkingDirectory/?.lua *A Lua script executed in VisualStudio Code on Windows, by the VSC plugin "Lua Debug", processes "require()" statements properly for local Lua modules not installed by LuaRocks. *A Lua script executed in VisualStudio Code on Windows, by the VSC plugin "Lua Debug", may process "require()" statements for Lua modules installed by LuaRocks, if the string contents of the environment variable "LUA_PATH" ( or relevant part of it ) are added to the global Lua variable "package.path": package.path = package.path .. ";C:\\Users\\\\AppData\\Roaming\\luarocks\\share\\lua\\5.3\\?.lua;" lu = require("luaunit") *[[http://www.github.com/actboy168/lua-debug/issues/136|GitHub "actboy168 / lua-debug" Issue "print(package.path) != %LUA_PATH% ( 1.38.0 on Win10, 64bit ) #136"]] - Suggested workaround "Add path in launch.json, it can specify package.path". *[[http://www.stackoverflow.com/questions/43983718/set-global-path-environment-variable-in-vs-code|StackOverflow "How to extend $PATH in launch.json in Visual Studio Code?"]]. *[[http://www.stackoverflow.com/questions/47662998/how-to-extend-path-in-launch-json-in-visual-studio-code|StackOverflow "Set global $PATH environment variable in VS Code"]]. *[[http://code.visualstudio.com/docs/editor/variables-reference#_environment-variables|Visual Studio Code Docs "Environment variables#"]]. *So You may either add the missing LUA_PATH - this solution works both for Windows and Linux ! -: *By the VSC Extension Settings for "Lua Debug" ( recommended! ) Lua > Debug > Settings: Path Search path for Lua programs ${env:LUA_PATH} *Or by modifying "launch.json". My "launch.json" file adds the missing LUA_PATH to "package.path": { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: [[http://go.microsoft.com/fwlink/?linkid=830387|http://go.microsoft.com/fwlink/?linkid=830387]] "version": "0.2.0", "configurations": [ { "type": "lua", "request": "launch", "name": "Debug", "program": "${workspaceFolder}/run_my_first_module.lua", "path": "${env:LUA_PATH}" } ] } *LuaRocks configuration message on my Windows10 computer: Configuration files: System : C:/Program Files (x86)/luarocks/config-5.3.lua (not found) User : C:/Users//AppData/Roaming/luarocks/config-5.3.lua (not found) Project : C:\Users\\Documents\My Games\CORE\Saved\Maps\\Data\Scripts/./.luarocks/config-5.3.lua (ok) Rocks trees in use: C:\Users\\Documents\My Games\CORE\Saved\Maps\\Data\Scripts/./lua_modules ("project") C:\Users\\AppData\Roaming/luarocks ("user") *"luarocks init". *[[http://www.github.com/luarocks/luarocks/issues/1058|GitHub "luarocks/luarocks/issues" - "LuaRocks 3.1.3 Windows Warning: Could not find a Lua 5.3 interpreter in your PATH #1058"]]. *Error message: Error: unknown option '-e' Did you mean '-h'? Warning: No Lua interpreter detected for version 5.3. Not creating ./lua.bat == LuaRocks on Linux == *[[http://www.opensource.com/article/19/11/getting-started-luarocks|opensource.com "Make Lua development easy with Luarocks"]]. *"Search for a library with Luarocks". *"Install a library with Luarocks". *"Your default tree when installing libraries locally is $HOME/.luarocks, but you can redefine it arbitrarily". *[[http://www.github.com/luarocks/luarocks/issues/342|GitHub "luarocks/luarocks" Issues "Linux PATH for lua rocks #342"]].export LUA_PATH='/home/stefan/.luarocks/share/lua/5.3/?.lua;/home/stefan/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua' export LUA_CPATH='/home/stefan/.luarocks/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so' *[[http://www.stackoverflow.com/questions/33819911/preferred-way-to-configure-luas-load-path/34078052|StackOverflow "Preferred Way to Configure Lua's Load Path"]]. *[[http://community.exasol.com/t5/database-features/exasol-loves-lua-part-3-handling-modules/ta-p/2134|Exasol Community "Exasol loves Lua (part 3) - Handling modules"]]. *"Under Linux a typical LUA_PATH contains entries like these: '/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;./?.lua;'[...]and many more... A file that from the perspective of the LUA_PATH can be found under 'exasolvs/query_renderer.lua' is treated by Lua as if you named it 'exasolvs.query_renderer'... Lua remembers which packages are loaded in 'package.loaded' ". *[[http://unix.stackexchange.com/questions/53151/using-a-lua-rock-installed-with-luarocks|StackExchange "Using a lua rock installed with luarock"]], 2012 - List of pathes where Lua looks for .Lua files, and so installed LuaRocks packages. *[[http://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables|StackExchange "How to permanently set environmental variables"]]. *[[http://www.askubuntu.com/questions/58814/how-do-i-add-environment-variables|AskUbuntu "How do I add environment variables?"]]. *My proper settings for Lua 5.3 on Linux, in "/etc/profile": LUA_PATH='~/.luarocks/share/lua/5.3/?.lua;~/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua' LUA_CPATH='~/.luarocks/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so' export LUA_PATH export LUA_CPATH *When running Lua Scripts by Bourne shell on Debian Linux: *A Lua script executing "print(package.path)" prints the contents of the environment string variable "LUA_PATH" as stderr output on a Powershell or CMD console: ~/.luarocks/share/lua/5.3/?.lua;~/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua *When running Lua Scripts in VisualStudio Code on Debian Linux, by the VSC plugin "Local Lua Debugger": *A Lua script executing "print(package.path)" prints the contents of the environment string variable "LUA_PATH" and additional "/home/node8/.vscode/extensions/tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua" as output on the VSC Debug console: ~/.luarocks/share/lua/5.3/?.lua;~/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua;/home/node8/.vscode/extensions/tomblind.local-lua-debugger-vscode-0.2.1/debugger/?.lua *LuaRocks configuration message on my Debian Linux computer: module 'luarocks.cfg' not found: no field package.preload['luarocks.cfg'] no file '~/.luarocks/share/lua/5.3/luarocks/cfg.lua' no file '~/.luarocks/share/lua/5.3/luarocks/cfg/init.lua' no file '/usr/local/share/lua/5.3/luarocks/cfg.lua' no file '/usr/local/share/lua/5.3/luarocks/cfg/init.lua' no file '/usr/local/lib/lua/5.3/luarocks/cfg.lua' no file '/usr/local/lib/lua/5.3/luarocks/cfg/init.lua' no file './luarocks/cfg.lua' no file './luarocks/cfg/init.lua' no file '~/.luarocks/lib/lua/5.3/luarocks/cfg.so' no file '/usr/local/lib/lua/5.3/luarocks/cfg.so' no file '/usr/local/lib/lua/5.3/loadall.so' no file './luarocks/cfg.so' no file '~/.luarocks/lib/lua/5.3/luarocks.so' no file '/usr/local/lib/lua/5.3/luarocks.so' no file '/usr/local/lib/lua/5.3/loadall.so' no file './luarocks.so' *Where does LuaRocks install packages ( e.g. "luaunit" ) on my Debian Linux computer? *Test files for LuaUnit: /usr/local/lib/luarocks/rocks/luaunit/3.4-1/test *LuaRocks as installed on Debian Linux 10.7 with Lua 5.3.3 by "sudo apt install luarocks", puts the important start script file for a Lua package ( e.g. "sudo luarocks install luaunit" => file "luaunit.lua" ) into a "5.1" directory, instead in a "5.3" directory :-(. /usr/local/share/lua/5.1 *[[http://www.askubuntu.com/questions/843740/how-to-create-a-symbolic-link-in-a-linux-directory|AskUbuntu "How to create a symbolic link in a linux directory?"]]. *To fix that, either you have to created a "5.3" directory and copy the "5.1" data into it, or to set a soft link, so that the installed code is available for Lua5.3 users: cd /usr/local/share/lua sudo ln -s ./5.1 ./5.3 cd /usr/local/lib/lua sudo ln -s ./5.1 ./5.3 == Resources == *There is the command "luarocks init" on Windows :-), but not on Linux :-(. *[[http://www.gitter.im/luarocks/luarocks|Gitter "LuaRocks/luarocks"]]. === LuaFileSystem === *[[http://keplerproject.github.io/luafilesystem/|GitHub.io "Keplerproject" - "LuaFileSystem"]], [[http://www.github.com/keplerproject/luafilesystem|GitHub "keplerproject/luafilesystem"]]. ==== Profiler ==== *[[http://www.lua-users.org/wiki/ProfilingLuaCode|Lua-Users "Profiling Lua Code"]]. ==== Testing, Unit Test ==== === Unit Test Frameworks, Mocking, & Build-Test-Deploy Toolchains === == BTDLua ( build-test-deploy Development Environment ) == *[[http://awl.zone/Lua/ut/|AWL - Industrial Automation Services "BTD ( build-test-deploy Development Environment )"]]. *"The BTDLua library contains a unit testing framework and a IUP robot. They can be used seperately". *BTD unit test depends on luafilesystem 1.4.2 and on NMPLua". *Lua-Users: "Unit testing inspired by jUnit and originally based on LuaUnit". == busted == *[[http://www.olivinelabs.com/busted/|Olivine-Labs "busted : Elegant Lua unit testing"]] - "works with lua >= 5.1, moonscript, terra, and LuaJIT >= 2.0.0.". *[[http://www.github.com/Olivine-Labs/busted|GitHub "Olivine-Labs / busted"]]. *[[http://www.programmersought.com/article/3159242364/|Programmer Sought "Lua Busted unit test introduction (Windows environment)"]]. *[[http://www.testanything.org/producers.html#lua|Test Anything Protocol "TAP Producers"]] - "A unit testing framework for Lua with a built-in TAP output hand". *[[http://www.bountysource.com/teams/olivine-labs/issues?tracker_ids=248837|Bountysource "Olivine-Labs"]]. *[[http://ericjmritz.wordpress.com/2013/08/26/lua-unit-testing-first-impressions-of-busted/|Wordpress "One More Game-Dev and Programming Blog By Eric James Michael Ritz" - "Lua Unit Testing: First Impressions of Busted"]], 2013. *Lua-Users: "Behavior Driven Development (BDD) unit testing library, with various outputs formats including TAP and focus on elegance". == Gambiarra == *[[http://git.kokolor.es/imo/gambiarra|KOKOLOR.ES Sources "imo/gambiarra"]] - "A tiny lua unit-testing library. This is fork of: [[http://bitbucket.org/zserge/gambiarra|http://bitbucket.org/zserge/gambiarra]]". "Gambiarra is a Lua version of Kludjs, and follows the idea of ultimately minimal unit testing". == LuaDist == *[[http://www.github.com/sipwise/lua-lemock|GitHub "sipwise / lua-lemock"]] - "[DEPRECATED] LeMock (Lua Easy Mock) for unit test". *[[http://web.archive.org/web/*/http://www.luaforge.net/projects/lemock/|Archive.org "LuaForge 'LuaDist'" ( luaforge.net/projects/lemock )]]. == luaspec == *[[http://www.github.com/mirven/luaspec/|GitHub "mirven / luaspec"]] - "A specification framework for lua". *Lua-Users: "Behavior Driven Development (BDD) test framework". == LuaUnit # == *[[http://www.github.com/bluebird75/luaunit|GitHub "bluebird75 / luaunit"]] - "LuaUnit is a popular unit-testing framework for Lua, with an interface typical of xUnit libraries (Python unittest, Junit, NUnit, ...). It supports several output formats (Text, TAP, JUnit, ...) to be used directly or work with Continuous Integration platforms (Jenkins, Maven, ...)". *[[http://luaunit.readthedocs.io/|ReadTheDoch "LuaUnit"]]. *For porting LuaUnit to Lua@CORE, these functions of "luaunit.lua" must be especially examined and understood: *function TestLuaUnitExecution:canNotExitDuringLuaUnitExecution() => TODO. *function M.LuaUnit:execOneFunction(className, methodName, classInstance, methodInstance). *function M.LuaUnit:updateStatus( err ) -- "err" is expected to be a table / result from protectedCall(). *function M.LuaUnit:protectedCall(classInstance, methodInstance, prettyFuncName). *Test methods defined in test arrays => "xpcall( function () methodInstance(classInstance) end, err_handler )". *Test methods => "xpcall( function () methodInstance() end, err_handler )". *Core "test_luaunit": *"function TestLuaUnitAssertions:test_assertAlmostEquals()" *While executing "lu.assertAlmostEquals( {1}, {1}, 0.1 )" => "attempt to index a nil value (upvalue 'lu')". *"local function assertFailure( ... )". *Core "luaunit": *"function M.assertEquals(actual, expected, extra_msg_or_nil, doDeepAnalysis)". *function M.adjust_err_msg_with_iter( err_msg, iter_msg ) *function TextOutput:displayOneFailedTest( index, fail ). *function TextOutput:displayErroredTests(). *displayFailedTests() => "Failed tests" => I don´t have *node:error( err.msg, err.trace ). *function TextOutput:endSuite() *File "run_my_first_unittest_on_core.lua", comparison Lua vs. Lua@CORE: *"local function failure(main_msg, extra_msg_or_nil, level)". *"local function err_handler(e)" is not called in case of failed tests. *Lua: Failed tests, Lua@Core: Test with errors. *File "test_luaunit.lua": *Lua@CORE: TestLuaUnitAssertions.test_assertAlmostEquals [F3F24234CBCA6040] test_luaunit:1226: attempt to index a nil value (upvalue 'lu') *=> "lu" is not valid, i.e. it's value is "nil" :-(. *In the function "function M.LuaUnit:protectedCall(classInstance, methodInstance, prettyFuncName)", "err.msg" might contain[49BF5218E0550388] luaunit:3076: attempt to yield across a C-call boundary *[[http://www.github.com/openresty/lua-resty-redis/issues/3|GitHub "openresty / lua-resty-redis", Issue "'attempt to yield across C-call boundary' occur while connect() #3"]]. *[[http://www.github.com/leafo/lapis-redis/issues/5|GitHub "runtime error: attempt to yield across C-call boundary due to lua-resty-redis connect() invocation #5"]]. *[[http://www.love2d.org/forums/viewtopic.php?t=84000|LÖVE Forums "Attempt to yield across C-call boundary"]]. *[[http://www.lua-users.org/lists/lua-l/2008-05/msg00181.html|Lua-Users "attempt to yield across metamethod/C-call boundary"]]. *[[http://devforum.roblox.com/t/2044-824-attempt-to-yield-across-metamethod-c-call-boundary/447042|Roblox Developer Forum "20:01:44.824 - attempt to yield across metamethod/C-call boundary"]]. *[[http://devforum.roblox.com/t/unknown-error-attempt-to-yield-across-metamethod-c-call-boundary/931807|Roblox Developer Forum "Unknown error - attempt to yield across metamethod/C-call boundary"]]. *[[http://scriptinghelpers.org/questions/74884/attempt-to-yield-across-metamethodc-call-boundary-workaround|ScriptingHelpers "attempt to yield across metamethod/C-call boundary workaround?"]]. *[[http://www.stackoverflow.com/questions/65664447/lua-yielding-across-c-call-boundary|StackOverflow "Lua yielding across C-call boundary"]]. *[[http://www.stackoverflow.com/questions/8459459/lua-coroutine-error-tempt-to-yield-across-metamethod-c-call-boundary|StackOverflow "Lua coroutine error: tempt to yield across metamethod/C-call boundary"]]. *[[http://web.archive.org/web/*/http://blog.octetcloud.com/?p=32|octetcloud.com "Comments on lua unit test frameworks"]], 2014 - "luaunit - Seems like a port of pyunit's OO framework, unnecessarily heavyweight for lua" :-(. *Lua-Users: "no dependencies" :-). *"--output OUTPUT: Set output type to OUTPUT. Possible values: text, tap, junit, nil" => TAP support. *Problems with CORE, I checked: == lunatest == *[[http://www.github.com/silentbicycle/lunatest|GitHub "silentbicycle / lunatest"]] - "xUnit-style + randomized unit testing framework for Lua (and C projects using Lua, etc.). It's largely upwardly compatible from lunit, with some changes". == lunit == *[[http://www.mroth.net/lunit|Michael Roth "lunit - Unit Testing Framework for Lua"]]. *[[http://www.github.com/mrothNET/lunit|GitHub "mrothNET / lunit"]] - "Unit Testing Framework for Lua". *[[http://www.luarocks.org/modules/bluebird75/luaunit|LuaRocks "LuaUnit"]]. *[[http://luaunit.readthedocs.io/|ReadTheDocs "LuaUnit"]]. == lunitx == *[[http://www.github.com/dcurrie/lunit|GitHub "dcurrie / lunit"]] - "This is lunitx Version 0.8.1, an extended version of Lunit for Lua 5.2, 5.3, and 5.4". *[[http://www.github.com/sam-github/lunit|GitHub "sam-github / lunit"]] - "This is lunitx Version 0.6, an extended version of Lunit for Lua 5.2". == Lunity == *[[http://www.github.com/Phrogz/Lunity|GitHub "Phrogz / Lunity"]] - "Simple-but-rich unit testing for Lua". *Lua-Users: "(similar to lunit, but can only run a single file and doesn't distinguish between errors and test assertions)" :-(. == Jasper Lyons' 31-Lines UnitTest Frameworks == *[[http://www.medium.com/@ioverthoughtthis/a-lua-testing-framework-in-31-lines-2f6cfd067126|Medium, Jasper Lyons "A Lua testing framework in 31 lines"]]. == Mediawiki / Wikipedia == *[[http://en.wikipedia.org/wiki/Wikipedia:Lua|Wikipedia "Wikipedia:Lua"]]. *[[http://en.wikipedia.org/wiki/Module:UnitTests|EN.Wikipedia "Module:UnitTests"]]. *[[http://en.wikipedia.org/wiki/Module:ScribuntoUnit|EN.Wikipedia "Module:ScribuntoUnit"]]. *[[http://www.mediawiki.org/wiki/Extension:Scribunto|Mediawiki "Extension:Scribunto"]] - "The Scribunto (Latin: "they shall write/let them write (in the future)") extension allows for embedding scripting languages in MediaWiki. Currently the only supported scripting language is Lua". == Minctest == *[[http://www.github.com/codeplea/minctest-lua|GitHub "codeplea / minctest-lua"]] - "tiny unit testing framework for Lua". *A port of [[http://www.codeplea.com/minctest|CodePlea "C Unit Testing Library: Minctest"]]. == mockagne == *[[http://www.github.com/mockagne/mockagne|GitHub "mockagne / mockagne - Mocking Framework for Lua"]]. == François Perrad == *[[http://fperrad.frama.io/lua-TestMore/|François Perrad "lua-TestMore"]] - "It uses the Test Anything Protocol as output, that allows a compatibility with the Perl QA ecosystem". *[[http://www.framagit.org/fperrad/lua-TestMore|framagit "fperrad / lua-TestMore"]]. *[[http://web.archive.org/web/*/http://fperrad.github.com/lua-TestMore/|Archive.org "GitHub "lua-TestMore"]]. *This is a port of [[http://perldoc.perl.org/Test::More|PerlDoc "Test::More"]]. *[[http://fperrad.frama.io/lua-Harness/|lua-Harness|François Perrad "lua-Harness"]]. *[[http://framagit.org/fperrad/lua-Harness|framagit "fperrad / lua-Harness"]]. == QhunUnitTest == *[[http://www.github.com/wartoshika/wow-QhunUnitTest|GitHub "wartoshika / wow-QhunUnitTest"]] - "A, object orientated World of Warcraft unit testing framework". == Shake == *[[http://www.github.com/keplerproject/shake|GitHub "keplerproject / shake"]]. *"Shake is a simple and transparent test engine for Lua that assumes that tests only use standard assert and print calls. If you are looking for a xUnit style framework, check lunit and luaunit instead". *Lua-Users: "using basic assert-like syntax". == telescope == *[[http://www.github.com/norman/telescope|GitHub "norman / telescope"]] - "A highly customizable test library for Lua that allows declarative tests with nested contexts". *Lua-Users: "A highly customizable test library for Lua that allows for declarative tests with nested contexts. Uses BDD-style spec names". == Testy == *[[http://www.github.com/siffiejoe/lua-testy|GitHub "siffiejoe / lua-testy"]] - "Easy unit testing for Lua modules". *Lua-Users: "Lua script for minimal unit testing on Lua 5.1/5.2/5.3 that collects test functions from local variables". == u-test == *[[http://github.com/iudalov/u-test|GitHub "IUdalov / u-test"]] - "Sane and simple unit testing framework for Lua". *Lua-Users: "complete unit-testing framework for lua 5.1/5.2/5.3, inspired by googletest. Has colourful command line interface". === Test Explorer / Test Runner / Test Generator === == Lua unit test generator" (LUTG) == *[[http://ieeexplore.ieee.org/document/7437005|IEEE "Unit test code generator for lua programming language"]] ( abstract ). *[[http://www.researchgate.net/profile/Yani-Widyani/publication/304412614_Unit_test_code_generator_for_lua_programming_language/links/58b64d7792851c471d43cf2f/Unit-test-code-generator-for-lua-programming-language.pdf|ResearchGate, 2015 International Conference on Data and Software Engineering "Unit Test Code Generator for Lua Programming Language"]] ( PDF ), 2015. == Test Explorer UI # == *Components *[[http://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer|VisualStudio Marketplace, Holger Benl "Test Explorer UI"]] - "Test Explorer for Visual Studio Code". A third-party Test Adapter "LuaUnit Test Explorer" supports the execution of Lua tests. *[[http://www.github.com/hbenl|GitHub "hbenl (Holger Benl)"]]. *[[http://marketplace.visualstudio.com/items?itemName=lej.vscode-lua-test-adapter|VisualStudio Marketplace, Linus Sunde "Lua Test Adapter"]]. *[[http://www.github.com/Lej/vscode-lua-test-adapter|GitHub "Lej/vscode-lua-test-adapter"]] - "LuaUnit Test Adapter implementation for Test Explorer UI". *Depends on "Lua Debug" :-(. *"**Lua Debug**" by "actboy168" => See on this page. *How-to-operate help: [[http://code.visualstudio.com/api/get-started/your-first-extension|Microsoft Visual Studio Code "Your First Extension"]] ( CTRL-SHIFT-X, CTRL-SHIFT-P ). *[[http://www.stackoverflow.com/questions/35351885/lua-script-fails-with-module-not-found|StackOverflow "lua script fails with module not found"]]. *[[http://www.thijsschreijer.nl/blog/?p=1025|Tieske. Thijs Schreijer's techie stuff "Lua; configuring path settings"]]. === Resources === *[[http://www.github.com/nodemcu/nodemcu-firmware/issues/2145|GitHub "nodemcu / nodemcu-firmware" - Issues]] - "Create unit tests in Lua #2145". *"May I suggest running a test framework on a PC with access to a NodeMCU through [RPC]( [[http://www.github.com/ildar/tango/blob/master/README-NodeMCU.md|GitHub "tango/README-NodeMCU.md"]] )? I like 'busted' and it's already usable to test a node". *[[http://www.google.com/search?q=lua+unittest|Google - Search for "lua unittest"]]. *[[http://miacono.wordpress.com/2020/05/12/first-steps-testing-lua-code/|Matías Iacono "First steps testing Lua code"]], 2020 - "We will use Lua Unit". *[[http://help.interfaceware.com/forums/topic/unit-testing-the-lua-code|IGUANA Community "Unit testing the Lua code"]]. *[[http://www.lua-users.org/wiki/UnitTesting|Lua-Users "Unit Testing"]]. *[[http://lua-l.lua.narkive.com/j8J5Xipd/are-there-any-guide-or-best-practice-article-for-unit-test-with-lua|Narkive Mailinglist Archive "Are there any guide or best practice article for unit test with lua ?"]]. *[[http://web.archive.org/web/*/http://blog.octetcloud.com/?p=32|octetcloud.com "Comments on lua unit test frameworks"]], 2014 - lunit.lua, lunity.lua, moonunit, luaunit, shake. *Reddit. *[[http://www.reddit.com/r/lua/comments/haih3z/what_unit_test_frameworks_are_people_using/|Reddit "Lua" - Thread "What unit test frameworks are people using?"]]. *[[http://www.reddit.com/r/lua/comments/1i00kq/unit_test_framework_for_lua/|Reddit "Lua" - Thread "Unit test framework for lua?"]]. *[[http://www.stackoverflow.com/questions/46367353/how-can-i-test-functions-inside-a-single-file-lua-script|Stackoverflow "How can I test functions inside a single file Lua script?"]]# - Suggestion how to divide code + "luaunit" test framework ( 1 file ) into 4 different files :-). *[[http://www.rspamd.com/doc/tutorials/writing_tests.html|Rspamd Tutorials "Writing tests for Rspamd"]]. *[[http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#Lua|EN.Wikipedia "List of unit testing frameworks"]], [[http://de.wikipedia.org/wiki/Liste_von_Modultest-Software|DE.Wikipedia "Liste von Modultest-Software"]]. *[[http://www.zserge.com/posts/minimal-testing/|ZSerge's Blog "ultimately minimal unit testing"]] - "Lua: gambiarra". ==== Tracing ==== *[[http://www.github.com/geoffleyland/luatrace|GitHub "geoffleyland / luatrace"]] - "A tool for tracing Lua script execution and analysing time profiles and coverage". ==== Resources ==== *[[http://www.lua-users.org/wiki/LuaIntegratedDevelopmentEnvironments|Lua-Users "Lua Integrated Development Environments"]]. ===== Appropriate OpenDirectory Directory Pages ===== *[[http://www.dmoz.org/Computers/Programming/Languages/Lua/|OpenDirectory "Top: Computers: Programming: Languages: Lua"]]. *[[http://www.dmoz.org/World/Deutsch/Computer/Programmieren/Sprachen/Lua/|OpenDirectory "Top: World: Deutsch: Computer: Programmieren: Sprachen: Lua"]]. {{tag>"Lua eLua "embedded Lua" embedded systems}}