Skip to content

Feature Request: Support C/C++ preprocessor directives (#if, #ifdef, #endif) #165

@setsuna-VL

Description

@setsuna-VL

Description

Blockman currently does not recognize C/C++ preprocessor directives like #if, #ifdef, #ifndef, #elif, #else, and #endif as block boundaries.

Example Code

#ifdef DEBUG
    void debugLog() {
        printf("Debug mode\n");
        // This whole block is not highlighted as a unit
    }
#endif

#if defined(WIN32)
    // Windows specific code
#elif defined(LINUX)
    // Linux specific code
#endif

Expected Behavior
The #if / #endif blocks should be highlighted as nested blocks, similar to how curly brackets {} are handled.

Use Case
This would be very helpful for:

Large codebases with many conditional compilation blocks
Embedded systems development
Cross-platform code with many #ifdef PLATFORM blocks
Environment

VS Code version: 1.113.0 (user setup)
Blockman version: v1.7.8

Thank you for this great extension!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions