From da7e54ed65f4e153c94b9c54689908dce142ef37 Mon Sep 17 00:00:00 2001 From: Laurence Warne Date: Thu, 12 Oct 2023 20:12:38 +0100 Subject: [PATCH] Add convenience command lsp-metals-open-server-log --- lsp-metals.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lsp-metals.el b/lsp-metals.el index a79920f..cb0676f 100644 --- a/lsp-metals.el +++ b/lsp-metals.el @@ -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."