Comments (6)
In case it's helpful, my tsconfig.json is as follows:
{
"compilerOptions": {
"rootDir": "src",
"outDir": "game",
"lib": ["esnext"],
"sourceMap": true,
"types": [
"love-typescript-definitions",
"lua-types/jit"
],
"downlevelIteration" : true
},
"tstl": {
"noImplicitSelf": true,
"luaTarget": "JIT",
"luaLibImport": "require",
"sourceMapTraceback": true
},
"exclude": [
"resources",
"game"
],
"include": [ "src" ]
}
from local-lua-debugger-vscode.
I duplicated your setup and found an issue where source map paths weren't correctly handled due to a slight difference in how love passes them to the debugger. I've published a new version with a fix for that issue.
But, you're going to run into the same problem if you store your lua files in subfolders of game
, due to a bug in how TypescriptToLua generates source maps: TypeScriptToLua/TypeScriptToLua#855
from local-lua-debugger-vscode.
Thanks @tomblind ! I have confirmed that your fix works for all files located at the source root. And, as you've guessed I have subfolders and for files in those, breakpoints do not trigger.
As a workaround until TypeScriptToLua fixes source map sourceRoots, if I understand your diagnosis correctly, if I opt to transpile in place, at least for debugging, since the lua and ts paths would be the same, breakpoints would work? (I.e. i ditch game/
and generate lua files in place within src/
.) Or, do you have any other suggestions for changing config to get things working? I think having a debugger would be a tremendous boon, so happy to change configuration in anyway that enables that!
from local-lua-debugger-vscode.
Yes, I think generating the lua in place with the ts files should work. Although I believe you need to have them all in game
for love to find them, right?
I can't think of another way to structure things right now, since the source maps basically lose any sub-path information.
from local-lua-debugger-vscode.
Although I believe you need to have them all in
game
for love to find them, right?
Löve can take any folder at start up (including ./) so changing it to /src for debug should be fine.
I’ll give it a go. Thanks again!
from local-lua-debugger-vscode.
The subfolders issue has been fixed in TSTL (TypeScriptToLua/TypeScriptToLua#859) and was included in the most recent relase (0.33.0) so I'll go ahead and close this issue. Please open new issues if more problems with source maps arrise.
from local-lua-debugger-vscode.
Related Issues (20)
- Global variables do not seem to carry over to loaded modules HOT 2
- Extreme slowdown withing Love2d / breakpoints ignored HOT 9
- Configuration Question, trying to debug lua in DCS HOT 2
- Support for multiple threads? HOT 2
- Breakpoints don't work when program.file is set to relative parent path HOT 4
- rawlen usage makes extension incompatible with LuaJIT-based implementations
- strict mode incompatibility
- Question: is there a way to set environment variables within debugger settings? HOT 2
- love2d cant step in with debugger to love2d lua libary HOT 1
- lldebugger changes the slash in file paths in debug.traceback() when active
- Allow inspecting upvalues of a closure
- Add `console` for Integrated Terminal option to launch configuration HOT 1
- Wrong assert stack level
- Request: Example usage of customPropertyGetterForUserData
- lua5.4 supported? HOT 1
- Is this extension still developed? HOT 14
- Request to Add "console": "integratedTerminal" Functionality HOT 4
- Breakpoints not working on custom engine using physfs HOT 1
- Can't debug with Sapiens HOT 1
- Source mapping doesn't work with multiple sources in one map HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from local-lua-debugger-vscode.