當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript DebugClient.setBreakpointsRequest方法代碼示例

本文整理匯總了TypeScript中vscode-debugadapter-testsupport.DebugClient.setBreakpointsRequest方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DebugClient.setBreakpointsRequest方法的具體用法?TypeScript DebugClient.setBreakpointsRequest怎麽用?TypeScript DebugClient.setBreakpointsRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vscode-debugadapter-testsupport.DebugClient的用法示例。


在下文中一共展示了DebugClient.setBreakpointsRequest方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('should support removing a breakpoint', async () => {
     await Promise.all([client.launch({program}), client.waitForEvent('initialized')]);
     // set two breakpoints
     let breakpoints = (await client.setBreakpointsRequest({breakpoints: [{line: 3}, {line: 5}], source: {path: program}})).body.breakpoints;
     assert.lengthOf(breakpoints, 2);
     assert.isTrue(breakpoints[0].verified, 'breakpoint verification mismatch: verified');
     assert.equal(breakpoints[0].line, 3, 'breakpoint verification mismatch: line');
     assert.isTrue(breakpoints[1].verified, 'breakpoint verification mismatch: verified');
     assert.equal(breakpoints[1].line, 5, 'breakpoint verification mismatch: line');
     // stop at first
     const [{threadId}] = await Promise.all([
         assertStoppedLocation('breakpoint', program, 3),
         client.configurationDoneRequest()
     ]);
     // remove second
     breakpoints = (await client.setBreakpointsRequest({breakpoints: [{line: 3}], source: {path: program}})).body.breakpoints;
     assert.lengthOf(breakpoints, 1);
     assert.isTrue(breakpoints[0].verified, 'breakpoint verification mismatch: verified');
     assert.equal(breakpoints[0].line, 3, 'breakpoint verification mismatch: line');
     // should run to end
     await Promise.all([
         client.waitForEvent('terminated'),
         client.continueRequest({threadId})
     ]);
 });
開發者ID:Heresiarch88,項目名稱:vscode-php-debug,代碼行數:25,代碼來源:adapter.ts

示例2: testBreakpointHit

 async function testBreakpointHit(program: string, line: number): Promise<void> {
     await Promise.all([client.launch({program}), client.waitForEvent('initialized')]);
     const breakpoint = (await client.setBreakpointsRequest({breakpoints: [{line}], source: {path: program}})).body.breakpoints[0];
     assert.isTrue(breakpoint.verified, 'breakpoint verification mismatch: verified');
     assert.equal(breakpoint.line, line, 'breakpoint verification mismatch: line');
     await Promise.all([
         client.configurationDoneRequest(),
         assertStoppedLocation('breakpoint', program, line)
     ]);
 }
開發者ID:VivPat,項目名稱:vscode-php-debug,代碼行數:10,代碼來源:adapter.ts

示例3: setBreakpoint

export function setBreakpoint(dc: DebugClient, bps: DebugProtocol.SourceBreakpoint[], program: string, expLine?: number, expCol?: number, expVerified?: boolean): Promise<void> {
    return dc.setBreakpointsRequest({
        breakpoints: bps,
        source: { path: program }
    }).then(response => {
        const bp = response.body.breakpoints[0];

        if (typeof expVerified === 'boolean') assert.equal(bp.verified, expVerified, 'breakpoint verification mismatch: verified');
        if (typeof expLine === 'number') assert.equal(bp.line, expLine, 'breakpoint verification mismatch: line');
        if (typeof expCol === 'number') assert.equal(bp.column, expCol, 'breakpoint verification mismatch: column');
    });
}
開發者ID:Microsoft,項目名稱:vscode-chrome-debug-core,代碼行數:12,代碼來源:debugClient.ts

示例4: it

 it('should not stop on a conditional breakpoint when condition is false', async () => {
     await Promise.all([
         client.launch({program}),
         client.waitForEvent('initialized')
     ]);
     const bp = (await client.setBreakpointsRequest({breakpoints: [{line: 10, condition: '$anInt !== 123'}], source: {path: program}})).body.breakpoints[0];
     assert.equal(bp.verified, true, 'breakpoint verification mismatch: verified');
     assert.equal(bp.line, 10, 'breakpoint verification mismatch: line');
     await Promise.all([
         client.configurationDoneRequest(),
         client.waitForEvent('terminated')
     ]);
 });
開發者ID:VivPat,項目名稱:vscode-php-debug,代碼行數:13,代碼來源:adapter.ts

示例5: beforeEach

 beforeEach(async () => {
     await Promise.all([
         client.launch({program}),
         client.waitForEvent('initialized')
     ]);
     await client.setBreakpointsRequest({source: {path: program}, breakpoints: [{line: 17}]});
     const [, event] = await Promise.all([
         client.configurationDoneRequest(),
         client.waitForEvent('stopped') as Promise<DebugProtocol.StoppedEvent>
     ]);
     const stackFrame = (await client.stackTraceRequest({threadId: event.body.threadId})).body.stackFrames[0];
     const scopes = (await client.scopesRequest({frameId: stackFrame.id})).body.scopes;
     localScope = scopes.find(scope => scope.name === 'Locals');
     superglobalsScope = scopes.find(scope => scope.name === 'Superglobals');
     constantsScope = scopes.find(scope => scope.name === 'User defined constants');
 });
開發者ID:VivPat,項目名稱:vscode-php-debug,代碼行數:16,代碼來源:adapter.ts

示例6:

				dc.waitForEvent('initialized').then(event => {
					return dc.setBreakpointsRequest({
						breakpoints: [ { line: COND_BREAKPOINT_LINE, condition: 'i === 3' } ],
						source: { path: PROGRAM }
					});
				}).then(response => {
開發者ID:abug,項目名稱:vscode-node-debug,代碼行數:6,代碼來源:adapter.test.ts


注:本文中的vscode-debugadapter-testsupport.DebugClient.setBreakpointsRequest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。