Skip to content

Request: #pragma region folding support for C/C++ lexer #324

@DavidJCobb

Description

@DavidJCobb

The lexer for C, C++, C#, Java, and JavaScript is coded to recognize #region and #endregion. These are only supported in C#.

It'd be nice if the lexer could also recognize #pragma region and #pragma endregion for code folding in C/C++. MSVC ignores these pragmas so that they can be safely used for code folding, and Visual Studio and VSCode show them as foldable regions. GCC ignores them as well, explicitly for parity with VS(Code). The pragmas can be used bare, or any text can be placed after them (e.g. #pragma region Name of the region and #pragma endregion Name of the region, and the text need not match between a given start and a given end). Pragma-based regions can also be nested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cppCaused by the cpp lexer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions