Make breakpoint data available in EH immediately, not after a call to debug API (#186796)

Fix #169699
This commit is contained in:
Rob Lourens
2023-06-30 15:04:59 -07:00
committed by GitHub
parent f2386a5030
commit 448d14e907
4 changed files with 46 additions and 64 deletions

View File

@@ -6,12 +6,22 @@
import * as assert from 'assert';
import { basename } from 'path';
import { commands, debug, Disposable, window, workspace } from 'vscode';
import { assertNoRpc, disposeAll } from '../utils';
import { assertNoRpc, createRandomFile, disposeAll } from '../utils';
suite('vscode API - debug', function () {
teardown(assertNoRpc);
test('breakpoints are available before accessing debug extension API', async () => {
const file = await createRandomFile(undefined, undefined, '.js');
const doc = await workspace.openTextDocument(file);
await window.showTextDocument(doc);
await commands.executeCommand('editor.debug.action.toggleBreakpoint');
assert.strictEqual(debug.breakpoints.length, 1);
await commands.executeCommand('editor.debug.action.toggleBreakpoint');
});
test('breakpoints', async function () {
assert.strictEqual(debug.breakpoints.length, 0);
let onDidChangeBreakpointsCounter = 0;