Add availableCommands to New Session #170
yordis
started this conversation in
Protocol Suggestions
Replies: 1 comment 1 reply
-
|
hi, the reason for this is that for many clients, available commands can also include loading a bunch of files within the project, which can take some amount of time. Adding this to session new would also be a breaking change in a sense because clients that don't know about the field wouldn't read it, and then they also wouldn't receive a list of commands later if the notification wasn't sent. We can revisit for a v2 change. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Following the slash commands spec, I implemented this:
What Went Wrong
The notification arrived BEFORE the response:
Zed editor:
Result: Slash commands never appeared in the UI.
My Fix
Using
setImmediate()to defer the notification until after the response is sent:Now the order is correct. But this is very confusing, and it feels like a hack.
I feel that we should send the
availableCommandsas part ofsession/newBeta Was this translation helpful? Give feedback.
All reactions