[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 1.2 53c8f59 059/101: Handle case when diagnostic :character is ou
From: |
Christian Johansson |
Subject: |
[elpa] 1.2 53c8f59 059/101: Handle case when diagnostic :character is out of range |
Date: |
Thu, 29 Apr 2021 15:09:01 -0400 (EDT) |
tag: 1.2
commit 53c8f5980de1cfaa0a629451378ae0bed689f58b
Author: Michał K <k.michal@zoho.com>
Commit: Michał Krzywkowski <k.michal@zoho.com>
Handle case when diagnostic :character is out of range
* eglot.el (eglot-handle-notification): Don't error out when
flymake-diag-region returns nil.
---
eglot.el | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/eglot.el b/eglot.el
index 8014024..b25d8b9 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1080,14 +1080,21 @@ COMMAND is a symbol naming the command."
((`(,beg . ,end) (eglot--range-region range)))
;; Fallback to `flymake-diag-region' if server
;; botched the range
- (if (= beg end)
- (let* ((st (plist-get range :start))
- (diag-region
- (flymake-diag-region
- (current-buffer) (1+ (plist-get st :line))
- (plist-get st :character))))
- (setq beg (car diag-region)
- end (cdr diag-region))))
+ (when (= beg end)
+ (if-let* ((st (plist-get range :start))
+ (diag-region
+ (flymake-diag-region
+ (current-buffer) (1+ (plist-get st :line))
+ (plist-get st :character))))
+ (setq beg (car diag-region) end (cdr diag-region))
+ (eglot--widening
+ (goto-char (point-min))
+ (setq beg
+ (point-at-bol
+ (1+ (plist-get (plist-get range :start)
:line))))
+ (setq end
+ (point-at-eol
+ (1+ (plist-get (plist-get range :end)
:line)))))))
(eglot--make-diag (current-buffer) beg end
(cond ((<= sev 1) 'eglot-error)
((= sev 2) 'eglot-warning)
- [elpa] 1.2 6cbfdda 057/101: Make eglot-ignored-server-capabilites more user-friendly (#126), (continued)
- [elpa] 1.2 6cbfdda 057/101: Make eglot-ignored-server-capabilites more user-friendly (#126), Christian Johansson, 2021/04/29
- [elpa] 1.2 d54e494 046/101: Ignore extra keys in textDocument/publishDiagnostics (#81), Christian Johansson, 2021/04/29
- [elpa] 1.2 2d3c391 007/101: Close #48: be less verbose when using eglot-ensure, Christian Johansson, 2021/04/29
- [elpa] 1.2 9c2fd8c 002/101: Close #44: Robustify in the face of manual mode changes, Christian Johansson, 2021/04/29
- [elpa] 1.2 4d80eeb 015/101: Default eglot-handle-notifictiona|request must &allow-other-keys, Christian Johansson, 2021/04/29
- [elpa] 1.2 d2faf6d 001/101: Close #29: Implement workspace/didChangeConfiguration (#40), Christian Johansson, 2021/04/29
- [elpa] 1.2 5aea589 013/101: Close #58: Erase company-doc buffer in between doc requests, Christian Johansson, 2021/04/29
- [elpa] 1.2 5707785 024/101: * eglot.el (eglot-cquery): Capitalize docstring., Christian Johansson, 2021/04/29
- [elpa] 1.2 6067ec6 023/101: Minor fixes to test infrastructure, Christian Johansson, 2021/04/29
- [elpa] 1.2 13b8c61 040/101: Per #74: Don't error if server replies with empty hover message, Christian Johansson, 2021/04/29
- [elpa] 1.2 53c8f59 059/101: Handle case when diagnostic :character is out of range,
Christian Johansson <=
- [elpa] 1.2 1408860 052/101: Close #94: Prefer ccls over cquery for C/C++, Christian Johansson, 2021/04/29
- [elpa] 1.2 a1e8946 045/101: Close #80: Consider :triggerCharacters in company completion, Christian Johansson, 2021/04/29
- [elpa] 1.2 989647a 049/101: When exiting emacs, don't ask the user to confirm killing processes (#83), Christian Johansson, 2021/04/29
- [elpa] 1.2 ce9076d 047/101: Close #82: Correctly delete text before expanding snippet completions, Christian Johansson, 2021/04/29
- [elpa] 1.2 746505f 072/101: Require subr-x at compile time (#139), Christian Johansson, 2021/04/29
- [elpa] 1.2 eec30e3 070/101: Fix misspelling of "outstanding" (#74), Christian Johansson, 2021/04/29
- [elpa] 1.2 ff62057 071/101: Fix #138: accept deprecated field in SymbolInformation, Christian Johansson, 2021/04/29
- [elpa] 1.2 f317a7d 069/101: * eglot-tests.el: Disable eclipse connection tests., Christian Johansson, 2021/04/29
- [elpa] 1.2 ff92d67 073/101: Remove duplicates from imenu, Christian Johansson, 2021/04/29
- [elpa] 1.2 660d9e3 078/101: Slightly robustify test engine, Christian Johansson, 2021/04/29