microsoft / vscode-jupyter

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

No indentation in interactive window command line #15946

Closed filipporemonato closed 3 months ago

filipporemonato commented 3 months ago

Applies To

What happened?

I could swear that up until recently (I have coded in another language for a couple of months), the interactive window's command line would correctly indent code, but now it appears it does not:

image

I could not find any setting that controls this behaviour. Am I wrong in remembering it did indent? If I am wrong, then I would like to transfer this to a feature request, as I think it really should indent automatically.

VS Code Version

Version: 1.92.2 (user setup) Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9 Date: 2024-08-14T17:29:30.058Z Electron: 30.1.2 ElectronBuildId: 9870757 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045

Jupyter Extension Version

v2024.7.0

Jupyter logs

No response

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

None

filipporemonato commented 3 months ago

I found out about this. The issue happened with the Interactive Window: Execute With Shift Enter option ticked off. In this case, pressing "enter" still created a new line (instead of executing the code), and this new line was unindented as shown in my screenshot. Using shift-enter in this case to create the line, correctly indented the cursor.

Likewise, if I have the Interactive Window: Execute With Shift Enter option ticked on, then pressing "enter" creates a new line which is correctly indented.

So my conclusion is that this behaviour is correct and sensible. The problem lies in "enter" creating a new line instead of executing the code, which I reported in another issue (https://github.com/microsoft/vscode-jupyter/issues/15945).

I think this issue can be closed.