I have seen people using other txt editors to write code, but i really like the one SC comes with. The only thing i would give a kidney for, is to get a functionality like the one shown in the screenshot. Being able to minimize chunks of code would be just great!
yes indeed! Code folding is one of the reasons I can’t leave scnvim for now…
This could be a great feature for IDE
Code folding is one of the reasons I can’t leave scnvim for now…
huh, is there any particular setting that one needs to activate for this to work? Code folding works alright in nvim for me except in supercollider files, I always thought it just wasn’t implemented in scnvim…
you can to set the foldmethod for your document (:help foldmethod) - default is manual and here you can select a region and and fold using commands like zo zc etc.
you can also set it to use indentation :set foldmethod=indent.
for syntax aware folding you need to install tree-sitter and the tree-sitter parser for supercollider (GitHub - madskjeldgaard/tree-sitter-supercollider: SuperCollider grammar for the tree-sitter code parser), set foldmethod to expr and foldexpr to nvim_treesitter#foldexpr() - its pretty neat…
It’s been discussed before – unfortunately, dev consensus is that it’s not an easy feature, and we’re stretched pretty thin as it is.
- Collpsable code blocks · Issue #731 · supercollider/supercollider · GitHub – “this is not an easy feature to implement and really unlikely to happen in the near future”
- IDE - collapse lines of code · Issue #2264 · supercollider/supercollider · GitHub – “The IDE isn’t intended to become a full professional level code editor. That would suck up precious developer time that needs to be spent on the core feature (music). It’s pretty complicated to do code folding correctly.”
- IDE enhancement: folding lines · Issue #3757 · supercollider/supercollider · GitHub (closed as dup)
So, a couple ways forward:
- Somebody rolls up their Qt sleeves and does it.
- Or, use a different editor with code folding support (scnvim has been mentioned; there’s also an extension for vscodium which is not 100% complete I think? But fairly usable already.
hjh
Thanks! Couldn’t make the manual mode work but with the treesitter setting it works great!
