Add support for regions

Issue #12 on hold
Sebastian Klatte created an issue

Possibility to fold and unfold regions would be a plus!

Comments (4)

  1. Christopher Wosinski repo owner

    Visual Studio Code has currently no support for code folding. But this will change very soon. OmniPascal will support this new feature approximately four weeks later - May be even earlier but I don't like to promise anything now.

  2. Jan Felix Langenbach

    I want to add, that (at least of the time I’m writing this) indentation based and tag based region folding don’t interfere at all. Fixing this issue is as simple as adding

    "configuration": "./language-configuration.json"
    

    to the objectpascal language object at contributes.languages in package.json with a language-configuration.json file like this:

    {
        "comments": {
            "blockComment": [
                "{",
                "}"
            ],
            "lineComment": "//"
        },
        "folding": {
            "markers": {
                "start": "^\\s*{\\$[Rr][Ee][Gg][Ii][Oo][Nn]\\b.*",
                "end": "^\\s*{\\$[Ee][Nn][Dd][Rr][Ee][Gg][Ii][Oo][Nn]\\b.*"
            }
        }
    }
    

    This would add support for the {$REGION} and {$ENDREGION} directives to be automatically recognized as region specifiers in VSCode.

  3. Log in to comment