Closed
Description
We'd like VS Code and the Node Debugger to support Live Reloading Scenarios. The current behavior is preventing React-Native users from having a good experience: microsoft/vscode-react-native#74
Currently it's not supported so modifying breakpoints while the program is running can have weird results (Breakpoints set in one line, appear in another line, or get deleted completely).
Things that we'd like to be supported are:
- Be able to edit a file in memory, and set a brekpoint before saving the file, so if there is any source map associated at all with this file at all, it'll map to the wrong thing, so VS Code would need to Remember the line where the breakpoint was set, and wait until the proper source map was loaded before actually setting the breakpoint.
- Be able to edit a file, save it, and set breakpoints before the recompilation process is finished, so initially it'll be associated with the wrong source map.
- The red and greyed out stop signs for the breakpoints should correctly indicate if the breakpoints were successfully installed.
- Editing a source file with breakpoints should result in intuitive results when adding lines before, or after the breakpoints, or even on the same line.
Activity
weinand commentedon Jun 3, 2016
related issues:
sivaraman-gmail-com commentedon Nov 23, 2016
Will implementation of this also allow for live javascript editing when debugging a web app via the Chrome debugger extension? This is a key feature missing compared to IDEs such as WebStorm and debugging from within Chrome itself.
auchenberg commentedon Nov 24, 2016
@weinand @roblourens We seem to have closed the blocking issues for this scenario, which means we should be good to have debuggers implementing file-watching-like functionality.
We should start by prototyping this in the Chrome family debuggers, which would light up this for Node, Chrome, Edge and others. See https://github.com/Microsoft/vscode-chrome-debug/issues/216
nojvek commentedon Feb 6, 2017
Will there be any config to place in a hook call? E.g after live edit is called, a command defined in debugger target config is automatically executed.
This opens up great possibilities for hot reloading and test driven development.
Since this will work with async sourcemaps and file watchers I think it will be a lot more powerful than the live edit scenario chrome gives out of the box.
weinand commentedon Feb 20, 2017
A typical live edit scenario.
Preparation:
Scenario "edit TypeScript source while being stopped on a breakpoint":
Behind the scenes:
Misc:
Conclusion:
Next Steps:
changeLiveRequest_
andrestartFrameRequest_
.auchenberg commentedon Feb 21, 2017
@weinand For the
the DA replaces the loaded script with the new contents
step you have outlined. Are you referring to having the DA using API's such as Node/Chromes debugger.setScriptSource?The file-watcher in VS/DA should be togglable, as many developers for front-end scenarios already relies on WebPack HMR or similar, which enables https://medium.com/@auchenberg/live-edit-and-debug-your-react-apps-directly-from-vs-code-without-leaving-the-editor-3da489ed905f today.
weinand commentedon Feb 21, 2017
@auchenberg yes, the 'node2' DA would use Node/Chrome's debugger.setScriptSource and node would use
changeLiveRequest
.The goal of this analysis was to figure out the likely interaction between VS Code editor/debugger and the DA. How the DA implements Live Edit is an implementation detail of the DA.
The file-watcher in a DA is an implementation detail of the DA and as such is not covered by the DAP. So every DA that uses a file-watcher can provide a flag in its launch config to control it.
13 remaining items