How to display a line for every python cell boundary in Visual Studio Code?

Viewed 449

In VS Code, when working with python files, if we type #%% it creates a cell separation. When the cursor is within a cell, the editor displays a thick line for the top boundary and a thin line for the bottom boundary (of the current cell only). How can I change the style so that a line is always displayed for every cell boundary (like in the Spyder editor)?

Edit: I found these settings but they only apply to the interactive window and not the editor:

    "workbench.colorCustomizations": {
        "notebook.cellBorderColor": "#ff0000",
        "notebook.cellToolbarSeparator": "#00ff00"
    }

I am expecting to find a way of showing lines at the red arrows below: Missing Python cell delimiter lines

I have seen screenshots showing such lines but I can't find how.

Edit 2: Is there a way to customize the style/appearance of every inserted line showing the clickable commands Run Cell | Run Above | Debug Cell ?

3 Answers

As a possible hack, you can extend the cell commands.

The setting for that is called "Jupyter: Code Lenses".
I set mine to:

"jupyter.runcell, jupyter.runallcellsabove, jupyter.debugcell, 
 jupyter.debugcell, jupyter.debugcell, jupyter.debugcell,
 jupyter.debugcell, jupyter.debugcell, jupyter.debugcell, 
 jupyter.debugcell, jupyter.debugcell, jupyter.debugcell"

long cell command list to mimic a cell border

Jupyter is a good choice for you which has separate code cells.

Create jupyter notebook from command palette then install required module ipykernal, you can run python code cell in it. Reference: Jupyter Notebook in VS Code.

Related