microsoft / vscode-chrome-debug-core

A library for implementing VS Code debug adapters for targets that implement the Chrome Debugging Protocol.
Other
157 stars 119 forks source link

Pending breakpoints aren't resolved at startup unless their scripts have sourcemaps #121

Closed roblourens closed 8 years ago

roblourens commented 8 years ago

In a webserver or webpack/meteor-type scenario, when we can't anticipate the scripts path in the runtime, needed to make breakpoints bind at startup. Workaround - set the breakpoints after the script is loaded instead of before.

roblourens commented 8 years ago
const sourceMapsP = this._sourceMapTransformer.scriptParsed(mappedUrl, script.sourceMapURL).then(sources => {
            if (sources) {
                sources.forEach(source => {
                    if (this._pendingBreakpointsByUrl.has(source)) {
                        this.resolvePendingBreakpoint(this._pendingBreakpointsByUrl.get(source))
                            .then(() => this._pendingBreakpointsByUrl.delete(source));
                    }
                });
            }
        });