Code Monkey home page Code Monkey logo

Comments (6)

dainkaplan avatar dainkaplan commented on August 15, 2024 1

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.

tomblind avatar tomblind commented on August 15, 2024

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.

dainkaplan avatar dainkaplan commented on August 15, 2024

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.

tomblind avatar tomblind commented on August 15, 2024

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.

dainkaplan avatar dainkaplan commented on August 15, 2024

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.

tomblind avatar tomblind commented on August 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.