lexical-lsp / lexical

Lexical is a next-generation elixir language server
776 stars 77 forks source link

Improved store error handling #737

Closed scohen closed 1 month ago

scohen commented 1 month ago

The store has a variety of states, and can return errors when it is not enabled. In light of this, we should return ok tuples when it is successful to keep the api consistent and make callers aware that they need to handle errors.

In addition, if loading / enabling takes a while, the store can time out when it's being queried, so unless it's enabled, queries will return empty results, and the enabled check uses persistent term.

Fixes #732

scohen commented 1 month ago

@scottming this should address the timeout issues you were seeing.