Comments (11)
Regarding the actual problem. I think lsp mode suffers from this problem too. It's not particularly hard to fix, I think. I'm actually thinking a hybrid scheme: Wait up to N seconds synchronously, then wait asynchrously.
The hard part here is eglot-ensure
: if you don't block until something happens you're not really "ensuring" anything, are you? It's a question of semantics though: i think we can say that we "ensured that we tried" :-)
from eglot.
Of course there could be some other interactions between different packages
No, I think I've seen slow server startup time mentioned somewhere already.
Could provide a smaller emacs -Q repo if that would help but I think the main challenge is compiling the server.
Yeah. For this rather put a dummy "sleep" somehwere in the invocation of any other server than spend time messing with Javaland. I will add kotlin to the README.md tho (or take your PR that does it).
from eglot.
I see similar slowness during the start of bash-language-server, so I don't think it is unique to that server. Although not that long, it blocks around 2-3 seconds when opening the first bash script that starts the server.
from eglot.
I will add kotlin to the README.md tho (or take your PR that does it).
I'll PR something for kotlin when I get some free time.
The hard part here is eglot-ensure: if you don't block until something happens you're not really "ensuring" anything, are you? It's a question of semantics though: i think we can say that we "ensured that we tried" :-)
Something like eglot-start-async or whatever would work for me but the naming was never too important for me anyways!
from eglot.
I've pushed a commit to fix this. Its failing some tests (and I don't know why exactly yet), so it's not ready to go to master.
However, I would appreciate it if you could give it some testing. eglot-sync-connect
is the new defcustom you should look to. Tell me if the docstring is legible (I didn't double-check those bits) and if you understand how it works. Then tell me if it did work like you wanted it to.
from eglot.
I think eglot-ensure with the latest commit (on your async branch) doesn't seem to connect anymore for me.
I'll describe it symptomatically as I didn't have enough time to do some digging. For most variations of eglot-sync-connect (even t ,don't quote me on t,), emacs will print out a message saying 'connected, eglot managing, ...' but the mode-line indicator doesn't change ([eglot:kotlin] for example is not added) (or something similar, I'm going off memory).
Completions/etc don't seem to be working either.
Given that aside, if it did work (eglot connecting everything), the asynchronous mechanism seems to be working well.
Switching back to the commit right before (without the new defcustom) produces the synchronous eglot-ensure that works for me (flymake providing diagnostics, completions working, etc).
If you point me to where I should be looking, maybe I can dig up more info for you.
As for the docstring,
(defcustom eglot-sync-connect 3
"Control blocking of LSP connection attempts.
If t, block as long as a . A positive
integer number means block for that many seconds, and then wait
for the connection in the background. nil has the same meaning
as 0."
:type '(choice (boolean :tag "Whether to inhibit autoreconnection")
(integer :tag "Number of seconds")))
If t, block as long as a .
I don't know what this means but I assumed it meant to just restore similar behavior to before.
nil has the same meaning as 0
I think I can guess the conclusion of nil == 0 but I think it would be clarifying to explain what 0 does (e.g. don't block at all). I assume that's the case but maybe someone else would be confused.
from eglot.
Thanks for the feedback. Seems there's still quite a bit of work to do.
You're right about the docstring, even if it's missing part of a sentence
from eglot.
@jojojames I've updated the branch. It's still failing tests when the suite runs non-interactively (have to check that). But you can try again and all the other problems (completion, etc) should be gone.
from eglot.
Thanks, works for me. Docstring is also ++.
from eglot.
Hey! Thanks for making this. I am a n00b at elisp. Is this the correct way to use eglot-sync-connect if I want no blocking at all?
(setq eglot-sync-connect 0)
(add-hook 'php-mode-hook 'eglot-ensure)
from eglot.
from eglot.
Related Issues (20)
- Spamming echo bar only java-mode
- gopls reporting is delayed when `flymake-no-changes-timeout` is set to nil HOT 1
- eglot causes emacsclient to exit immediately on first load HOT 7
- Eglot Panics When Combined with Electric Pair Local mode HOT 1
- `M-x package-install RET eglot RET` results in `https://elpa.gnu.org/packages/seq-2.23.tar: Not found` HOT 1
- eglot-completion-at-point deleting extra text beyond the completion boundaries HOT 4
- eglot--mode-line-format when jsonrpc.el v1.0.22 is installed HOT 4
- Future proofing eglot-connect-timeout for newest emacs HOT 2
- eglot jdt.ls completion add extra text HOT 6
- Inconsistent error report for Python checkers HOT 1
- eglot using pyright stopped working on [Mac OS, unknown invocation, missing logs] HOT 12
- Error fontifying hover info from Pyright when using `python-ts-mode` HOT 2
- Not working with typst-lsp: completion request always time out HOT 10
- Formatting parameters are not exposed HOT 1
- `language-id` not changing after the first file HOT 1
- tailwindcss language server support HOT 14
- didChangeWatchedFiles does not work recursively, LSP server goes out of sync for new directories HOT 4
- emacs crashes with segfault
- Avoiding invoking "error" in eglot-alternatives HOT 1
- Eglot throws error when eglot-ensure called HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eglot.