feat: Outdent code when running selection from a notebook#1391
Merged
mattrunyon merged 4 commits intodeephaven:mainfrom Jul 6, 2023
Merged
feat: Outdent code when running selection from a notebook#1391mattrunyon merged 4 commits intodeephaven:mainfrom
mattrunyon merged 4 commits intodeephaven:mainfrom
Conversation
mofojed
previously approved these changes
Jun 30, 2023
Codecov Report
@@ Coverage Diff @@
## main #1391 +/- ##
==========================================
+ Coverage 45.58% 45.63% +0.04%
==========================================
Files 506 506
Lines 34966 34984 +18
Branches 8734 8740 +6
==========================================
+ Hits 15940 15964 +24
+ Misses 18975 18969 -6
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more.
|
dsmmcken
previously requested changes
Jun 30, 2023
Contributor
dsmmcken
left a comment
There was a problem hiding this comment.
def my_func():
# run from here
a = 2
b = 3
def nested(x,y):
return (a + b)
c = nested(a, b)
print(c)
# to here
return cFailure case
Collaborator
Author
|
@dsmmcken Good catch. The newline is what wasn't accounted for (indent size is 0). Maybe I should pull this out into a util and write a few unit tests |
mofojed
requested changes
Jul 4, 2023
mofojed
approved these changes
Jul 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1326
To test, put code in a notebook and run a selection where every line is indented. For example, run the function body of this code
Could be made into a util if we want to use it elsewhere. I looked in the monaco documentation to see if it had anything built-in for this and couldn't find any methods for it