Skip to content

Code folding for sections  #212

@christophe-gouel

Description

@christophe-gouel

It would be great to extend the code folding feature, which is limited to a very small set of code blocks for now, to work with whole sections.

This would allow quick navigation in big models by jumping to the proper section after folding everything.

One question is how to define code sections. One reasonable approach would be to follow RStudio approach, which would translate as defining a section by a line starting with a comment character and that contains at least four dashes:

* First level section ----

** Second level section ----

*** Third level section ----

This is compatible with the language and is easy to type and parse.

Here is an example of what it gives in emacs, where I have just implemented it:
section-folding

The icing on the cake would be to add a different syntax highlighting for section headings to distinguish them from simple comments, as I did in the emacs example.

I don't need this feature in GAMS Studio since I program in emacs, but having this in GAMS Studio would create a standard for code section and prevent me from fighting with co-authors who would not see the point of writing comments like this and would break my flow.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions