Linter that only refreshes on needsRefresh

I am compiling the editor content and want to display the results as Diagnostics inside the editor component. What I would like to do are text decorations (with gutter and tooltips) as defined for linters where the ranges are updated when the document changes instead of re-doing the linting. Essentially linters with the needsRefresh predicate and disabled refreshing on document changes. Is there an alternative to redoing most of whats already done in @codemirror/lint?

You should be able to use setDiagnostics to get something like this.

I can dispatch the TransactionSpec from setDiagnostics to add my Diagnostics. However, the Diagnostics disappear from my editor when the document changes. I tried to dispatch again after each document change with updateListener (and update the Ranges with forEachDiagnostic), but the Diagnostics will disappear instantly.

That’s not what I’m seeing when I try this. Such diagnostics stay in place and move with their associated content as the document is changed.

You’re right, there seems to be a conflict with another linter I added. Thank you!