alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
40 stars 6 forks source link

[FEATURE] - Add separator for notebook cells based on comment pattern #100

Open ma-sadeghi opened 4 months ago

ma-sadeghi commented 4 months ago

In Python and Julia, especially during prototyping, it's common to format the script as "code cells", which can then be executed individually (supported by most IDEs including VS Code). For instance, in Python, the common code cell marker is # %%, e.g.:

# %%
# Code block A

# ...

# %%
# Code block B

# ...

In VS Code, there's preliminary support for native code cell separators, but it's only limited to Python. It'd be really useful if your extension could support this feature.

Thanks!

alefragnani commented 1 month ago

Hi @ma-sadeghi ,

The extension depends entirely on the language extension in order to identify the symbols, and to know if some symbol could receive separators, you could use the Outline view as a reference. If you see these "code cells" in the Outline view, it could certainly receive separators above. On the other hand, if they are not in the Outline view, so the extension won’t be able to draw separators.

If you see them in the Outline view, please post a picture of it, and if possible, a sample source that I could use play with.

Hope this helps