Folding - can it be customized by lang?

I found it curious that the

tag in an html5 file isn’t foldable! other elements in the table are.
That got me wondering if the folding logic could be extended.
And a second question is does folding in any lang support regions?

You would have to fork the language in question and teach it about folding yourself, in all honesty that wouldn’t exactly be easy nor straight forward.

I’m not certain what you mean by regions.

I guess something like

# region start
some () -> pseudo {
    code
}
# region end

Visual Studio does this (C# here)

Here, it looks like MS implements it as a compiler directive and it gets compiled out. Might be hard to implement for general-purpose scripting languages.

Even so, it would be a nice feature.

Gentlemen: With all due respect (and sincerely I do not wish to offend), code folding has not been a part of any language specification I have ever read. And I have read more than I care to admit. To suggest the forking of a language in order to introduce a compiler directive is to not understand the roles and differences between a “language”, a “compiler” and the framework of its construction, and a text editor even one with minimal degrees of IDE functionality like Komodo.

The #region in Visual Studio (which is my primary IDE, and I am intimately familiar with VS/c#/DN) - is indeed a compiler directive. However, it is NOT part of the c# language spec, nor are compiler directives of any sort, as they are quite literally “part of a compiler language of sorts”. But that’s irrelevant, the point is that even as part of the compiler directive “language” (to use that term loosely) they do NOT provide the type of cold folding being discussed. That is a function of the editor, specifically, either 1: the builtin code folding capability (unlikely) or 2: the extension “bolted” onto the editor which provides the feature. VS has wonderful code folding, but it’s not very flexible, configurable, and as of VS2017 not extensible unless you’re willing to write a complete plugin.

If you want to see what I am talking about in action, look at Eclipse with the one code folding plugin they have worth touching. It allows you to specify tags which are folded. So - from plugin -> editor, NOT, language -> compiler -> editor.

In any case - the code folding in Komodo Edit is broken, sadly. I have found it to be inconsistent even when just dealing with a very tiny number of files that are strictly htm/js/css/php. And I have been researching the extensibility of the app to see if it was worth me writing a plugin to solve the matter. So far, I have found the extensibility to be… lacking, and outdated. I MEAN NO OFFENSE TO ANYONE - it’s still a great editor. These are just my views, after only about 2 weeks of eval time. So anyone involved with the product, or these posts, if you have been in the software world any length of time then you know not to take criticisms personally. Especially when they come from an anonymous inter-thingy user.

I don’t mean for the actual language itself, I mean the language as in Komodo’s lexer for that language.

Don’t worry, none taken.

I agree writing a language plugin for Komodo is at this point quite challenging. I wish I could be of more help but that would effectively entail my solving the problem of language plugins being challenging. Don’t get me wrong, that’s definitely something I’d like to do, but I can’t address that here and now.

Oh man what a jackass I am sometimes - I really do apologize mate. I’ve been having some trouble with folding and some other things that are frustrating me - and I guess I wasn’t reading or thinking clearly.

I do like a lot of things about the app, especially being able to make it look the way I want. But there are also a few things that make me think I may be expecting too much and that my needs are really a good fit. I really don’t need a full IDE, I use Eclipse for my Java work and Visual Studio for all the dotnet (which is the bulk). But I haven’t had a decent text editor where I could also do some very minimal html/asp/jsp/etc - I spent the past year working hard to make Atom work for me but there are some basic things (like, again, code folding) that they just don’t consider important. And the minute it was bought out by the gorilla (guerilla?) that just happens to put out a competing product in Visual Code - well all the time I spent working through problems with Atom and the plugins that often don’t work - very frustrating. And Sublime is nice and all, but sorry $80 for an editor pretending to be an IDE? I have 2 apps I helped develop that have embedded editors, I’ll write my own before I’ll throw $80 or watch their advertisemenagging.

Sorry for rambling mate… again, I’m sorry for jumping into rant/lecture mode. I am still using Komodo however, so maybe I can work through the few issues I have. And if I recall correctly - this is open-source, yea? I suppose I could just write some code to make some “enhancements” and offer that back to the group - is that even allowed? (free I mean) I’m not sure what lang(s) it’s built with but what’s one more language at this point? LOLOL! I’ve written assembly to xojo (almost A-Z) so may that’s a good way for me to get this working. Either that… or I pluck out one of my eyes and use Notepad++ again. Decent enough app but ugly as sin.

Komodo Edit is Open-Source, Komodo IDE is not. But you can extend and contribute to both: