Replies: 3 comments 8 replies
-
See if this helps:
|
Beta Was this translation helpful? Give feedback.
-
One disadvantage of using Advice on the method can make it work ok, but I don't think I am the only man need this, so, maybe a lighter way is needed. (defvar eglot-log-event-p nil)
(defun jsonrpc--log-event$toggle-event-log (f &rest args)
(when (and eglot-log-event-p
(ignore-errors
(eq (type-of (car args)) 'eglot-lsp-server)))
(apply f args)))
(advice-add #'jsonrpc--log-event :around #'jsonrpc--log-event$toggle-event-log)
;; Toggle:
(defun im/toggle-eglot-event-log ()
(interactive)
(setq eglot-log-event-p (not eglot-log-event-p))
(message "EGLOG event log is current: %s"
(if eglot-log-event-p "ON" "OFF"))) Thanks for your amazing work. |
Beta Was this translation helpful? Give feedback.
-
Yuan Fu ***@***.***> writes:
I would explain that in the doctoring. I just set the variable and was
surprised that it has no effect.
Sounds reasonable. I'll make the change unless you beat me to it with a
PR. You've got a copyright assignment, don't you?
João
|
Beta Was this translation helpful? Give feedback.
-
I found
eglot
sometimes slower thanlsp-mode
when I edit Java or C# file.The completions always delay about 1 seconds or more after every type, but in
lsp-mode
it's not.I'm puzzled by this, and at last I found, it's the event-log which is turned on by default, that cause the issue.
There is no convenient way to turn off the event-log, so I have to advice the function, like this:
And then the performance improvement is huge, completions popup almost no delay after type.
I don't think it's nessasary to alway keep event-log on, but is there any way to turn it off conveniently?
Or is it necessary to add options to give users to choose whether to turn on the event-log?
Beta Was this translation helpful? Give feedback.
All reactions