Skip to content
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

Only trim leading empty lines, not tabs, when submitting #%% cells to the interactive window #7483

Merged
merged 1 commit into from
Sep 11, 2021

Conversation

joyceerhl
Copy link
Contributor

@joyceerhl joyceerhl commented Sep 10, 2021

Fix #7303

The webview interactive window used to trim the code to display in the UI

// Then remove text on the front and back. We only do this for the interactive window
return removeLinesFromFrontAndBack(text);
so we lost this in the transition to the native interactive window. We 'fixed' this by trimming the code that we put into the NotebookCell, which caused #2552 since we removed all leading whitespace, not just leading empty lines
: cellMatcher.stripFirstMarker(code).trim();

Since the cellhashprovider works with a copy of the original, unmodified source code, and not the actual document.getText(), this shouldn't cause (new) issues with debugging cells in the IW.

@joyceerhl joyceerhl requested a review from a team as a code owner September 10, 2021 22:57
@codecov-commenter
Copy link

Codecov Report

Merging #7483 (064d8f5) into main (c0f2a08) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff          @@
##            main   #7483   +/-   ##
=====================================
  Coverage     64%     64%           
=====================================
  Files        361     361           
  Lines      22506   22506           
  Branches    3422    3422           
=====================================
+ Hits       14542   14603   +61     
+ Misses      6742    6685   -57     
+ Partials    1222    1218    -4     
Impacted Files Coverage Δ
...atascience/interactive-window/interactiveWindow.ts 52% <100%> (ø)
...tascience/jupyter/kernels/kernelCommandListener.ts 55% <0%> (-3%) ⬇️
src/client/datascience/cellFactory.ts 62% <0%> (+2%) ⬆️
...client/datascience/editor-integration/decorator.ts 76% <0%> (+2%) ⬆️
...datascience/editor-integration/cellhashprovider.ts 70% <0%> (+3%) ⬆️
src/client/datascience/dataScienceSurveyBanner.ts 63% <0%> (+8%) ⬆️
...ient/datascience/jupyter/kernels/kernelProvider.ts 98% <0%> (+8%) ⬆️
.../datascience/editor-integration/codeLensFactory.ts 86% <0%> (+15%) ⬆️
...ence/editor-integration/cellHashProviderFactory.ts 100% <0%> (+29%) ⬆️

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.

Jupyter interactive: run current cell throws IndentationError: unexpected indent
4 participants