frostplexx / mason-bridge.nvim

Automatically register linters and formatters installed in mason.nvim
MIT License
32 stars 2 forks source link

Calling get_formatters() returns empty table if load_associations_async() isn't done yet #1

Closed TungstnBallon closed 5 months ago

TungstnBallon commented 5 months ago

Hi, thank you for this really useful plugin.

I did find a small bug: If load_associations_async is not done by the time get_formatters is called, you get an empty table, which is probably due to cached_associations not being set yet.

I worked around this by creating a blocking variant load_associations. IMHO it would be nice to let get_formatters block until a result is available (no idea how to do that), or to just add a configuration option.

frostplexx commented 5 months ago

Thank you for your feedback! I've pushed an updated to a new branch called fix_async where it waits for the cached_associations to load before it returns anything. Could you check if that solves your issues?

TungstnBallon commented 5 months ago

Yes! Thank you!