Skip to content

Commit

Permalink
Merge pull request #36 from sourcegraph/stevey/day-1-bug-fixes
Browse files Browse the repository at this point in the history
Stevey/day 1 bug fixes
  • Loading branch information
dominiccooney authored Jul 29, 2024
2 parents d0717de + 1ffc7dd commit 11fde0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 5 additions & 3 deletions cody-dashboard.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ Argument ERROR-COUNT is the number of error or unconnected workspaces."
(cody--dashboard-insert-header "Global Info")
(insert "\n")
(cody--dashboard-insert-field " Cody Global Mode"
(if cody--global-mode "Enabled" "Disabled")
(if cody--global-mode 'cody-dashboard-status-success
'cody-dashboard-status-error))
(if cody--global-mode "Enabled" "Disabled"))
(cody--dashboard-insert-field " Number of Cody Workspaces"
(number-to-string (hash-table-count cody-workspaces)))
(cody--dashboard-insert-field " Active Workspaces"
Expand All @@ -127,6 +125,10 @@ Argument ERROR-COUNT is the number of error or unconnected workspaces."
(progn
(cody--dashboard-insert-field
" Name" (cody--server-info-name server-info))
(cody--dashboard-insert-field
" Type" (if cody-use-remote-agent
(format "remote on port %s" cody-remote-agent-port)
"local"))

(cody--dashboard-insert-field
" Authenticated"
Expand Down
14 changes: 11 additions & 3 deletions cody.el
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ Sends this flag as part of the agent extension configuration."
:group 'cody-dev
:type 'boolean)

(defcustom cody-enable-event-tracing nil
"Non-nil to enable every agent to have an events buffer.
The events buffer can be reached via `cody-dashboard' and has a
trace of all events that are sent over the jsonrpc channel."
:group 'cody-dev
:type 'boolean)

(defcustom cody-panic-on-doc-desync nil
"Non-nil to ask the Agent to panic if we discover it is desynced.
De-syncing is when the Agent's copy of a document is out of sync with
Expand Down Expand Up @@ -736,8 +743,9 @@ Return value is a `jsonrpc-process-connection'."
:request-dispatcher #'cody--request-dispatcher
:process process)))
(setf (cody-workspace-status workspace) 'connected)
(setf (jsonrpc--events-buffer connection) events-buffer)
(setf (cody-workspace-events-buffer workspace) events-buffer)
(when cody-enable-event-tracing
(setf (jsonrpc--events-buffer connection) events-buffer)
(setf (cody-workspace-events-buffer workspace) events-buffer))
(setf (cody-workspace-stderr-buffer workspace)
(jsonrpc-stderr-buffer connection))
connection))
Expand Down Expand Up @@ -1324,7 +1332,7 @@ Installed on `post-command-hook'."
;; Have a new request replace any pending request.
(when cody--post-command-debounce-timer
(cancel-timer cody--post-command-debounce-timer))
(run-with-idle-timer 0 nil #'cody--handle-selection-change))
(run-with-idle-timer 0.1 nil #'cody--handle-selection-change))
(error (cody--log "Error in `cody--post-command': %s: %s"
buffer-file-name err))))

Expand Down

0 comments on commit 11fde0d

Please sign in to comment.