================
@@ -220,6 +220,24 @@ getFoldingRanges(const std::string &Code, bool
LineFoldingOnly) {
auto EndPosition = [&](const Token &T) {
return offsetToPosition(Code, EndOffset(T));
};
+
+ // Preprocessor directives
+ auto PPRanges = pairDirectiveRanges(DirectiveStructure, OrigStream);
----------------
HighCommander4 wrote:
Could you add a testcase that has a nested conditional in both branches of an
outer conditional, and checks that both nested conditionals get a folding
range? (It would be easy to get this wrong by passing `ParseableStream` rather
than `OrigStream` here, which would have the effect of only processing the
branch of the outer conditional which we heuristically decided to treat as
active.)
https://github.com/llvm/llvm-project/pull/140959
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits