Skip to content

Rework message handling logic - #32

Merged
tomgeorge merged 1 commit into
editor-code-assistant:mainfrom
tomgeorge:chore/rpc
Aug 27, 2025
Merged

Rework message handling logic#32
tomgeorge merged 1 commit into
editor-code-assistant:mainfrom
tomgeorge:chore/rpc

Conversation

@tomgeorge

Copy link
Copy Markdown
Member

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

@tomgeorge
tomgeorge force-pushed the chore/rpc branch 2 times, most recently from eeaa145 to ab950f6 Compare August 27, 2025 15:12
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
Comment thread .gitignore
@@ -1 +1,2 @@
deps/ No newline at end of file
deps/
.eca/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why excluding a local eca folder, I believe most of config could just go at ~/.config/eca/config.json?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use a local .eca configuration file

@tomgeorge
tomgeorge requested a review from joaopluigi August 27, 2025 15:21
@tomgeorge
tomgeorge merged commit 1d28662 into editor-code-assistant:main Aug 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants