When making the document slightly smaller, the fold icons that were missing in the large document pop in after a second or so. Perhaps there is some sort of parse timeout for the initial load?
The fold icons work fine when pasting the large document into the editor.
Here’s a minimal reproduction of the issue using basicSetup and json language that shows the large document (left) and smaller document (right).
Yes, this is related to the parser not having found the end of the node. It would be bad to provide folding for nodes that we don’t know the extent of, since there’s no meaningful place to end the fold. As such, the fold system ignores partially parsed nodes. This is working as intended.
view = new EditorView({ ... });
forceParsing(view, 9e6, 100));
I increased the max upTo but kept the timeout at the default 100 ms so that it would get further on better hardware. Hopefully I’m understanding the function correctly!