[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?
From: |
Augusto Stoffel |
Subject: |
bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally? |
Date: |
Wed, 28 Apr 2021 09:00:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Here is a patch setting `completion-category-defaults'.
>From e9d877c9c7203ce999a935cdbc36c619255cf63c Mon Sep 17 00:00:00 2001
From: Augusto Stoffel <arstoffel@gmail.com>
Date: Wed, 28 Apr 2021 08:50:10 +0200
Subject: [PATCH] Add a completion-category-defaults entry
Setting `completion-styles' buffer locally is harder to customize and
can break some completion UIs
* eglot.el: Add a completion-category-defaults entry, if applicable.
* eglot.el (eglot--managed-mode): Don't set `completion-styles'
buffer-locally.
* eglot.el (eglot-completion-at-point): Add style metadata to
completion table.
---
eglot.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/eglot.el b/eglot.el
index 3348054..122a76b 100644
--- a/eglot.el
+++ b/eglot.el
@@ -222,6 +222,10 @@ let the buffer grow forever."
:type '(choice (const :tag "Don't show confirmation prompt" nil)
(symbol :tag "Show confirmation prompt" 'confirm)))
+;; Customizable via `completion-category-overrides'.
+(when (assoc 'flex completion-styles-alist)
+ (add-to-list 'completion-category-defaults '(eglot (styles flex basic))))
+
;;; Constants
;;;
@@ -1421,8 +1425,6 @@ Use `eglot-managed-p' to determine if current buffer is
managed.")
(eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend))
(eglot--setq-saving company-backends '(company-capf))
(eglot--setq-saving company-tooltip-align-annotations t)
- (when (assoc 'flex completion-styles-alist)
- (eglot--setq-saving completion-styles '(flex basic)))
(unless (eglot--stay-out-of-p 'imenu)
(add-function :before-until (local 'imenu-create-index-function)
#'eglot-imenu))
@@ -2166,7 +2168,8 @@ is not active."
(get-text-property 0 'eglot--lsp-item c)
:sortText)
"")))))
- (metadata `(metadata . ((display-sort-function .
,sort-completions))))
+ (metadata `(metadata (category . eglot)
+ (display-sort-function . ,sort-completions)))
resp items (cached-proxies :none)
(proxies
(lambda ()
--
2.30.2
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, Augusto Stoffel, 2021/04/27
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/27
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, Stefan Monnier, 2021/04/27
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/27
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, Stefan Monnier, 2021/04/27
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/27
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, Stefan Monnier, 2021/04/27
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?,
Augusto Stoffel <=
- bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/28
bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, Drew Adams, 2021/04/27
- bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/27
- bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, Drew Adams, 2021/04/27
- bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/27
- bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/27
- bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, Drew Adams, 2021/04/28
- bug#48073: [External] : bug#48073: 27.2; [Eglot] Don't bind `completion-styles' buffer locally?, João Távora, 2021/04/28