Skip to content

Commit

Permalink
Fix doctor client command when html is not passed.
Browse files Browse the repository at this point in the history
Metals doesn't always pass html argument. For instance, when bloop
process dies and metals shows message with open doctor request.
  • Loading branch information
kurnevsky committed May 8, 2024
1 parent 01060e9 commit fa4072c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lsp-metals.el
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,14 @@ for more information on the metals \"files-decode\" command."
"Generate doctor buffer name for the WORKSPACE."
(format "*Metals Doctor: %s*" (process-id (lsp--workspace-cmd-proc workspace))))

(defun lsp-metals--doctor-run (workspace html)
(defun lsp-metals--doctor-run (workspace &optional html?)
"Focus on a window displaying troubleshooting help from the Metals doctor.
HTML is the help contents.
WORKSPACE is the workspace the client command was received from."
(pop-to-buffer (lsp-metals--generate-doctor-buffer-name workspace))
(lsp-metals--render-html html))
(if (not html?)
(lsp-send-execute-command "doctor-run" ())
(pop-to-buffer (lsp-metals--generate-doctor-buffer-name workspace))
(lsp-metals--render-html html?)))

(defun lsp-metals--doctor-reload (workspace html)
"Reload the HTML contents of an open Doctor window, if any.
Expand Down

0 comments on commit fa4072c

Please sign in to comment.