Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird issues since updating to latest #353

Closed
mdbergmann opened this issue Nov 21, 2019 · 15 comments
Closed

Weird issues since updating to latest #353

mdbergmann opened this issue Nov 21, 2019 · 15 comments

Comments

@mdbergmann
Copy link

So, I'm not sure if this is an eglot issue.

I have updated all my elpa packages, which installed new version of eglot.
At the same time I have pulled the latest elixir-ls server from GitHub.

I can't really tell where the issue is but I see no doc window popup in Emacs and no auto completion.
Both of which was working before the update.

I see this in the 'Messages' buffer when eglot gets started:

error in process filter: doom-modeline-update-eglot: Symbol’s function definition is void: eglot-current-server
error in process filter: Symbol’s function definition is void: eglot-current-server

And this is eglot-event-buffer when I put the cursor to something in the source code.

server-reply (id:5) ERROR Thu Nov 21 16:11:09 2019:
(:error
 (:code -32000 :message "an exception was raised:\n    ** (UndefinedFunctionError) function nil.text/0 is undefined\n        nil.text()\n        (language_server) lib/language_server/server.ex:368: anonymous fn/4 in ElixirLS.LanguageServer.Server.handle_request/2\n        (language_server) lib/language_server/server.ex:442: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2")
 :id 5 :jsonrpc "2.0")

internal (id:5) ERROR Thu Nov 21 16:11:09 2019:
(:message "error ignored, status set (an exception was raised:\n    ** (UndefinedFunctionError) function nil.text/0 is undefined\n        nil.text()\n        (language_server) lib/language_server/server.ex:368: anonymous fn/4 in ElixirLS.LanguageServer.Server.handle_request/2\n        (language_server) lib/language_server/server.ex:442: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2)" :id 5 :error -32000)

I've tried both lsp-mode and eglot.
lsp-mode seems to working, at least for the doc window and auto completion.
That makes me think that the language-server might be OK?

Any ideas?

@joaotavora
Copy link
Owner

Any ideas?

Yes. You are likely using an outdated eglot, or you have stale .elc files.

How exactly you installing Eglot? Can you try with a Git version?

@mdbergmann
Copy link
Author

That's what I have in 'elpa':

~/.emacs.d/elpa (master ✘)✖✹✭ ᐅ l eglot-1.5 
total 480
drwxr-xr-x    6 mbergmann  staff   192B 17 Nov 14:44 .
drwxr-xr-x  163 mbergmann  staff   5,1K 21 Nov 15:39 ..
-rw-r--r--    1 mbergmann  staff   1,9K 17 Nov 14:44 eglot-autoloads.el
-rw-r--r--    1 mbergmann  staff   412B 17 Nov 14:44 eglot-pkg.el
-rw-r--r--    1 mbergmann  staff   118K 17 Nov 14:44 eglot.el
-rw-r--r--    1 mbergmann  staff   110K 17 Nov 14:44 eglot.elc

This all came in via elpa. It's possible that this is an old .elc. Not sure.
But it seems it's a recent 1.5 version.

@joaotavora
Copy link
Owner

OK, you are installing via GNU ELPA, and not MELPA (this is the information I was looking for).

You are also using a third party package, doom-modeline that should clearly specify that it depends on a more recent version of Eglot. It doesn't do that, so you get this problem.

I will create and push Eglot 1.6 to GNU ELPA soon.

In the meantime, you can

  • ask doom-modelines' author to correctly specify dependencies, or to use a master and a release branch (and to stop using implementation details, for good measure :-) )

  • update to a more recent version of Eglot, using Git or the MELPA repository.

Thank you!

@mdbergmann
Copy link
Author

Well, actually I have used the melpa-stable repo. This is my config:

(setq
 package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                    ("org" . "http://orgmode.org/elpa/")
                    ("melpa" . "http://melpa.org/packages/")
                    ("melpa-stable" . "http://stable.melpa.org/packages/"))
 package-archive-priorities '(("melpa-stable" . 1)))

However, it could be that 'melpa' has a more recent version of eglot than 'melpa-stable'.
I will give this a try, otherwise I'll try with the git version of eglot.

@mdbergmann
Copy link
Author

OK, just as confirmation.
The packages from 'melpa' (instead of 'melpa-stable') do work OK.

Thanks for the help.

@nemethf
Copy link
Collaborator

nemethf commented Nov 21, 2019

ask doom-modelines' author to [...] stop using implementation details, for good measure :-) )

I've looked what doom-modeline is for the first time. I would never want to use it, but wonder what options the authors have if they want to display information about an eglot connection. Lots of stuffs are private. Sure, the best would be to have a conversation with the authors here. But in the meantime, we might start to think about changing some accessors of eglot-lsp-server to public or create new ones. I think project-nickname and (or (plist-get serverInfo :name) (jsonrpc-name server)) are good first candidates.

@joaotavora
Copy link
Owner

But in the meantime, we might start to think about changing some accessors of eglot-lsp-server to public or create new ones. I think project-nickname and (or (plist-get serverInfo :name) (jsonrpc-name server)) are good first candidates.

OK. Add elgot--managed-mode-hook to the list.

@mdbergmann
Copy link
Author

I would never want to use it

Why would you not use it? What are you using?

@joaotavora
Copy link
Owner

Why would you not use it?

It relies on Eglot's implementation details, for one. So it is to blame for bug reports like this, that waste our time. (note I am not placing the blame on you, @mdbergmann, you're just another victim). And I'm not really "angry" at them because this happens all the time, unfortunately. I'm just clarifying the reason for my position: using implementation details is a real problem.

@mdbergmann
Copy link
Author

using implementation details is a real problem.

It sure is.

What is a status bar plugin (modeline) that behaves properly?

@joaotavora
Copy link
Owner

What is a status bar plugin (modeline) that behaves properly?

Emacs's standard modeline? What don't you like about it :-)? No really, tell us. We and you can contribute suggestions and improvements to Emacs!

@mdbergmann
Copy link
Author

I think the standard Emacs modeline is a bit too cryptic and colorless.
But I've abandoned doom-modeline and use smart-mode-line now. It seems to be to the Emacs standard only with colors.

Thanks.

@joaotavora
Copy link
Owner

joaotavora commented Nov 22, 2019 via email

@mdbergmann
Copy link
Author

Well. Not sure this is the right place to talk about this.
But you asked.

Now, I'm working with Emacs for pretty much a year and explicitely wanted to use it.
I know Emacs from ~20 years ago.
So I know by now what is displayed in the modeline, what it means, the modes, minor-modes, etc. It's pretty cool.
For a beginner though it's cryptic. Because she doesn't know what all this is. There are a lot of abrevasions. I think it's not really intuitive.
But on the other hand, I'm not sure it should be. It's a pro tool.

But, still, I love colors. And the default modeline is not nice because it's not colored.
Now, I know the default default is just a default. And Emacs as such is not very colorful in the default.
And that's probably the learning curve one has to take, to make it all colorful.
So this modeline is colorful. Not too much as doom-modeline is, but it's ok.
Bildschirmfoto 2019-11-22 um 21 09 48

@joaotavora
Copy link
Owner

Well. Not sure this is the right place to talk about this.
But you asked.

Actually, I mean M-x report-emacs-bug, so it gets in the Emacs bug tracker (your report doesn't have to be an actual "bug").

Anyway, have you tried M-x customize-themes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants