[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add `eglot-automatic-inlay-hints` customizable variable
From: |
João Távora |
Subject: |
Re: [PATCH] Add `eglot-automatic-inlay-hints` customizable variable |
Date: |
Fri, 28 Apr 2023 21:43:45 +0100 |
On Fri, Apr 28, 2023 at 9:25 PM Brennan Vincent <brennan@umanwizard.com> wrote:
> I felt it was wasteful because then entering eglot-managed-mode will cause
> eglot-inlay-hints-mode to be turned on, and then immediately turned off.
Very few cycles are wasted. You're basically adding something
to the jit-lock-functions hook, then removing it. No slow things
like fontification or LSP requests happen.
> > Also a defcustom for buffer-local behaviour isn't really very
> > standard. But you can use if like that, of course. In which case, can't
> > you use the existing eglot-ignored-server-capabilities like that?
>
> I'm not sure I understand the suggestion. Currently if I add "Inlay Hints" to
> that variable, then it is impossible to use them in any buffer. I don't know
> of
> a way to set this variable such that it only takes effect in a subset of
> buffers.
Yes, but to do per-buffer things you normally use add-hook and
thinkg like setq-local. That's what I suppose you want to do
with your proposed '(defcustom eglot-automatic-inlay-hints t)'
right?
I'm just saying that you can do that directly with
eglot-ignored-server-capabilities.
Just:
(add-hook 'my-favourite-major-mode-hook
(lambda () (setq-local eglot-ignored-server-capabilities
'(:inlayHintsProvider))))
or something like that.
João