Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In some cases, messages.removeAll() won't clear all shown messages. #110

Open
Cubik65536 opened this issue Aug 15, 2024 · 2 comments
Open
Labels
question Further information is requested

Comments

@Cubik65536
Copy link

Cubik65536 commented Aug 15, 2024

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 the CodeEditor.

When there's an error thrown, messages.insert is used to add all error messages to the messages: 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 the messages 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: iXORTech/Typstify#5

@mchakravarty
Copy link
Owner

mchakravarty commented Aug 19, 2024

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.

@Cubik65536
Copy link
Author

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 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.

I haven't and I will take a look at it then.

@mchakravarty mchakravarty added the question Further information is requested label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants