# Folding all levels of code

**URL:** <https://discuss.codemirror.net/t/folding-all-levels-of-code/8426>\
**Category:** v6\
**Created:** [July 3, 2024, 3:31pm UTC](https://discuss.codemirror.net/t/folding-all-levels-of-code/8426 "2024-07-03T15:31:35Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![bpstrngr](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/bpstrngr/32/4715_2.png) [@bpstrngr](https://discuss.codemirror.net/u/bpstrngr)\
**Post date:** [January 8, 2025, 6:28am UTC](https://discuss.codemirror.net/t/folding-all-levels-of-code/8426/5 "2025-01-08T06:28:37Z")

</div>

It seems to be related to the rendered range being limited for performance reasons, and the effects not affecting invisible ones. Based on discussions [here](https://discuss.codemirror.net/t/folding-functions/4189/18) and [here](https://discuss.codemirror.net/t/full-document-parsing/5440/4) an `ensureSyntaxTree(state,doc.length,5000);view.dispatch({});` should then get the iteration pass through the initial range limit, but it isn’t making a difference for me. I’m on @codemirror/language v6.10.8 and state v6.4.1, view v6.33.0.

---

_[View the full topic](https://discuss.codemirror.net/t/folding-all-levels-of-code/8426)._
