Skip to content

Commit

Permalink
Merge branch 'fix/bp-in-external'
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Jan 31, 2020
2 parents 782464c + 2641d81 commit 87fefe8
Show file tree
Hide file tree
Showing 13 changed files with 282 additions and 104 deletions.
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--enable-proposed-api=ms-vscode.js-debug",
"--extensionDevelopmentPath=${workspaceFolder}/out"
],
Expand Down
3 changes: 1 addition & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const sourcemaps = require('gulp-sourcemaps');
const ts = require('gulp-typescript');
const rename = require('gulp-rename');
const merge = require('merge2');
const prettier = require('gulp-prettier');
const typescript = require('typescript');
const vsce = require('vsce');
const webpack = require('webpack');
Expand Down Expand Up @@ -45,7 +44,7 @@ const namespace = process.argv.includes('--drop-in') ? '' : 'pwa-';
/**
* Whether we're running a nightly build.
*/
const isNightly = process.argv.includes('--nightly');
const isNightly = process.argv.includes('--nightly') || process.argv.includes('watch');

/**
* Extension ID to build. Appended with '-nightly' as necessary.
Expand Down
23 changes: 0 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-filter": "^6.0.0",
"gulp-prettier": "^2.3.0",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-sourcemaps": "^2.6.5",
Expand All @@ -128,6 +127,7 @@
"mocha-multi-reporters": "^1.1.7",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"prettier": "^1.19.1",
"puppeteer": "^1.20.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
Expand Down
12 changes: 12 additions & 0 deletions src/adapter/breakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,18 @@ export class BreakpointManager {
): Promise<Dap.SetBreakpointsResult> {
params.source.path = urlUtils.platformPathToPreferredCase(params.source.path);

// If we see we want to set breakpoints in file by source reference ID but
// it doesn't exist, they were probably from a previous section. The
// references for scripts just auto-increment per session and are entirely
// ephemeral. Remove the reference so that we fall back to a path if possible.
if (
params.source.sourceReference /* not (undefined or 0=on disk) */ &&
params.source.path &&
!this._sourceContainer.source(params.source)
) {
params.source.sourceReference = undefined;
}

// Wait until the breakpoint predictor finishes to be sure that we
// can place correctly in breakpoint.set().
if (!this._predictorDisabledForTest && this._breakpointsPredictor) {
Expand Down
6 changes: 3 additions & 3 deletions src/adapter/breakpoints/breakpointBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ export abstract class Breakpoint {
// remove any URL-set breakpoints because they are probably not correct.
// This oft happens with Node.js loaders which rewrite sources on the fly.
for (const bp of this.cdpBreakpoints) {
if (isSetByUrl(bp.args) && breakpointIsForUrl(bp.args, source.url())) {
if (isSetByUrl(bp.args) && breakpointIsForUrl(bp.args, source.url)) {
logger.verbose(LogTag.RuntimeSourceMap, 'Adjusted breakpoint due to overlaid sourcemap', {
url: source.url(),
url: source.url,
});
promises.push(this.removeCdpBreakpoint(bp));
}
Expand Down Expand Up @@ -306,7 +306,7 @@ export abstract class Breakpoint {
const source = this._manager._sourceContainer.source(this._source);

const url = source
? source.url()
? source.url
: this._source.path
? this._manager._sourceContainer.sourcePathResolver.absolutePathToUrl(this._source.path)
: undefined;
Expand Down
18 changes: 9 additions & 9 deletions src/adapter/scriptSkipper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ export class ScriptSkipper {
...scriptIds: Cdp.Runtime.ScriptId[]
): Promise<void> {
// Order "should" be correct
const parentIsSkipped = this.isScriptSkipped(source.url());
const parentIsSkipped = this.isScriptSkipped(source.url);
const skipRanges: Cdp.Debugger.ScriptPosition[] = [];
let inSkipRange = parentIsSkipped;
Array.from(source._sourceMapSourceByUrl!.values()).forEach(authoredSource => {
let isSkippedSource = this.isScriptSkipped(authoredSource.url());
let isSkippedSource = this.isScriptSkipped(authoredSource.url);
if (typeof isSkippedSource === 'undefined') {
// If not toggled or specified in launch config, inherit the parent's status
isSkippedSource = parentIsSkipped;
Expand Down Expand Up @@ -221,7 +221,7 @@ export class ScriptSkipper {
): Promise<boolean> {
const map = isAuthored(source) ? this._isAuthoredUrlSkipped : this._isUrlSkipped;

const url = source.url();
const url = source.url;
if (!map.has(this._normalizeUrl(url))) {
const pathOnDisk = await source.existingAbsolutePath();
if (pathOnDisk) {
Expand All @@ -235,12 +235,12 @@ export class ScriptSkipper {
}
}

if (this.isScriptSkipped(source._url)) {
if (this.isScriptSkipped(source.url)) {
if (source._sourceMapSourceByUrl) {
// if compiled and skipped, also skip authored sources
const authoredSources = Array.from(source._sourceMapSourceByUrl.values());
authoredSources.forEach(authoredSource => {
this._isAuthoredUrlSkipped.set(authoredSource._url, true);
this._isAuthoredUrlSkipped.set(authoredSource.url, true);
});
}
}
Expand Down Expand Up @@ -285,9 +285,9 @@ export class ScriptSkipper {

const source = this._sourceContainer!.source(sourceParams);
if (source) {
const newSkipValue = !this.isScriptSkipped(source.url());
const newSkipValue = !this.isScriptSkipped(source.url);
if (isAuthored(source)) {
this._isAuthoredUrlSkipped.set(source.url(), newSkipValue);
this._isAuthoredUrlSkipped.set(source.url, newSkipValue);

// Changed the skip value for an authored source, update it for all its compiled sources
const compiledSources = Array.from(source._compiledToSourceUrl!.keys());
Expand All @@ -300,11 +300,11 @@ export class ScriptSkipper {
),
);
} else {
this._isUrlSkipped.set(source.url(), newSkipValue);
this._isUrlSkipped.set(source.url, newSkipValue);
if (source._sourceMapSourceByUrl) {
// if compiled, get authored sources
for (const authoredSource of source._sourceMapSourceByUrl.values()) {
this._isAuthoredUrlSkipped.set(authoredSource.url(), newSkipValue);
this._isAuthoredUrlSkipped.set(authoredSource.url, newSkipValue);
}
}
}
Expand Down
Loading

0 comments on commit 87fefe8

Please sign in to comment.