diff options
| author | João Távora | 2023-04-07 23:00:44 +0100 |
|---|---|---|
| committer | João Távora | 2023-04-07 23:00:44 +0100 |
| commit | 9848ae17161828190cc0ba31e89ae54a2f08a2ef (patch) | |
| tree | 757a1b94a4dc1a0f2619eedbd6fe717ce25dd010 | |
| parent | cc288a0e331d09e3e0aebcb83769a513ecad236f (diff) | |
| download | emacs-9848ae17161828190cc0ba31e89ae54a2f08a2ef.tar.gz emacs-9848ae17161828190cc0ba31e89ae54a2f08a2ef.zip | |
Eglot: fix problems after changes to eglot-imenu (bug#62718)
* lisp/progmodes/eglot.el (eglot--imenu-SymbolInformation)
(eglot--imenu-DocumentSymbol): Fix.
| -rw-r--r-- | lisp/progmodes/eglot.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 99b3925f05f..6134ab9150c 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el | |||
| @@ -3247,7 +3247,8 @@ for which LSP on-type-formatting should be requested." | |||
| 3247 | (let ((elems (mapcar | 3247 | (let ((elems (mapcar |
| 3248 | (eglot--lambda ((SymbolInformation) kind name location) | 3248 | (eglot--lambda ((SymbolInformation) kind name location) |
| 3249 | (let ((reg (eglot--range-region | 3249 | (let ((reg (eglot--range-region |
| 3250 | (plist-get location :range)))) | 3250 | (plist-get location :range))) |
| 3251 | (kind (alist-get kind eglot--symbol-kind-names))) | ||
| 3251 | (cons (propertize name | 3252 | (cons (propertize name |
| 3252 | 'breadcrumb-region reg | 3253 | 'breadcrumb-region reg |
| 3253 | 'breadcrumb-kind kind) | 3254 | 'breadcrumb-kind kind) |
| @@ -3262,13 +3263,14 @@ for which LSP on-type-formatting should be requested." | |||
| 3262 | "Compute `imenu--index-alist' for RES vector of DocumentSymbol." | 3263 | "Compute `imenu--index-alist' for RES vector of DocumentSymbol." |
| 3263 | (cl-labels ((dfs (&key name children range kind &allow-other-keys) | 3264 | (cl-labels ((dfs (&key name children range kind &allow-other-keys) |
| 3264 | (let* ((reg (eglot--range-region range)) | 3265 | (let* ((reg (eglot--range-region range)) |
| 3266 | (kind (alist-get kind eglot--symbol-kind-names)) | ||
| 3265 | (name (propertize name | 3267 | (name (propertize name |
| 3266 | 'breadcrumb-region reg | 3268 | 'breadcrumb-region reg |
| 3267 | 'breadcrumb-kind kind))) | 3269 | 'breadcrumb-kind kind))) |
| 3268 | (if children | 3270 | (if (seq-empty-p children) |
| 3269 | (cons name | 3271 | (cons name (car reg)) |
| 3270 | (mapcar (lambda (c) (apply #'dfs c)) children)) | 3272 | (cons name |
| 3271 | (cons name (car reg)))))) | 3273 | (mapcar (lambda (c) (apply #'dfs c)) children)))))) |
| 3272 | (mapcar (lambda (s) (apply #'dfs s)) res))) | 3274 | (mapcar (lambda (s) (apply #'dfs s)) res))) |
| 3273 | 3275 | ||
| 3274 | (defun eglot-imenu () | 3276 | (defun eglot-imenu () |