hoangKnLai / vscode-ipython

VSCode Extension integrating Editor with IPython console.
MIT License
18 stars 5 forks source link

Feature request: add permanent horizontal cell separator #25

Closed AmerM137 closed 1 year ago

AmerM137 commented 1 year ago

Hello,

First, thank you for making this extension. I am trying to move to VS Code from Spyder and this extension is the only thing that has made it a real possibility! I am so used to having an ipython terminal on one side of the editor for quick data science tests or general debugging.

It would be really nice to have a permanent line to separate code cells (like Spyder). I think currently you only see lines around the active cells, and I think this is mainly coming from the jupyter extension.

As a reference, there is a fork of this project named "ipython2", which currently implements this, but it's missing an important feature which is the ability to use a temp file to copy code into before pasting into ipython. link -> https://github.com/moykeen/vscode-ipython

I am not a TS/JS guy, but I think this is the code that's doing it? https://github.com/moykeen/vscode-ipython/blob/main/src/extension.ts --line 75

    let timeout: NodeJS.Timer | undefined = undefined;
    const cellHeaderDecorationType = vscode.window.createTextEditorDecorationType({
        isWholeLine: true,
        borderWidth: `1px 0 0 0`,
        borderStyle: 'solid'
    });
    let activeEditor = vscode.window.activeTextEditor;

Also, maybe we can a simple way to configure the line format? color & thickness would be enough I think.

hoangKnLai commented 1 year ago

First, thank you for making this extension. I am trying to move to VS Code from Spyder and this extension is the only thing that has made it a real possibility!

Same here. Many parts of this extension were inspired by prior work/inefficiency found in Matlab and of course Spyder 😃.

It would be really nice to have a permanent line to separate code cells (like Spyder). I think currently you only see lines around the active cells, and I think this is mainly coming from the jupyter extension.

The Jupyter extension divider is often too clunky for me so I generally ignore it. So I'm very much grateful for the suggestion with the horizontal line. I've been looking for this solution for awhile and will add it soon.

Also, in case you haven't test this out yet. Try the Alt + k or Alt + j (move cursor up/down one cell block) option! I'm slowly (very slowly lately) moving toward implementing a navigation panel like in Spyder too.

hoangKnLai commented 1 year ago

Big thanks for the suggestions and @moykeen for solution. It should be available now in v2023.8.0.

AmerM137 commented 1 year ago

Very nice! Thanks for adding this feature. It definitely helps having the cells permanently divided just like Spyder.