Open Cubik65536 opened 4 weeks ago
That's weird. Maybe some views stay around while the underlying messages are already gone. It would definitely be helpful if you could find an example that reproduces the problem.
Generally, speaking have you had a look at the LanguageService
API (it's a protocol) that is part of the LanguageSupport
target. It uses Compose to asynchronously push error messages to the editor from underlying compiler tooling. (It also provides other facilities, such as autocompletion etc.) This is what I'm using in my own app to push diagnostics to the editor view and it seems to work fine.
That's weird. Maybe some views stay around while the underlying messages are already gone. It would definitely be helpful if you could find an example that reproduces the problem.
I'll continue to dig into this.
Generally, speaking have you had a look at the
LanguageService
API (it's a protocol) that is part of theLanguageSupport
target. It uses Compose to asynchronously push error messages to the editor from underlying compiler tooling. (It also provides other facilities, such as autocompletion etc.) This is what I'm using in my own app to push diagnostics to the editor view and it seems to work fine.
I haven't and I will take a look at it then.
In my app, I use
messages
to show compilation error. The code parser would throw an Error containing a list of Error instances, each of those contains information necessary to add error messages to theCodeEditor
.When there's an error thrown,
messages.insert
is used to add all error messages to themessages: Set<TextLocated<Message>>
state variable to show the error at the corresponding place on the editor view.However, sometimes,
messages.removeAll()
couldn't remove all error shown, even when themessages
set is already empty, some previously shown messages would stay.I couldn't reproduce this in the demo app, I will try to make it happen and update this issue accordingly.
Related: https://github.com/iXORTech/Typstify/issues/5