Skip to content

Commit 11fde0d

Browse files
Merge pull request #36 from sourcegraph/stevey/day-1-bug-fixes
Stevey/day 1 bug fixes
2 parents d0717de + 1ffc7dd commit 11fde0d

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

cody-dashboard.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ Argument ERROR-COUNT is the number of error or unconnected workspaces."
106106
(cody--dashboard-insert-header "Global Info")
107107
(insert "\n")
108108
(cody--dashboard-insert-field " Cody Global Mode"
109-
(if cody--global-mode "Enabled" "Disabled")
110-
(if cody--global-mode 'cody-dashboard-status-success
111-
'cody-dashboard-status-error))
109+
(if cody--global-mode "Enabled" "Disabled"))
112110
(cody--dashboard-insert-field " Number of Cody Workspaces"
113111
(number-to-string (hash-table-count cody-workspaces)))
114112
(cody--dashboard-insert-field " Active Workspaces"
@@ -127,6 +125,10 @@ Argument ERROR-COUNT is the number of error or unconnected workspaces."
127125
(progn
128126
(cody--dashboard-insert-field
129127
" Name" (cody--server-info-name server-info))
128+
(cody--dashboard-insert-field
129+
" Type" (if cody-use-remote-agent
130+
(format "remote on port %s" cody-remote-agent-port)
131+
"local"))
130132

131133
(cody--dashboard-insert-field
132134
" Authenticated"

cody.el

Lines changed: 11 additions & 3 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))
@@ -1324,7 +1332,7 @@ Installed on `post-command-hook'."
13241332
;; Have a new request replace any pending request.
13251333
(when cody--post-command-debounce-timer
13261334
(cancel-timer cody--post-command-debounce-timer))
1327-
(run-with-idle-timer 0 nil #'cody--handle-selection-change))
1335+
(run-with-idle-timer 0.1 nil #'cody--handle-selection-change))
13281336
(error (cody--log "Error in `cody--post-command': %s: %s"
13291337
buffer-file-name err))))
13301338

0 commit comments

Comments
 (0)