From f6f23177fce13fc00421060f53c5d7fa165a1d99 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Fri, 23 Feb 2018 00:20:38 +0100 Subject: [PATCH] first cut of logPoints --- package-lock.json | 22 +++++++++++----------- package.json | 6 +++--- src/node/nodeDebug.ts | 15 ++++++++++++--- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9e24d43f..2aa3cb57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8183,26 +8183,26 @@ } }, "vscode-debugadapter": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/vscode-debugadapter/-/vscode-debugadapter-1.26.0.tgz", - "integrity": "sha512-3buat8nrSSQrjH1ogpFD/wu7g4fYwoOi1YRK9l1mkU/ou2q0Tw3UIfRVnrOsOu7pC3ry79Fe1e18RiDWxeya8w==", + "version": "1.27.0-pre.0", + "resolved": "https://registry.npmjs.org/vscode-debugadapter/-/vscode-debugadapter-1.27.0-pre.0.tgz", + "integrity": "sha512-PiMaGnB89wQ0hHgxt7S2ZyvZntVdlf0aCvcJJtcIuxCtEJosTb9P+hH8ID0x/oNWmrdPro7VbDjfOAHAZ3Ze4Q==", "requires": { - "vscode-debugprotocol": "1.26.0" + "vscode-debugprotocol": "1.27.0-pre.0" } }, "vscode-debugadapter-testsupport": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/vscode-debugadapter-testsupport/-/vscode-debugadapter-testsupport-1.26.0.tgz", - "integrity": "sha512-8KkgvzM0nfuAvzeTbKDdD+0KtLEPDASvTAGMHVJHT1HYLSm0QclCgEy27+N1rhRPbyyAUZIblOMG8cB1TjLDYQ==", + "version": "1.27.0-pre.0", + "resolved": "https://registry.npmjs.org/vscode-debugadapter-testsupport/-/vscode-debugadapter-testsupport-1.27.0-pre.0.tgz", + "integrity": "sha512-nreYotlGyC3iWbvJewZE46zOFQ/JFKTSrD6HmG1dyjSXxfPGEdwuye6y4e7rwQ8AJKLrlHbi7AYLUBvn9YVfTg==", "dev": true, "requires": { - "vscode-debugprotocol": "1.26.0" + "vscode-debugprotocol": "1.27.0-pre.0" } }, "vscode-debugprotocol": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.26.0.tgz", - "integrity": "sha512-/T1fZ/qB03YQphej4CPSAbtPfzscMrGQjmn0UjDLuxTXXSLLLA7zvh89sNCkMl7Q7ylxBPyhlFsNmSYTYDqGPw==" + "version": "1.27.0-pre.0", + "resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.27.0-pre.0.tgz", + "integrity": "sha512-BJiO3VeHAe8gbtxbyYHyMgBkuuPGuIn+IMgLlXcy2aKr6LtAGlWf1fCJPixhA1Qx/j7x8AbnjKjItTp41p6BQA==" }, "vscode-nls": { "version": "3.2.1", diff --git a/package.json b/package.json index 25282bfa..1be4df9b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "ms-vscode.node-debug2" ], "dependencies": { - "vscode-debugadapter": "1.26.0", + "vscode-debugadapter": "1.27.0-pre.0", "source-map": "0.6.1", "vscode-nls": "3.2.1", "request-light": "0.2.2", @@ -71,8 +71,8 @@ "typescript": "2.6.2", "vscode": "1.1.10", "vscode-nls-dev": "3.0.7", - "vscode-debugadapter-testsupport": "1.26.0", - "vscode-debugprotocol": "1.26.0", + "vscode-debugadapter-testsupport": "1.27.0-pre.0", + "vscode-debugprotocol": "1.27.0-pre.0", "event-stream": "3.3.4", "nodemon": "1.14.11", "vsce": "1.36.3" diff --git a/src/node/nodeDebug.ts b/src/node/nodeDebug.ts index bf113775..ad045f37 100644 --- a/src/node/nodeDebug.ts +++ b/src/node/nodeDebug.ts @@ -196,10 +196,19 @@ class InternalSourceBreakpoint { hitter: HitterFunction | undefined; verificationMessage: string; - constructor(line: number, column: number = 0, condition?: string, hitter?: HitterFunction) { + constructor(line: number, column: number = 0, condition?: string, logMessage?: string, hitter?: HitterFunction) { this.line = this.orgLine = line; this.column = this.orgColumn = column; - this.condition = condition; + + if (logMessage) { + this.condition = `console.log('${logMessage}')`; + if (condition) { + this.condition = `(${condition}) && ${this.condition}`; + } + } else if (condition) { + this.condition = condition; + } + this.hitCount = 0; this.hitter = hitter; } @@ -1650,7 +1659,7 @@ export class NodeDebugSession extends LoggingDebugSession { sbs.push(new InternalSourceBreakpoint( this.convertClientLineToDebugger(b.line), typeof b.column === 'number' ? this.convertClientColumnToDebugger(b.column) : 0, - b.condition, hitter) + b.condition, b.logMessage, hitter) ); } } else if (args.lines) {