vscode-better-folding icon indicating copy to clipboard operation
vscode-better-folding copied to clipboard

C++ / HLSL : no folding for #ifdef ... #endif or #if defined(...) ... #endif blocks

Open Skylark13 opened this issue 1 year ago • 0 comments

Describe the bug

Hello, great extension, I really like it. However, compared to the built-in folding in vscode, when the extension is installed and enabled we cannot fold blocks delimited by preprocessor directives. The built-in folding doesn't work well with nested blocks which is why I tried this extension -- it works a lot better on functions and bracketed scopes, but these blocks stop working altogether.

To Reproduce

I have tested in both C++ and HLSL files.

#define TEST
#if defined(TEST)
// some code here
#endif

#ifdef TEST
// some code here
#endif

#if 0
// some disabled code here
#endif

Expected behavior The blocks in the examples above would have folding arrows and we would be able to fold them.

Screenshots Without this extension installed:

image

With this extension installed:

image

(line 80 should have a folding arrow)

Desktop (please complete the following information):

  • OS: Windows 11
  • vscode version: 1.88.1
  • Better Folding extension version: v0.5.1

Additional context

Skylark13 avatar Apr 17 '24 18:04 Skylark13