Last Modified: 2023-12-21
VS Code
for mac
https://code.visualstudio.com/docs/setup/mac
- Open the Command Palette (Cmd+Shift+P) and type ‘shell
- command’ to find the Shell Command: Install ‘code’ command in PATH command.
URLs
https://code.visualstudio.com/docs/editor/command-line#_opening-vs-code-with-urls
vscode://file/{full path to file}
### extensions
the following extensions helps your coding with Solar2D simulator.
- Solar2D Autocomplete
- Solar2d Companion for Visual Studio Code
- Local Lua Debugger
- Run Terminal Command
## Local Lua Debugger
For debugging with Local Lua Deubgger, launch.json should be placed in your workspace folder. For instance,
Assuming Kwik projects are located in ~/Kwik folder and this is your workplace folder of Visual Studio Code. launch.json will be created under .vscode/ folder
- ~/Kwik/.vscode/launch.json
> Corona Simulator.app is specified and ${file} is in the last argurment
this is for Mac
```json
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "lua-local",
"request": "launch",
"program": {
"command": "/Applications/Corona/Corona Simulator.app/Contents/MacOS/Corona Simulator",
},
"args": [
"-no-console"
"YES"
"-debug"
"1"
"-project"
"${file}"
]
}
]
}
for Windwos
{
"version": "0.2.0",
"configurations": [{
"name": "Debug",
"type": "lua-local",
"request": "launch",
"program": {
"command": "C:\\Program Files (x86)\\Corona Labs\\Corona\\Corona Simulator.exe",
},
"args": [
"/no-console",
"/debug",
"${file}"
]
}]
}
SingleBook project contains Photsohop/book/*.psd and lua files under Solar2D/src folder
- ~/Kwik/SingleBook/Solar2D/src/main.lua
open main.lua in Visual Studio Code and press F5 (Run > Start Debugging)
main.lua needs lldebugger.start()
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then local lldebugger = loadfile(os.getenv("LOCAL_LUA_DEBUGGER_FILEPATH"))() lldebugger.start() end
Run Terminal Command
this is a utility to run terminal commands. You can select a folder and right click opens a dialog to select a terminal command
You can add a terminal command to settings.json
for Mac
{
"command":"\"/Applications/Corona/Corona Simulator.app/Contents/MacOS/Corona Simulator\" ./ -no-console YES",
"name":"Solar2D"
},