-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
put BP on first code line #7324
Conversation
const initialBreakpoint: DebugProtocol.SourceBreakpoint = { | ||
line: 1 | ||
line: lineList[0] + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all comments, what would happen here?
@@ -496,8 +498,21 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID | |||
await this.dumpCell(cell.document.uri.toString()); | |||
|
|||
if (this.configuration.__mode === KernelDebugMode.RunByLine) { | |||
const textLines = cell.document.getText().split('\r\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.splitLines({trim: false, removeEmptyEntries: false}) might be the safer option here.
Codecov Report
@@ Coverage Diff @@
## main #7324 +/- ##
======================================
- Coverage 65% 63% -3%
======================================
Files 360 360
Lines 22553 22562 +9
Branches 3413 3415 +2
======================================
- Hits 14788 14238 -550
- Misses 6465 7139 +674
+ Partials 1300 1185 -115
|
line: lineList[0] + 1 | ||
}; | ||
const splitPath = cell.notebook.uri.path.split('/'); | ||
const name = splitPath[splitPath.length - 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the name of the notebook? If it is, then its clearer to use fs.baseName or similar API on cell.notebook.uri.fspath
, instead of splitting with /
.
E.g. on windows it could be \
.
lines: [1], | ||
breakpoints: [initialBreakpoint], | ||
sourceModified: false | ||
const textLines = cell.document.getText().splitLines({ trim: false, removeEmptyEntries: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here explaining why we need to parseForComments? I assume this is because before the breakpoint would end up on a commented line and not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's it, will do
// Open variable view | ||
const settings = this.settings.getSettings(); | ||
if (settings.showVariableViewWhenDebugging) { | ||
await this.commandManager.executeCommand(Commands.OpenVariableView); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to await here?
@@ -496,31 +498,46 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID | |||
await this.dumpCell(cell.document.uri.toString()); | |||
|
|||
if (this.configuration.__mode === KernelDebugMode.RunByLine) { | |||
const initialBreakpoint: DebugProtocol.SourceBreakpoint = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should re-open #7251 or create a new issue to track the work around, else I do'nt see how we'll end up removing the work around.
I.e. theres no issue to track this work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create a new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* put BP on first code line * better way * don't set a breakpoint if its all comments or empty lines * PR comments
Thanks @claudiaregio for finding this
for #7339
package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).