Skip to content

Commit 1ffc7dd

Browse files
committed
added custom option for enabling event tracing
It's turned off by default. With tracing on, the performance slows down noticeably while you are typing, so it's something that should only be enabled when debugging the plugin.
1 parent f700431 commit 1ffc7dd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cody.el

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ Sends this flag as part of the agent extension configuration."
157157
:group 'cody-dev
158158
:type 'boolean)
159159

160+
(defcustom cody-enable-event-tracing nil
161+
"Non-nil to enable every agent to have an events buffer.
162+
The events buffer can be reached via `cody-dashboard' and has a
163+
trace of all events that are sent over the jsonrpc channel."
164+
:group 'cody-dev
165+
:type 'boolean)
166+
160167
(defcustom cody-panic-on-doc-desync nil
161168
"Non-nil to ask the Agent to panic if we discover it is desynced.
162169
De-syncing is when the Agent's copy of a document is out of sync with
@@ -736,8 +743,9 @@ Return value is a `jsonrpc-process-connection'."
736743
:request-dispatcher #'cody--request-dispatcher
737744
:process process)))
738745
(setf (cody-workspace-status workspace) 'connected)
739-
(setf (jsonrpc--events-buffer connection) events-buffer)
740-
(setf (cody-workspace-events-buffer workspace) events-buffer)
746+
(when cody-enable-event-tracing
747+
(setf (jsonrpc--events-buffer connection) events-buffer)
748+
(setf (cody-workspace-events-buffer workspace) events-buffer))
741749
(setf (cody-workspace-stderr-buffer workspace)
742750
(jsonrpc-stderr-buffer connection))
743751
connection))

0 commit comments

Comments
 (0)