eclipse / lsp4e

Language Server Protocol support in Eclipse IDE
Eclipse Public License 2.0
61 stars 54 forks source link

Folding reconciler is not invoked when document changes #925

Closed ghentschke closed 6 months ago

ghentschke commented 6 months ago

When editing code in a LS backed generic text editor, the folding reconciler is not working as expected. As a user I would expect that the folding reconciler would be invoked while editing the code.

Example: adding new if clause, no folding annotation has been added: image

I looked into the LSPFoldingReconcilingStrategy and wondered why the reconcile method does nothing:

https://github.com/eclipse/lsp4e/blob/20e882682eb3e7a748f80e9814243c9578ff390f/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/folding/LSPFoldingReconcilingStrategy.java#L311

When calling the reconcile(IRegion subRegion) in:

    @Override
    public void reconcile(DirtyRegion dirtyRegion, IRegion partition) {
        reconcile(dirtyRegion);
    }

...then it works: image