microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.25k stars 275 forks source link

Code blocks always sending minimized makes it difficult to check what sent. #15799

Open Yoyokrazy opened 1 week ago

Yoyokrazy commented 1 week ago

Testing microsoft/vscode-python#23676

my_dict = {
    'key1': 'value1',
    'key2': 'value2',
    'key3': 'value3',
    'key4': 'value4'
}

class MyClass:
    def my_function(self):
        print("Hello, world!")
        print("bye, world!")

# Create an instance of MyClass
my_instance = MyClass()

# Call the my_function method
my_instance.my_function()

I placed my cursor on the end of every single line in the file, and hit shift+enter for each. Here is what the smart repl showed by default. image

It's fairly difficult to figure out if the correct line sent to the repl if the blocks always appear minimized.

eleanorjboyd commented 1 week ago

+1 to this

anthonykim1 commented 1 week ago

This is from Interactive Window UI itself, try the same with the Run Interactive Option. Screenshot 2024-06-25 at 3 57 34 PM

Should we always suppress ... for single line statement/execution/expression? @amunger

amunger commented 1 week ago

The idea was that the code is the same as what was in the source file, but it is more obvious with # %% sections for what is being sent to the IW.

Not collapsing a single line cell would make sense, but a single expression could be arbitrarily large, and there is already a setting for this: "interactiveWindow.collapseCellInputCode": "fromEditor".