<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/110390>110390</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clangd] Add folding ranges for #ifdef sections
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
torshepherd
</td>
</tr>
</table>
<pre>
Folding ranges (or whatever the corresponding LSP term is) allow users to 1. See the top line of the range as they scroll down stickily and 2. Fold entire ranges of code they don't care about
#ifdef and other preprocessor conditional blocks are well suited for this because 1. devs would benefit from seeing things like #ifdef __clang__ following their cursor when they're very far down in a large file, and 2. e. g. A Linux dev might want to collapse an entire #ifdef __WINDOWS__ section that's irrelevant to their work.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxUklGr6zYMgH-N8yJuSNymaR_y0O1QGFy2wXm4j8WxlcSrawXJadZ_P5z23G0QCMaW9OmTjIgfI2Knml9U81GYJU3EXSKWCecJ2RU9uWd3oeB8HIFNHFFA6SMxrJNJ-ECGNCFYYkaZKW7vvn_-CQn5Dl6UPoEJgVZYBFkgEdQlfCJuYYlmCD4i0LCdtwJgJB-eIJYpBHC0RpDk7c2HJ5joQJeQkQBj8oxfWDSAJYevWEdR6TaBNYxgelqSqs750zs_OBy2PJQmZJgZZyaLIsRgcwvJUzQB-kD2JpAzrBgCyOITOhgo9-wFerRmEcwNOXwIrLQEBz1GHHyCgekOgpiFpMnHUSD4G8JPguvVBhPH6xUGyoZeD9Ez2IVlM4xx60bplhEeyE8YDL-E-AgGguERYfABlf71Sw2WMJZwhu8-Ln9nMrj7cUqwmpiyf0shmFkQTPwy-B-mH7_9_vHHj8_rFQRtFgFpMknpVsAzY8DHO80LdSW-lYXrdu60O5kCu7rVbXNoqkNbTN3R2n2v9_XB9PrQm6oZqoO1umqw749GHwvf6Urvq5M-6l1dV23Znpq6rnSNTXs4tG6v9hXejQ9lCI97STwWXmTBrq6r3akqgukxyLa_WkdcYbtVWud15i4HfeuXUdS-Cl6S_Jsm-RS2xd-G4FTzAWeXh_u_Vc-z_innLUSKhUM3pTSL2p2Vvih9GX2alr60dFf6kmu8f99mpr_QJqUvG5kofXmjPzr9TwAAAP__96UwCA">