Skip to content

Commit

Permalink
Add convenience command lsp-metals-open-server-log
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceWarne authored and kurnevsky committed Oct 17, 2023
1 parent 31f5468 commit da7e54e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lsp-metals.el
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,16 @@ WORKSPACE is the workspace the client command was received from."
(interactive)
(lsp-send-execute-command "reset-workspace" ()))

(defun lsp-metals-open-server-log ()
"Open a buffer with the metals log for the current workspace."
(interactive)
(if-let ((root (lsp-workspace-root)))
(if-let* ((log-file (f-join (file-name-as-directory root) ".metals" "metals.log"))
((f-exists-p log-file)))
(progn (find-file log-file) (goto-char (point-max)))
(user-error "%s does not exist, are you in the right directory?" log-file))
(user-error "No LSP workspace is in effect")))

(lsp-defun lsp-metals--publish-decorations (workspace (&PublishDecorationsParams :uri :options))
"Handle the metals/publishDecorations extension notification.
WORKSPACE is the workspace the notification was received from."
Expand Down

0 comments on commit da7e54e

Please sign in to comment.