[ANN] Julia Cell Highlighter—VS Code extension for highlighting Julia code cells

Hi all!
I just released Julia Cell Highlighter (GitHub), a VS Code extension that highlights the current Julia code cell and adds CodeLens actions to run cells.

Key features:

  • Highlights the current cell as you move the cursor
  • Follows Julia’s julia.cellDelimiters when available
  • CodeLens buttons: [Run Cell] / [Run Cell and Move]
  • Visual separator lines above delimiters (independent from highlighting)
  • Exclude folders from highlighting/CodeLens while keeping separators

If you work with long .jl scripts and cell-style workflows, this should make navigation much clearer. Feedback and suggestions are welcome!

Background & Related Threads

This topic has been discussed in the Julia community for a long time. Here are representative threads that cover cell delimiters, execution behavior, and visual separation:

Julia Discourse

julia-vscode GitHub Issues

21 Likes

Cool, I’ve wanted this for a long time :slight_smile: Just wondering why this can’t be part of the julia extension?

2 Likes

Thanks for asking.

I chose to ship this as a standalone extension because I could build it from scratch quickly and publish it immediately. Contributing it upstream to the julia-vscode repository is typically a much longer process: it requires maintainer review, and there are currently 30+ open pull requests already in the queue, which suggests the team is constrained on bandwidth and reviews may not happen promptly.

That said, if the julia-vscode maintainers are interested in integrating this in the future, I’d be happy for them to copy/adopt all of my code.

8 Likes

There is such pull request: Codelens Support in `julia` Files by huangyxi · Pull Request #3586 · julia-vscode/julia-vscode · GitHub.
For some reason, it does not get reviewed.

2 Likes

Thank you for mentioning my PR, and thanks to @karei for the new workaround to support CodeLens.
I don’t understand why this long-awaited community feature has not been merged by the extension’s authors. It would have been fine if I had been told that the PR was going to be rejected for specific reasons. Instead, it was not reviewed at all, which forced me to spend months repeatedly merging and resolving tedious, ultimately hopeless upstream conflicts.
At this point, I’m a bit tired but relieved, especially since CodeLens has now been achieved through another approach. Feel free to use any code from the PR if it helps.

8 Likes

Hi @mkh, I totally understand how frustrating that experience must have been. It’s disheartening to spend months resolving conflicts without any feedback. My guess is that vscode-julia has very few maintainers with merge rights and they’re simply overstretched.

I went through your PR carefully and had a couple of technical questions I’d love your insight on:

  1. Is JuliaCell strictly an internal construct in vscode-julia? Is getDocCells the only path that produces it, or are there other sources?
  2. Your PR uses internal commands like executeAboveCells / executeCurrentAndBelowCells. From the perspective of an external extension, if I want to implement “run above cells” / “run below cells” in a future version, what approach would you recommend?
3 Likes

For your first question, JuliaCell instances are statically constructed when the document is loaded or changed, rather than being dynamically detected at execution time. This applies not only to getDocCells, but also to getJmdDocCells, which retrieves JuliaCells from JMD files.
For your second question, I noticed that the execute method has been refactored over the past couple of days, so you may want to wait until it stabilizes.

2 Likes

Thank you for the clarification.

1 Like

I have added a notice within my extension to clearly distinguish the functional differences between the current official Julia extension (v1.179.2) and this extension.

This notice aims to encourage further integration into julia-vscode or the provision of all features offered by this extension.

Please correct me if anything is written incorrectly.