when using :tools (lsp +eglot) dap-mode lsp-mode and lsp-java are being installed
How to use eglot over TRAMP and lsp-mode on local files?
You might need to write some elisp to check if the buffer is using tramp and then activate either eglot or lsp based on that info and then have that as a hook in whatever major mode(s) you're using. I only use eglot, so I don't know how well the two coexist in any capacity, but it sounds like an interesting project.
More on reddit.comanaconda-mode activates despite using (lsp +eglot)
LSP (lsp-mode or eglot) + TRAMP (to work server) + pyenv + pyenv-virtualenv + WSL2
Hi all! I have this in my doom config init.el
(lsp +eglot
+peek)
Basically, I've installed lsp-mode and eglot at the same time. The reason is that eglot works over TRAMP, while lsp-mode not. Also, I use a lot lsp-ltex and it depends directly of lsp-mode
My question is: how could I disable eglot when using my local files and let that lsp-mode takes charge of everything, BUT reverse the roles when I'm in a remote file over TRAMP and shutdown lsp-mode and make eglot the lsp manager?
Is it so hard to do or not?
Thanks.
You might need to write some elisp to check if the buffer is using tramp and then activate either eglot or lsp based on that info and then have that as a hook in whatever major mode(s) you're using. I only use eglot, so I don't know how well the two coexist in any capacity, but it sounds like an interesting project.
If you are using own config. I think this would be trivial, a hook on tramp mode solves everything, as both LSP-mode and eglot can work locally on buffer, they can coexist perfectly.
But with doom, if you want all the LSP integration with all the doom modules and it just seamlessly and dynamically choose between two LSP clients, I think this is hard. Unless you don’t use doom’s LSP module and write your own module. This is the price of using a configuration framework, powerful but less flexible.
I think you can use lsp module with lsp-mode and use your own eglot configuration in tramp mode, since lsp-mode can’t work in tramp mode, I suppose doom’s LSP configuration won’t conflict with your configuration for eglot if eglot is only activated in tramp mode.
through little bit of research i have found a way to make Emacs faster with lsp and eglot none of this are my code i just found it from browsing on reddit
(fset #'jsonrpc--log-event #'ignore) remove laggy typing it probably reduces chatty json from lsp to eglot i guess
(setq eglot-events-buffer-size 0) disabling event logging in eglot
(setq eglot-sync-connect nil) disabling elgot freeze the UI for up to 3s when you open file maybe large one
install gcmh package to increase the gc value when necessary and decrease it. nice package btw
(add-hook 'focus-out-hook 'garbage-collect) optional, if you don't want to use gcmh package
(setq eglot-connect-timeout nil) optional "my code actually"
set this values on company package or
(setq company-idle-delay 0) how long to wait for company mode to wait after it got completion obviously you don't want to wait so just set it to 0
(setq company-minimum-prefix-length 1) how many characters you want to type before popping up the completion UI obviously 1 right
if there is anything that i am missing pls let me know guys, am new to Emacs i want to learn from you all. i would love to see your config too to learn how to configure mine too