-
Notifications
You must be signed in to change notification settings - Fork 1
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
Remove the global AUXILIARY_EVENT_TX
and use tracing
#80
Conversation
pub(crate) fn did_close( | ||
params: DidCloseTextDocumentParams, | ||
state: &mut WorldState, | ||
auxiliary_event_tx: &AuxiliaryEventSender, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any LSP request/notification that needs to spawn a blocking task should add a auxiliary_event_tx
argument that is passed through from the top level handle_event()
It can then call things like auxiliary_event_tx.spawn_blocking_task()
This comment was marked as outdated.
This comment was marked as outdated.
6407db9
to
608e9da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what kind of objects we'll send around to spawn tasks but we can figure this out when we get there.
AUXILIARY_EVENT_TX
AUXILIARY_EVENT_TX
and use tracing
That way all you have to do to spawn a blocking task from a request handler is pass `auxiliary_event_tx` to it
a0bb387
to
2677644
Compare
Closes #79
This is a first pass to completely remove
AUXILIARY_EVENT_TX
in favor of passing around state to accessauxiliary_event_tx
, owned byGlobalState
.Currently logging is tied up in auxiliary events, which results in a net loss for ergonomics when you want to log something, as you need to pass
auxiliary_event_tx
around to call itslog_error()
methods.#93 is a follow up to this PR that splits the log specific events out of this, instead hooking up a tracing subscriber for logging so you can use
tracing::error!()
as a free function anywhere in the LSP