Closed michael-uman closed 4 years ago
How did you set LUA_PATH? If you set it in the debugger configuration, it should be passed to the program:
{
"configurations": [
{
"name": "lesson6",
"type": "lua-local",
"request": "launch",
"stopOnEntry": true,
"cwd": "${workspaceFolder}",
"program": {
"lua": "lua",
"file": "${workspaceFolder}/lesson6.lua"
},
"environment": {
"LUA_PATH": "./?.lua"
}
}
]
}
Hello Tom,
Thank you for your prompt reply. You are mostly correct except for the name of the field. It is not 'environment' which needs to be set to ./?.lua
but rather env
.
I am using VSCode which identifies itself as:
Version: 1.40.1 (system setup)
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Date: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362
I am using WSL lua version 'Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio'.
Here is the launch.json
which works for me now:
{
// 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
"version": "0.2.0",
"configurations": [
{
"name": "lesson6",
"type": "lua-local",
"request": "launch",
"stopOnEntry": true,
"cwd": "${workspaceFolder}",
"program": {
"lua": "lua",
"file": "${workspaceFolder}/lesson6.lua"
},
"env": {
"LUA_PATH": "./?.lua"
},
}
]
}
Thanks for your support. I am just getting started with Lua for an embedded Lua project and appreciate being able to debug scripts. So far this debug plugin has worked excellently.
Thank you, Michael Uman
Oops! Sorry I about the wrong name - glad you were able to figure it out.
Here is a script I am trying to debug and I encounter an error when stepping over the
require
line:If I execute this code in VSCode local-lua plugin I get the following message when stepping over the
require "car"
line:This code executes fine in my WSL environment with the following output:
My
launch.json
script is reproduced below:I have tried setting the environment LUA_PATH but can't seem to get it to work.
Is there a solution to this issue?
Thank you, Michael Uman Sr. Software Engineer Wunder-Bar Inc.