Coder Social home page Coder Social logo

Comments (11)

joaotavora avatar joaotavora commented on September 27, 2024 1

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.

joaotavora avatar joaotavora commented on September 27, 2024

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.

terlar avatar terlar commented on September 27, 2024

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.

jojojames avatar jojojames commented on September 27, 2024

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.

joaotavora avatar joaotavora commented on September 27, 2024

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.

jojojames avatar jojojames commented on September 27, 2024

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.

joaotavora avatar joaotavora commented on September 27, 2024

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.

joaotavora avatar joaotavora commented on September 27, 2024

@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.

jojojames avatar jojojames commented on September 27, 2024

Thanks, works for me. Docstring is also ++.

from eglot.

nickyr avatar nickyr commented on September 27, 2024

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.

joaotavora avatar joaotavora commented on September 27, 2024

from eglot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.