not quite your typical Showcase post, but here goes anyway…
i’ve always been addicted to the Outline view in my IDE; and needless to say you need something like ZLS to make this happen… and while i might have been a little impatient with ZLS in this post, i’ve increased my understanding of why ZLS sometimes comes up short…
but here’s a serendipitous use of one of the most basic features of ZLS – supporting an Outline view of the current source file:
as part of my ongoing development of the Zig•EM framework (which you can read more about here ahead of its initial showcase), i have one “low-level” source file (em.zig
) containing a slew of foundational elements used through the framework…
in an attempt to “organize” its 1000+ lines of code, i’ll add banner comments to demarcate logical sections of the file… but then (duh!!!) i realized i could define markers like const @"// -------- CONFIG FLDS -------- //" = {};
and suddendly my outline is far more organized…
but wait, there’s more… look what happens when you order the outline by Name rather than Position:
you automatically gain a table-of-contents at the top of the list – thanks in part to the ASCII-collating sequence