Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#if and #endif macros folding cannot be done when the code were not intended! #69935

Closed
konosubakonoakua opened this issue Mar 7, 2019 · 4 comments
Labels
editor-folding Editor code folding issues

Comments

@konosubakonoakua
Copy link

Just like this
cannot fold
after intended:
can fold but with tab added
HOW CAN I FOLD THE MACRO WITHOUT INTENDING THE CODE?

@vscodebot
Copy link

vscodebot bot commented Mar 7, 2019

@vscodebot vscodebot bot added the editor-folding Editor code folding issues label Mar 7, 2019
@gjsjohnmurray
Copy link
Contributor

I think this article may explain what you're seeing:

Folding ranges are by default evaluated based on the indentation of lines. A folding range starts when a line has a smaller indent than one or more following lines, and ends when there is a line with the same or smaller indent.

Since the 1.22 release, folding ranges can also be computed based on syntax tokens of the editor's configured language. The following languages already provide syntax aware folding:

Markdown, HTML, CSS, LESS, SCSS and JSON

What language is your file being handled as?

@konosubakonoakua
Copy link
Author

I think this article may explain what you're seeing:

Folding ranges are by default evaluated based on the indentation of lines. A folding range starts when a line has a smaller indent than one or more following lines, and ends when there is a line with the same or smaller indent.
Since the 1.22 release, folding ranges can also be computed based on syntax tokens of the editor's configured language. The following languages already provide syntax aware folding:

Markdown, HTML, CSS, LESS, SCSS and JSON

What language is your file being handled as?

thanks for your reply, i'm using pure c in my project.

@gjsjohnmurray
Copy link
Contributor

So your issue is probably a duplicate of #66404. That has been closed with a reference to microsoft/vscode-cpptools#407. Unless the Language Server VSCode is using for your C files gets enhanced to implement a FoldingRangeProvider the best you can expect from VSCode is indent-based folding.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-folding Editor code folding issues
Projects
None yet
Development

No branches or pull requests

2 participants