(
8 | options: T[],
9 | ): FunctionComponent<{
10 | value: T | undefined;
11 | onChange(option: T): void;
12 | }> =>
13 | function DecisionButtons({ value, onChange }) {
14 | return (
15 |
16 | {options.map(b => (
17 |
24 | ))}
25 |
26 | );
27 | };
28 |
--------------------------------------------------------------------------------
/src/diagnosticTool/index.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { join } from 'path';
6 |
7 | export const toolPath = join(__dirname, 'diagnosticTool.js');
8 | export const toolStylePath = join(__dirname, 'diagnosticTool.css');
9 |
--------------------------------------------------------------------------------
/src/diagnosticTool/useDump.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { Context, createContext } from 'preact';
6 | import { useContext } from 'preact/hooks';
7 | import { IDiagnosticDump } from '../adapter/diagnosics';
8 |
9 | export const DumpContext: Context = createContext<
10 | IDiagnosticDump | undefined
11 | >(undefined);
12 |
13 | export const useDump = () => useContext(DumpContext) as IDiagnosticDump;
14 |
--------------------------------------------------------------------------------
/src/targets/browser/unelevatedChome.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 | import { CancellationToken } from 'vscode';
5 | import { timeoutPromise } from '../../common/cancellation';
6 | import Dap from '../../dap/api';
7 |
8 | export async function launchUnelevatedChrome(
9 | dap: Dap.Api,
10 | chromePath: string,
11 | chromeArgs: string[],
12 | cancellationToken: CancellationToken,
13 | ): Promise {
14 | const response = dap.launchUnelevatedRequest({
15 | process: chromePath,
16 | args: chromeArgs,
17 | });
18 |
19 | await timeoutPromise(response, cancellationToken, 'Could not launch browser unelevated');
20 | }
21 |
--------------------------------------------------------------------------------
/src/targets/node/bootloader/logger.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | /* eslint-disable @typescript-eslint/no-unused-vars */
6 |
7 | export const bootloaderLogger = {
8 | enabled: false,
9 | info: (...args: unknown[]) => {
10 | if (bootloaderLogger.enabled) {
11 | console.log(...args);
12 | }
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/src/targets/node/bundlePaths.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { join } from 'path';
6 |
7 | export const watchdogPath = join(__dirname, 'watchdog.js');
8 | export const bootloaderDefaultPath = join(__dirname, 'bootloader.js');
9 |
--------------------------------------------------------------------------------
/src/targets/node/createTargetId.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { randomBytes } from 'crypto';
6 |
7 | export const createTargetId = () => randomBytes(12).toString('hex');
8 |
--------------------------------------------------------------------------------
/src/targets/node/extensionHostExtras.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { getSourceSuffix } from '../../adapter/templates';
6 |
7 | /**
8 | * Expression to be evaluated to set that the debugger is successfully attached
9 | * and ready for extensions to start being debugged.
10 | *
11 | * See microsoft/vscode#106698.
12 | */
13 | export const signalReadyExpr = () => `globalThis.__jsDebugIsReady = true; ` + getSourceSuffix();
14 |
--------------------------------------------------------------------------------
/src/targets/node/findOpenPort.ps1:
--------------------------------------------------------------------------------
1 | Get-NetTCPConnection | where Localport -eq 5000 | select Localport, OwningProcess
2 |
--------------------------------------------------------------------------------
/src/targets/node/terminateProcess.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ROOT_PID=$1
4 | SIGNAL=$2
5 |
6 | terminateTree() {
7 | for cpid in $(pgrep -P $1); do
8 | terminateTree $cpid
9 | done
10 | kill -$SIGNAL $1 > /dev/null 2>&1
11 | }
12 |
13 | terminateTree $ROOT_PID
14 |
--------------------------------------------------------------------------------
/src/targets/targetOrigin.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | export const ITargetOrigin = Symbol('ITargetOrigin');
6 |
7 | /**
8 | * The target origin is the debug session ID (a GUID/UUID) in DAP which is
9 | * a parent to this session.
10 | */
11 | export interface ITargetOrigin {
12 | readonly id: string;
13 | }
14 |
15 | /**
16 | * Immutable implementation of ITargetOrigin.
17 | */
18 | export class TargetOrigin implements ITargetOrigin {
19 | constructor(public readonly id: string) {}
20 | }
21 |
22 | /**
23 | * A mutable version of ITargetOrigin. Used in the {@link DelegateLauncher}.
24 | */
25 | export class MutableTargetOrigin implements ITargetOrigin {
26 | constructor(public id: string) {}
27 | }
28 |
--------------------------------------------------------------------------------
/src/telemetry/experimentationService.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | export interface IExperiments {
6 | /**
7 | * Breakpoint helper prompt
8 | */
9 | diagnosticPrompt: boolean;
10 | }
11 |
12 | export interface IExperimentationService {
13 | /**
14 | * Gets the treatment for the experiment.
15 | * @param name Name of the experiment
16 | * @param defaultValue Default to return if the call fails ot no
17 | * experimentation service is available.
18 | */
19 | getTreatment(
20 | name: K,
21 | defaultValue: IExperiments[K],
22 | ): Promise;
23 | }
24 |
25 | export const IExperimentationService = Symbol('IExperimentationService');
26 |
--------------------------------------------------------------------------------
/src/telemetry/nullExperimentationService.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { injectable } from 'inversify';
6 | import { IExperimentationService, IExperiments } from './experimentationService';
7 |
8 | @injectable()
9 | export class NullExperimentationService implements IExperimentationService {
10 | /**
11 | * @inheritdoc
12 | */
13 | getTreatment(
14 | _name: K,
15 | defaultValue: IExperiments[K],
16 | ): Promise {
17 | return Promise.resolve(defaultValue);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/telemetry/performance.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { ILogger, LogTag } from '../common/logging';
6 |
7 | /**
8 | * Measures and logs the performance of decorated functions.
9 | */
10 | export const logPerf = async (
11 | logger: ILogger,
12 | name: string,
13 | fn: () => T | Promise,
14 | metadata: object = {},
15 | ): Promise => {
16 | const start = Date.now();
17 | try {
18 | return await fn();
19 | } finally {
20 | logger.verbose(LogTag.PerfFunction, '', {
21 | method: name,
22 | duration: Date.now() - start,
23 | ...metadata,
24 | });
25 | }
26 | };
27 |
--------------------------------------------------------------------------------
/src/test/benchmark/formatMessage.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { IBenchmarkApi } from '@c4312/matcha';
6 | import { formatMessage } from '../../adapter/messageFormat';
7 | import { messageFormatters } from '../../adapter/objectPreview';
8 |
9 | export default function(api: IBenchmarkApi) {
10 | api.bench('simple', () => {
11 | formatMessage(
12 | '',
13 | [{ type: 'number', value: 1234, description: '1234', subtype: undefined }],
14 | messageFormatters,
15 | );
16 | });
17 | }
18 |
--------------------------------------------------------------------------------
/src/test/benchmark/index.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------
2 | * Copyright (C) Microsoft Corporation. All rights reserved.
3 | *--------------------------------------------------------*/
4 |
5 | import { benchmark, grepMiddleware, PrettyReporter } from '@c4312/matcha';
6 | import { readdirSync } from 'fs';
7 | import 'reflect-metadata';
8 |
9 | benchmark({
10 | reporter: new PrettyReporter(process.stdout),
11 | middleware: process.argv[2] ? [grepMiddleware(process.argv[2])] : undefined,
12 | prepare(api) {
13 | for (
14 | const file of readdirSync(__dirname).filter(f => f.endsWith('.js') && f !== 'index.js')
15 | ) {
16 | api.suite(file, () => require(`./${file}`).default(api));
17 | }
18 | },
19 | })
20 | .then(() => process.exit(0))
21 | .catch(err => {
22 | console.error(err);
23 | process.exit(1);
24 | });
25 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-break-on-load-in-js-file-without-sourcemap.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/script.js:9:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-breakpoint-placement-end-function-stmt-babel.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | foo @ ${workspaceFolder}/sourceMapLocations/test.ts:6:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-breakpoint-placement-end-function-stmt-tsc.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | global.foo @ ${workspaceFolder}/sourceMapLocations/test.ts:6:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-breakpoint-placement-first-function-stmt-babel.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | foo @ ${workspaceFolder}/sourceMapLocations/test.ts:4:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-breakpoint-placement-first-function-stmt-tsc.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | global.foo @ ${workspaceFolder}/sourceMapLocations/test.ts:4:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-can-step-in-when-first-line-of-code-is-function.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${fixturesDir}/test.js:5:1
8 | {
9 | allThreadsStopped : false
10 | description : Paused
11 | reason : step
12 | threadId :
13 | }
14 | global.double @ ${fixturesDir}/test.js:2:3
15 | @ ${fixturesDir}/test.js:5:1
16 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-condition-basic.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/condition.js:2:3
8 | result: 2
9 | {
10 | allThreadsStopped : false
11 | description : Paused on debugger statement
12 | reason : pause
13 | threadId :
14 | }
15 | @ ${workspaceFolder}/web/condition.js:5:1
16 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-condition-ignores-bp-with-invalid-condition.txt:
--------------------------------------------------------------------------------
1 | {
2 | category : stderr
3 | output : Syntax error setting breakpoint with condition ")(}{][.&" on line 2: Unexpected token ')'
4 | }
5 | {
6 | allThreadsStopped : false
7 | description : Paused on debugger statement
8 | reason : pause
9 | threadId :
10 | }
11 | @ ${workspaceFolder}/web/condition.js:5:1
12 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-condition-ignores-error-by-default.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/condition.js:5:1
8 | {
9 | category : stderr
10 | column : 64
11 | line : 1
12 | output : Breakpoint condition error: oh no
13 | source : {
14 | name : /VM
15 | path : /VM
16 | sourceReference :
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-condition-invalid.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/condition.js:5:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-condition-pauses-on-error.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/condition.js:2:3
8 | stderr> Breakpoint condition error: oh no
9 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-configure-inline.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/inlinescript.html:3:5
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-configure-predictor-warns-on-inaccessible-directory-vscode100018.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/simpleNode/index.js:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-configure-query-params.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/script.js:9:1
8 | {
9 | allThreadsStopped : false
10 | description : Paused on debugger statement
11 | reason : pause
12 | threadId :
13 | }
14 | @ ${workspaceFolder}/web/script.js:10:1
15 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-configure-remove.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | Window.foo @ ${workspaceFolder}/web/script.js:2:3
8 | @ ${workspaceFolder}/web/script.js:9:1
9 | {
10 | allThreadsStopped : false
11 | description : Paused on debugger statement
12 | reason : pause
13 | threadId :
14 | }
15 | @ ${workspaceFolder}/web/script.js:10:1
16 | {
17 | allThreadsStopped : false
18 | description : Paused on debugger statement
19 | reason : pause
20 | threadId :
21 | }
22 | @ localhost꞉8001/test.js:2:1
23 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-configure-script.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/script.js:9:1
8 | {
9 | allThreadsStopped : false
10 | description : Paused on debugger statement
11 | reason : pause
12 | threadId :
13 | }
14 | @ ${workspaceFolder}/web/script.js:10:1
15 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-configure-source-map-thats-path-mapped.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | Window.foo @ ${workspaceFolder}/web/tmp/app.ts:2:3
8 | @ ${workspaceFolder}/web/tmp/app.ts:5:1
9 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-custom-inner-html.txt:
--------------------------------------------------------------------------------
1 | Not pausing on innerHTML
2 | Evaluating#1: document.querySelector('div').innerHTML = 'foo';
3 | Pausing on innerHTML
4 | Evaluating#2: document.querySelector('div').innerHTML = 'bar';
5 | {
6 | allThreadsStopped : false
7 | description : Set innerHTML
8 | reason : function breakpoint
9 | text : Paused on instrumentation breakpoint "Set innerHTML"
10 | threadId :
11 | }
12 | {
13 | allThreadsContinued : false
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-disables-entrypoint-breakpoint-when-in-file-vscode230201.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused
4 | reason : step
5 | threadId :
6 | }
7 | @ ${fixturesDir}/test.js:5:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-does-not-interrupt-stepin-with-instrumentation-breakpoint-1665.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1: test()
2 | {
3 | allThreadsStopped : false
4 | description : Paused on debugger statement
5 | reason : pause
6 | threadId :
7 | }
8 | Window.test @ /VM:4:13
9 | @ eval1.js:1:1
10 | {
11 | allThreadsStopped : false
12 | description : Paused
13 | reason : step
14 | threadId :
15 | }
16 | Window.test @ /VM:5:13
17 | @ eval1.js:1:1
18 | {
19 | allThreadsStopped : false
20 | description : Paused
21 | reason : step
22 | threadId :
23 | }
24 | @ foo.js:2:15
25 | Window.test @ /VM:5:15
26 | @ eval1.js:1:1
27 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-does-not-interrupt-stepover-with-instrumentation-breakpoint-1556.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1: test()
2 | {
3 | allThreadsStopped : false
4 | description : Paused on debugger statement
5 | reason : pause
6 | threadId :
7 | }
8 | Window.test @ /VM:4:13
9 | @ eval1.js:1:1
10 | {
11 | allThreadsStopped : false
12 | description : Paused
13 | reason : step
14 | threadId :
15 | }
16 | Window.test @ /VM:5:13
17 | @ eval1.js:1:1
18 | {
19 | allThreadsStopped : false
20 | description : Paused
21 | reason : step
22 | threadId :
23 | }
24 | Window.test @ /VM:13:13
25 | @ eval1.js:1:1
26 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-excludes-callers.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | Window.bar @ /VM:11:11
8 | Window.foo @ /VM:3:11
9 | @ /VM:14:9
10 | {
11 | allThreadsStopped : false
12 | description : Paused on debugger statement
13 | reason : pause
14 | threadId :
15 | }
16 | Window.bar @ /VM:11:11
17 | Window.baz @ /VM:7:11
18 | @ /VM:15:9
19 | {
20 | allThreadsStopped : false
21 | description : Paused on debugger statement
22 | reason : pause
23 | threadId :
24 | }
25 | Window.bar @ /VM:11:11
26 | Window.baz @ /VM:7:11
27 | @ /VM:17:9
28 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-first-line-breaks-if-requested.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/simpleNode/index.js:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-first-line-does-not-break-if-not-requested.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/simpleNode/index.js:2:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-gets-correct-line-number-with-babel-code-407.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | {
8 | allThreadsStopped : false
9 | description : Paused on breakpoint
10 | reason : breakpoint
11 | threadId :
12 | }
13 | App @ ${workspaceFolder}/babelLineNumbers/app.tsx:2:3
14 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-handles-hot-transpiled-modules.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | double @ ${workspaceFolder}/tsNode/double.ts:12:2
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-condition-exact.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/condition.js:2:3
8 | result: 1
9 | {
10 | allThreadsStopped : false
11 | description : Paused on debugger statement
12 | reason : pause
13 | threadId :
14 | }
15 | @ ${workspaceFolder}/web/condition.js:5:1
16 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-condition-greater-than.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/condition.js:2:3
8 | result: 3
9 | {
10 | allThreadsStopped : false
11 | description : Paused on breakpoint
12 | reason : breakpoint
13 | threadId :
14 | }
15 | @ ${workspaceFolder}/web/condition.js:2:3
16 | result: 4
17 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-condition-invalid.txt:
--------------------------------------------------------------------------------
1 | stderr> Invalid hit condition "abc". Expected an expression like "> 42" or "== 2".
2 | {
3 | allThreadsStopped : false
4 | description : Paused on debugger statement
5 | reason : pause
6 | threadId :
7 | }
8 | @ ${workspaceFolder}/web/condition.js:5:1
9 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-condition-less-than.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/condition.js:2:3
8 | result: 0
9 | {
10 | allThreadsStopped : false
11 | description : Paused on breakpoint
12 | reason : breakpoint
13 | threadId :
14 | }
15 | @ ${workspaceFolder}/web/condition.js:2:3
16 | result: 1
17 | {
18 | allThreadsStopped : false
19 | description : Paused on debugger statement
20 | reason : pause
21 | threadId :
22 | }
23 | @ ${workspaceFolder}/web/condition.js:5:1
24 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-count-can-change-breakpoint-after-being-set.txt:
--------------------------------------------------------------------------------
1 | {
2 | breakpoints : [
3 | [0] : {
4 | column : 13
5 | id :
6 | line : 4
7 | source : {
8 | name : /VM
9 | path : /VM
10 | sourceReference :
11 | }
12 | verified : true
13 | }
14 | ]
15 | }
16 | {
17 | breakpoints : [
18 | [0] : {
19 | column : 13
20 | id :
21 | line : 4
22 | source : {
23 | name : /VM
24 | path : /VM
25 | sourceReference :
26 | }
27 | verified : true
28 | }
29 | ]
30 | }
31 | Evaluating#1: foo();
32 | result: 7
33 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-count-does-not-validate-or-hit-invalid-breakpoint.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1:
2 | function foo() {
3 | for (let i = 0; i < 10; i++) {
4 | console.log(i);
5 | console.log(i);
6 | console.log(i);
7 | }
8 | }
9 |
10 | {
11 | breakpoints : [
12 | [0] : {
13 | id :
14 | message : Unbound breakpoint
15 | verified : false
16 | }
17 | ]
18 | }
19 | {
20 | category : stderr
21 | output : Invalid hit condition "potato". Expected an expression like "> 42" or "== 2".
22 | }
23 | Evaluating#2: foo();
24 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-count-implies-equal-1698.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1:
2 | function foo() {
3 | for (let i = 0; i < 10; i++) {
4 | console.log(i);
5 | console.log(i);
6 | console.log(i);
7 | }
8 | }
9 |
10 | {
11 | breakpoints : [
12 | [0] : {
13 | column : 13
14 | id :
15 | line : 4
16 | source : {
17 | name : localhost꞉8001/eval1.js
18 | path : localhost꞉8001/eval1.js
19 | sourceReference :
20 | }
21 | verified : true
22 | }
23 | ]
24 | }
25 | Evaluating#2: foo();
26 | result: 4
27 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hit-count-works-for-valid.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1:
2 | function foo() {
3 | for (let i = 0; i < 10; i++) {
4 | console.log(i);
5 | console.log(i);
6 | console.log(i);
7 | }
8 | }
9 |
10 | {
11 | breakpoints : [
12 | [0] : {
13 | column : 13
14 | id :
15 | line : 4
16 | source : {
17 | name : localhost꞉8001/eval1.js
18 | path : localhost꞉8001/eval1.js
19 | sourceReference :
20 | }
21 | verified : true
22 | }
23 | ]
24 | }
25 | Evaluating#2: foo();
26 | result: 4
27 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hot-transpiled-adjusts-breakpoints-after-already-running-524.txt:
--------------------------------------------------------------------------------
1 | {
2 | breakpoints : [
3 | [0] : {
4 | column : 3
5 | id :
6 | line : 17
7 | source : {
8 | name : tsNode/double.ts
9 | path : ${workspaceFolder}/tsNode/double.ts
10 | sourceReference :
11 | }
12 | verified : true
13 | }
14 | ]
15 | }
16 | {
17 | allThreadsStopped : false
18 | description : Paused on breakpoint
19 | reason : breakpoint
20 | threadId :
21 | }
22 | double @ ${workspaceFolder}/tsNode/double.ts:17:3
23 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hot-transpiled-adjusts-breakpoints.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | triple @ ${workspaceFolder}/tsNode/double.ts:7:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hot-transpiled-avoids-double-pathmapping-1617.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${fixturesDir}/src/double.js:1:27
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hot-transpiled-breaks-on-first-line.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/tsNode/double.ts:4:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hot-transpiled-does-not-adjust-already-correct.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/tsNode/matching-line.ts:3:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hot-transpiled-user-defined-bp-on-first-line.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/tsNode/log.ts:2:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-hot-transpiled-works-in-remote-workspaces.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | triple @ ${workspaceFolder}/tsNode/double.ts:7:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-ignores-source-url-query-string-1225.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/sourceQueryString/input.ts:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-absolute-path-in-nested-module.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/nestedAbsRoot/test.js:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-inline.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/inlinescriptpause.html:8:5
8 | {
9 | allThreadsStopped : false
10 | description : Paused on breakpoint
11 | reason : breakpoint
12 | threadId :
13 | }
14 | Window.foo @ ${workspaceFolder}/web/inlinescriptpause.html:6:7
15 | @ ${workspaceFolder}/web/inlinescriptpause.html:9:5
16 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-overwrite.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1:
2 | function foo() {
3 | var x = 3;
4 | return 2;
5 | }
6 |
7 | {
8 | allThreadsStopped : false
9 | description : Paused on breakpoint
10 | reason : breakpoint
11 | threadId :
12 | }
13 | Window.foo @ localhost꞉8001/eval1.js:3:19
14 | @ localhost꞉8001/test.js:1:1
15 | {
16 | allThreadsStopped : false
17 | description : Paused on debugger statement
18 | reason : pause
19 | threadId :
20 | }
21 | @ localhost꞉8001/test.js:2:1
22 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-ref.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1:
2 | function foo() {
3 | return 2;
4 | }
5 |
6 | Evaluating#2: foo();
7 | {
8 | allThreadsStopped : false
9 | description : Paused on breakpoint
10 | reason : breakpoint
11 | threadId :
12 | }
13 | Window.foo @ localhost꞉8001/eval1.js:3:9
14 | @ localhost꞉8001/eval2.js:1:1
15 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-remove.txt:
--------------------------------------------------------------------------------
1 | Evaluating#1:
2 | function foo() {
3 | return 2;
4 | }
5 |
6 | {
7 | allThreadsStopped : false
8 | description : Paused on debugger statement
9 | reason : pause
10 | threadId :
11 | }
12 | @ localhost꞉8001/test.js:2:1
13 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-script.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/script.js:10:1
8 | {
9 | allThreadsStopped : false
10 | description : Paused on breakpoint
11 | reason : breakpoint
12 | threadId :
13 | }
14 | Window.bar @ ${workspaceFolder}/web/script.js:6:3
15 | Window.foo @ ${workspaceFolder}/web/script.js:2:3
16 | @ ${workspaceFolder}/web/script.js:11:1
17 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-sets-breakpoints-in-sourcemapped-nodemodules-with-absolute-root.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | double @ ${workspaceFolder}/nodeModuleBreakpoint/node_modules/@c4312/absolute-sourceroot/src/index.ts:2:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-sets-breakpoints-in-sourcemapped-nodemodules.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | double @ ${workspaceFolder}/nodeModuleBreakpoint/node_modules/@c4312/foo/src/index.ts:2:3
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-source-map-remove.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | foo @ ${workspaceFolder}/web/browserify/module1.ts:3:3
8 | Window.bar @ ${workspaceFolder}/web/browserify/module2.ts:3:3
9 | @ localhost꞉8001/browserify/test.js:1:8
10 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-launched-source-map.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | Window.bar @ ${workspaceFolder}/web/browserify/module2.ts:3:3
8 | @ localhost꞉8001/browserify/test.js:1:8
9 | {
10 | allThreadsStopped : false
11 | description : Paused on debugger statement
12 | reason : pause
13 | threadId :
14 | }
15 | foo @ ${workspaceFolder}/web/browserify/module1.ts:3:3
16 | Window.bar @ ${workspaceFolder}/web/browserify/module2.ts:3:3
17 | @ localhost꞉8001/browserify/test.js:1:8
18 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-lazy-async-stack-sets-eagerly-on-bp.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/asyncStack.js:2:3
8 | ----setTimeout----
9 | @ ${workspaceFolder}/web/asyncStack.js:1:1
10 | {
11 | allThreadsStopped : false
12 | description : Paused on breakpoint
13 | reason : breakpoint
14 | threadId :
15 | }
16 | @ ${workspaceFolder}/web/asyncStack.js:5:5
17 | ----setTimeout----
18 | @ ${workspaceFolder}/web/asyncStack.js:4:3
19 | ----setTimeout----
20 | @ ${workspaceFolder}/web/asyncStack.js:1:1
21 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-lazy-async-stack-sets-stack-on-pause.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on debugger statement
4 | reason : pause
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/asyncStack.js:2:3
8 | {
9 | allThreadsStopped : false
10 | description : Paused on debugger statement
11 | reason : pause
12 | threadId :
13 | }
14 | @ ${workspaceFolder}/web/asyncStack.js:5:5
15 | ----setTimeout----
16 | @ ${workspaceFolder}/web/asyncStack.js:4:3
17 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-logpoints-basic.txt:
--------------------------------------------------------------------------------
1 | stdout> 123
2 | stdout> {foo: 'bar'}
3 | stdout> > {foo: 'bar'}
4 | stdout> > arg1: {foo: 'bar'}
5 | stdout> 1
6 | stdout> foo 1 bar
7 | stdout> foo barbaz
8 | stdout> barbaz
9 | stdout> barbaz
10 | stdout> Error: oof
11 | at eval (logpoint-.cdp:3:11)
12 | at eval (logpoint-.cdp:7:3)
13 | at f (http://localhost:8001/logging.js:22:3)
14 | at http://localhost:8001/logging.js:24:1
15 | stdout> hi
16 | stdout> {foo: 'bar'}
17 | stdout> > {foo: 'bar'}
18 | stdout> > arg1: {foo: 'bar'}
19 | stdout> {f: ƒ}
20 | stdout> > {f: ƒ}
21 | stdout> > arg1: {f: ƒ}
22 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-logpoints-callstack.txt:
--------------------------------------------------------------------------------
1 | {
2 | category : stdout
3 | column : 3
4 | line : 22
5 | output : 123
6 | source : {
7 | name : localhost꞉8001/logging.js
8 | path : ${workspaceFolder}/web/logging.js
9 | sourceReference :
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-logpoints-no-double-log.txt:
--------------------------------------------------------------------------------
1 | stdout> LOG1
2 | stdout> DONE1
3 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-logpoints-returnvalue.txt:
--------------------------------------------------------------------------------
1 | stdout> doubled: 14
2 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-normalizes-webpack-nul-byte-1080.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/webpackNulByte/src/#hello/world.ts:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-prefers-file-uris-to-url-1598.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/script.js:9:1
8 | {
9 | allThreadsStopped : false
10 | description : Paused on debugger statement
11 | reason : pause
12 | threadId :
13 | }
14 | @ ${workspaceFolder}/web/script.js:10:1
15 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-reevaluates-breakpoints-when-new-sources-come-in-600.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/hello.js:2:3
8 | ----setInterval----
9 | @ ${workspaceFolder}/web/hello.js:1:1
10 | {
11 | allThreadsStopped : false
12 | description : Paused on breakpoint
13 | reason : breakpoint
14 | threadId :
15 | }
16 | @ ${workspaceFolder}/web/hello.js:2:3
17 | ----setInterval----
18 | @ ${workspaceFolder}/web/hello.js:1:1
19 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-resolves-sourcemaps-in-paths-containing-glob-patterns-vscode166400.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : entry
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/glob(chars)/app.ts:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-restart-frame.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/web/restart.js:6:3
8 | @ ${workspaceFolder}/web/restart.js:7:3
9 | {
10 | allThreadsStopped : false
11 | description : Paused on frame entry
12 | reason : frame_entry
13 | threadId :
14 | }
15 | @ ${workspaceFolder}/web/restart.js:4:3
16 | @ ${workspaceFolder}/web/restart.js:7:3
17 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-sets-file-uri-breakpoints-predictably-1748.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${fixturesDir}/scripts/hello.js:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-stop-on-entry-on-ts-file-reports-as-entry.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : entry
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/tsNodeApp/app.ts:1:1
8 |
--------------------------------------------------------------------------------
/src/test/breakpoints/breakpoints-user-defined-bp-on-first-line-with-stop-on-entry-on-ts-file-reports-as-breakpoint.txt:
--------------------------------------------------------------------------------
1 | {
2 | allThreadsStopped : false
3 | description : Paused on breakpoint
4 | reason : breakpoint
5 | threadId :
6 | }
7 | @ ${workspaceFolder}/tsNodeApp/app.ts:1:1
8 |
--------------------------------------------------------------------------------
/src/test/browser/browser-launch-environment-variables.txt:
--------------------------------------------------------------------------------
1 | result: 0
2 |
--------------------------------------------------------------------------------
/src/test/browser/browser-launch-runtime-args.txt:
--------------------------------------------------------------------------------
1 | > result: (2) [678, 456]
2 | 0: 678
3 | 1: 456
4 | length: 2
5 | > [[Prototype]]: Array(0)
6 | > [[Prototype]]: Object
7 |
--------------------------------------------------------------------------------
/src/test/browser/performance.test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from 'chai';
2 | /*---------------------------------------------------------
3 | * Copyright (C) Microsoft Corporation. All rights reserved.
4 | *--------------------------------------------------------*/
5 | import { itIntegrates } from '../testIntegrationUtils';
6 |
7 | describe('performance', () => {
8 | itIntegrates('gets performance information', async ({ r }) => {
9 | const p = await r.launchUrlAndLoad('index.html');
10 | const res = await p.dap.getPerformance({});
11 | expect(res.error).to.be.undefined;
12 | expect(res.metrics).to.not.be.empty;
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/src/test/console/console-api-format-format-string.txt:
--------------------------------------------------------------------------------
1 | Evaluating: 'console.log('Log')'
2 | stdout> Log
3 |
4 | Evaluating: 'console.info('Info')'
5 | stdout> Info
6 |
7 | Evaluating: 'console.warn('Warn')'
8 | stderr> Warn
9 |
10 | Evaluating: 'console.error('Error')'
11 | stderr> Error
12 |
13 | Evaluating: 'console.assert(false, 'Assert')'
14 | stderr> Assert
15 |
16 | Evaluating: 'console.assert(false)'
17 | stderr> Assertion failed
18 |
19 | Evaluating: 'console.trace('Trace')'
20 | stdout> Trace
21 |
22 | Evaluating: 'console.count('Counter')'
23 | stdout> Counter: 1
24 |
25 | Evaluating: 'console.count('Counter')'
26 | stdout> Counter: 2
27 |
28 |
--------------------------------------------------------------------------------
/src/test/console/console-format-adds-error-traces-if-they-do-not-exist.txt:
--------------------------------------------------------------------------------
1 | Evaluating: 'setTimeout(() => { throw "asdf" }, 0) '
2 | stderr> Uncaught Error asdf
3 | at (/VM:1:20)
4 | --- setTimeout ---
5 | at (/VM:1:1)
6 | stderr>
7 | > Uncaught Error asdf
8 | at (/VM:1:20)
9 | --- setTimeout ---
10 | at (/VM:1:1)
11 | stderr>
12 | @ /VM