From 19d8085b762161ef4e54997acf43b87a535accb4 Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Sat, 13 Nov 2021 02:39:59 -0800 Subject: [PATCH] Fix issues; severity not set in textdocument/publishdiagnostics * eglot.el (eglot-handle-notification): Handle severity not set. GitHub-reference: https://github.com/joaotavora/eglot/issues/755 GitHub-reference: https://github.com/joaotavora/eglot/issues/401 --- lisp/progmodes/eglot.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index bf9cf25c33b..d8890209129 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1,6 +1,6 @@ ;;; eglot.el --- Client for Language Server Protocol (LSP) servers -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2020 Free Software Foundation, Inc. +;; Copyright (C) 2018-2021 Free Software Foundation, Inc. ;; Version: 1.7 ;; Author: João Távora @@ -1603,7 +1603,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.") :key #'eglot--major-mode) (and eglot-extend-to-xref buffer-file-name - (gethash (expand-file-name buffer-file-name) + (gethash (expand-file-name buffer-file-name) eglot--servers-by-xrefed-file))))) (defun eglot--current-server-or-lose () @@ -1808,7 +1808,8 @@ COMMAND is a symbol naming the command." (point-at-eol (1+ (plist-get (plist-get range :end) :line))))))) (eglot--make-diag (current-buffer) beg end - (cond ((<= sev 1) 'eglot-error) + (cond ((null sev) 'eglot-error) + ((<= sev 1) 'eglot-error) ((= sev 2) 'eglot-warning) (t 'eglot-note)) message `((eglot-lsp-diag . ,diag-spec))))) -- 2.39.5