-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source-map support #19
Comments
im currently working on extracting all parsing and UI into separate package so i can use same code also for other test frameworks (specially jest). There i replaced typescript with babylon as source parser (typescript used here only because i didnt know better) and sourcemaps (almost always) works ... (except when vscode tries to load sourcemaps from src dir and not from out dir - wut?) BTW: |
But if the tests are run on a JS file that has source maps inside/beside it, then Basically I want to be able to build a JS file however I want and run tests on it, then have the code lenses automatically follow source maps from that JS file back to whatever they were built from. So I might have 5 Typescript files and some build system producing 1 JS file with a source map. No other files. I don't want this extension to run on my Typescript files, I just want it to run on the JS file whenever that gets changed, but I want to see the codelenses in my Typescript files (or indeed, whatever strange language the source maps might point back to). |
Lenses are shown only in file, that is currently active. If u wanna run test on js when changes why not use plain old mocha cli in watch mode? |
Ahhh, I see what you're saying. Running mocha in CLI watch mode is what I'm currently doing, I'd just love it if I had an extension that would mark up the file I'm currently viewing with the results as lenses. Maybe I should think about writing a different extension, since it seems a little different from what you're aiming for. |
I could add ability to load test states from JSON file and watch that file for changes. (that would require some wrapper around mocha/Jest/whatever, that will save test results in 'my' json format - probably another set of packages and also some code that will update JSON when tests are executed from editor) |
Hmmm. Seems like a lot of work, considering you're going through a rewrite at the moment. |
it was suprisingly simple to add json file for storing state and watch for changes ... in refactored code :/ |
Hi! How it is going? I've tried TypeScript example and looks like it is still not working |
Hey, I'd kill for source map support in this as we use Webpack to build a single output file. I don't think there's any way I can get this working as is.
Would you accept a PR for this? I don't think it'd be too hard from a cursory glance. Just replacing the 2 calls to
sourceFile.getLineAndCharacterOfPosition(pos).line
with something that goes further and pulls the source maps in. Does that sound right? The code I've seen using the source-map module seems fairly straightforward, and there's plenty of examples of it in the wild.The text was updated successfully, but these errors were encountered: