Rework message handling logic - #32
Merged
Merged
Conversation
tomgeorge
force-pushed
the
chore/rpc
branch
2 times, most recently
from
August 27, 2025 15:12
eeaa145 to
ab950f6
Compare
The current implementation handles server messages in various different places. The sidebar does a lot of it. There are also many levels of `send_message`, `send_request`, `send_chat_message`-type methods that all do kind-of the same thing and (IMO) redundant and confusing. - add `.deps` to gitignore. - remove `deps` from git history - remove the `EcaServerStatus` command and the corresponding server status functionality. I don't think it adds anything and makes the server more complex. We could always add it back in. - remove `rpc.lua`, all of that functionality lives in `server.lua` now. - remove `eca.status_bar` - schedule some functions when we are in a fast event context, used in logging and in UI functions that change the state of a buffer, for example - server has `on_start`, `on_initialized`, `on_stop` callbacks - `server:stop()` sends a `shutdown` and `exit` request to ECA, or sends SIGTERM - `server:start()` uses `vim.system` instead of `jobstart` and `chan_send` - all message handling is done in `server.on_stdout()` which can delegate to other handlers - pathfinder can be injected into the server constructor - `message_handler.lua` parses incoming message from the server - `handle_content` still calls out to sidebar but that will be refactored out later - add tests
ericdallo
reviewed
Aug 27, 2025
| @@ -1 +1,2 @@ | |||
| deps/ No newline at end of file | |||
| deps/ | |||
| .eca/ | |||
Member
There was a problem hiding this comment.
Curious why excluding a local eca folder, I believe most of config could just go at ~/.config/eca/config.json?
Member
Author
There was a problem hiding this comment.
I use a local .eca configuration file
joaopluigi
approved these changes
Aug 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current implementation handles server messages in various different
places. The sidebar does a lot of it. There are also many levels of
send_message,send_request,send_chat_message-type methods thatall do kind-of the same thing and (IMO) redundant and confusing.
.depsto gitignore.depsfrom git historyEcaServerStatuscommand and the corresponding serverstatus functionality. I don't think it adds anything and makes the
server more complex. We could always add it back in.
rpc.lua, all of that functionality lives inserver.luanow.eca.status_barlogging and in UI functions that change the state of a buffer, for
example
on_start,on_initialized,on_stopcallbacksserver:stop()sends ashutdownandexitrequest to ECA, or sendsSIGTERM
server:start()usesvim.systeminstead ofjobstartandchan_sendserver.on_stdout()which candelegate to other handlers
message_handler.luaparses incoming message from the serverhandle_contentstill calls out to sidebar but that will berefactored out later