Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into customDescriptionGe…
Browse files Browse the repository at this point in the history
…nerator
  • Loading branch information
D committed Aug 25, 2020
2 parents 46320b2 + 2eadab0 commit 2db560e
Show file tree
Hide file tree
Showing 109 changed files with 3,618 additions and 1,340 deletions.
5 changes: 5 additions & 0 deletions .mocharc.unit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
require: ['source-map-support/register', './out/src/test/testHooks'],
spec: 'out/src/**/*.test.js',
ignore: ['out/src/test/**/*.js'],
};
26 changes: 20 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"type": "extensionHost",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${execPath}",
"args": [
"--enable-proposed-api=ms-vscode.js-debug",
"--extensionDevelopmentPath=${workspaceFolder}/out",
Expand All @@ -52,7 +51,6 @@
"type": "extensionHost",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${execPath}",
"args": [
"--enable-proposed-api=ms-vscode.js-debug",
"--extensionDevelopmentPath=${workspaceFolder}/dist"
Expand All @@ -67,7 +65,6 @@
"type": "pwa-extensionHost",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${execPath}",
"args": [
"--enable-proposed-api=ms-vscode.js-debug",
"--extensionDevelopmentPath=${workspaceFolder}/out"
Expand All @@ -76,12 +73,31 @@
"${workspaceFolder}/out/**/*.js"
],
},
{
"name": "Extension and Auto Launch",
"type": "pwa-extensionHost",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"args": [
"--enable-proposed-api=ms-vscode.js-debug",
"--extensionDevelopmentPath=${workspaceFolder}/../vscode/extensions/debug-auto-launch",
"--extensionDevelopmentPath=${workspaceFolder}/out"
],
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"${workspaceFolder}/../vscode/extensions/debug-auto-launch/out/**",
"!**/node_modules/**"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/../vscode-js-debug-companion/out/**/*.js",
],
},
{
"name": "Extension and Companion",
"type": "pwa-extensionHost",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${execPath}",
"args": [
"--enable-proposed-api=ms-vscode.js-debug",
"--extensionDevelopmentPath=${workspaceFolder}/../vscode-js-debug-companion",
Expand All @@ -105,7 +121,6 @@
"name": "Run Tests",
"type": "pwa-extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"skipFiles": ["<node_internals>/**"],
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/out",
Expand All @@ -118,7 +133,6 @@
"name": "Reset Results",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/src/test/testRunner"
Expand Down
44 changes: 18 additions & 26 deletions OPTIONS.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions demos/babel/package-lock.json

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

6 changes: 3 additions & 3 deletions demos/webpack/package-lock.json

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

27 changes: 27 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,17 @@ gulp.task('flatSessionBundle:webpack-bundle', async () => {
return runWebpack({ packages, devtool: 'nosources-source-map' });
});

gulp.task('package:bootloader-as-cdp', done => {
const bootloaderFilePath = path.resolve(distSrcDir, 'bootloader.bundle.js');
fs.appendFile(bootloaderFilePath, '\n//# sourceURL=bootloader.bundle.cdp', done);
});

/** Run webpack to bundle into the VS debug server */
gulp.task('vsDebugServerBundle:webpack-bundle', async () => {
const packages = [{ entry: `${buildSrcDir}/vsDebugServer.js`, library: true }];
return runWebpack({ packages, devtool: 'nosources-source-map' });
});

/** Copy the extension static files */
gulp.task('package:copy-extension-files', () =>
merge(
Expand Down Expand Up @@ -367,6 +378,7 @@ gulp.task(
'compile:static',
'compile:dynamic',
'package:webpack-bundle',
'package:bootloader-as-cdp',
'package:copy-extension-files',
'nls:bundle-create',
'package:createVSIX',
Expand All @@ -379,6 +391,21 @@ gulp.task(
'clean',
'compile',
'flatSessionBundle:webpack-bundle',
'package:bootloader-as-cdp',
'package:copy-extension-files',
gulp.parallel('nls:bundle-download', 'nls:bundle-create'),
),
);

// for now, this task will build both flat session and debug server until we no longer need flat session
gulp.task(
'vsDebugServerBundle',
gulp.series(
'clean',
'compile',
'vsDebugServerBundle:webpack-bundle',
'flatSessionBundle:webpack-bundle',
'package:bootloader-as-cdp',
'package:copy-extension-files',
gulp.parallel('nls:bundle-download', 'nls:bundle-create'),
),
Expand Down
19 changes: 9 additions & 10 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "js-debug",
"displayName": "JavaScript Debugger",
"version": "1.48.1",
"version": "1.49.2",
"publisher": "ms-vscode",
"author": {
"name": "Microsoft Corporation"
Expand All @@ -17,7 +17,7 @@
"description": "An extension for debugging Node.js programs and Chrome.",
"license": "MIT",
"engines": {
"vscode": "^1.47.0-insider",
"vscode": "^1.49.0-insider",
"node": ">=10"
},
"icon": "resources/logo.png",
Expand Down Expand Up @@ -45,14 +45,16 @@
"publish": "gulp publish",
"updatetypes": "cd src/typings && vscode-dts dev && vscode-dts master",
"generateapis": "node out/src/build/generateDap.js && node out/src/build/generateCdp.js",
"test": "gulp && npm-run-all --parallel test:types test:golden test:lint",
"test": "gulp && npm-run-all --parallel test:unit test:types test:golden test:lint",
"test:types": "tsc --noEmit",
"test:unit": "mocha --config .mocharc.unit.js",
"test:golden": "node ./out/src/test/runTest.js",
"test:lint": "gulp lint"
},
"dependencies": {
"@c4312/chromehash": "^0.2.0",
"color": "^3.1.2",
"data-uri-to-buffer": "^3.0.1",
"default-browser": "^2.0.1",
"execa": "^4.0.0",
"glob-stream": "^6.1.0",
Expand Down Expand Up @@ -97,7 +99,6 @@
"@types/gulp": "^4.0.6",
"@types/js-beautify": "^1.8.2",
"@types/json-schema": "^7.0.4",
"@types/lodash": "^4.14.149",
"@types/long": "^4.0.1",
"@types/marked": "^0.7.4",
"@types/micromatch": "^4.0.1",
Expand Down Expand Up @@ -134,7 +135,6 @@
"gulp-tsb": "^4.0.5",
"gulp-util": "^3.0.8",
"husky": "^4.2.3",
"lodash": "^4.17.15",
"marked": "^1.1.0",
"merge2": "^1.3.0",
"minimist": "^1.2.5",
Expand Down
18 changes: 7 additions & 11 deletions src/adapter/breakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ export class BreakpointManager {
this._sourceContainer = sourceContainer;
this.pauseForSourceMaps = launchConfig.pauseForSourceMap;

_breakpointsPredictor?.onLongParse(() => dap.longPrediction({}));

this._scriptSourceMapHandler = async (script, sources) => {
if (
!logger.assert(
Expand Down Expand Up @@ -451,20 +453,14 @@ export class BreakpointManager {
this._predictorDisabledForTest = disabled;
}

async _updateSourceMapHandler(thread: Thread) {
private _updateSourceMapHandler(thread: Thread) {
this._sourceMapHandlerWasUpdated = true;

await thread.setScriptSourceMapHandler(true, this._scriptSourceMapHandler);

if (!this._breakpointsPredictor || this.pauseForSourceMaps) {
return;
if (this._breakpointsPredictor && !this.pauseForSourceMaps) {
return thread.setScriptSourceMapHandler(false, this._scriptSourceMapHandler);
} else {
return thread.setScriptSourceMapHandler(true, this._scriptSourceMapHandler);
}

// If we set a predictor and don't want to pause, we still wait to wait
// for the predictor to finish running. Uninstall the sourcemap handler
// once we see the predictor is ready to roll.
await this._breakpointsPredictor.prepareToPredict();
thread.setScriptSourceMapHandler(false, this._scriptSourceMapHandler);
}

private _setBreakpoint(b: Breakpoint, thread: Thread): void {
Expand Down
7 changes: 0 additions & 7 deletions src/adapter/breakpoints/conditions/logPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ import { returnErrorsFromStatements } from '../../../common/sourceCodeManipulati
*/
@injectable()
export class LogPointCompiler {
/**
* Gets whether the url looks like a log point source.
*/
public static isLogPointUrl(url: string) {
return /logpoint-[a-f0-9]+.vs$/.test(url);
}

constructor(
@inject(ILogger) private readonly logger: ILogger,
@inject(IEvaluator) private readonly evaluator: IEvaluator,
Expand Down
10 changes: 5 additions & 5 deletions src/adapter/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/

import { inject, injectable } from 'inversify';
import * as ts from 'typescript';
import Dap from '../dap/api';
import Cdp from '../cdp/api';
import { StackFrame } from './stackTrace';
import { ICdpApi } from '../cdp/connection';
import { positionToOffset } from '../common/sourceUtils';
import { enumerateProperties, enumeratePropertiesTemplate } from './templates/enumerateProperties';
import { injectable, inject } from 'inversify';
import Dap from '../dap/api';
import { IEvaluator, returnValueStr } from './evaluator';
import { ICdpApi } from '../cdp/connection';
import { StackFrame } from './stackTrace';
import { enumerateProperties, enumeratePropertiesTemplate } from './templates/enumerateProperties';

/**
* Context in which a completion is being evaluated.
Expand Down
Loading

0 comments on commit 2db560e

Please sign in to comment.