Skip to content

Conversation

@vezwork
Copy link
Collaborator

@vezwork vezwork commented Nov 6, 2025

In #825 @juliasilge noticed that statement execution was broken in Positron source editor for python code cells. I tracked down the issue to a refactor in my previous PR #857.

In #857 I attempted to refactor provideStatementRange. The refactor consisted of inlining a function into another. I made a mistake while inlining, leaving some important code behind. @juliasilge noticed that the change was breaking (see #857 (comment)), and I attempted to address the mistake. I fixed the mistake, adding back in the missing code, but in the process I accidentally introduced another mistake: using position instead of adjustedPosition(vdoc.language, position).

I have tested this PR and it fixes statement range execution in Positron source editor for python code cells.

Next time I do a refactor, I need to find ways to be more systematic about it. It also motivates me to set up some infrastructure for source-mode tests for statement and cell execution. For now, I will put up a small PR to fix the problem.

@vezwork vezwork merged commit eac7ac2 into main Nov 6, 2025
2 checks passed
@vezwork vezwork deleted the fix/statement-range-provider branch November 6, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants