Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
first cut of logPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
weinand committed Feb 22, 2018
1 parent bdade0d commit f6f2317
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
22 changes: 11 additions & 11 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
15 changes: 12 additions & 3 deletions src/node/nodeDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f6f2317

Please sign in to comment.