seagle0128 / .emacs.d

Centaur Emacs - A Fancy and Fast Emacs Configuration
https://seagle0128.github.io/.emacs.d/
GNU General Public License v3.0
1.99k stars 269 forks source link

Use eglot-ensure for starting eglot in org-edit-special buffers #194

Closed tviti closed 4 years ago

tviti commented 4 years ago

I think it would be more appropriate to use eglot-ensure here to activate eglot in the org-edit-special buffer, since the eglot command really wants to be called interactively, and actually requires a few positional arguments if called non-interactively (i.e. the usage here is incorrect and throws an error if eglot is not already running).

https://github.com/seagle0128/.emacs.d/blob/973e90254763ddb6cffe2ec47bbe5bd64280815a/lisp/init-lsp.el#L406

seagle0128 commented 4 years ago

I am not using eglot. Would you please create a PR?

seagle0128 commented 4 years ago

Please test.

tviti commented 4 years ago

I haven't tried the referenced commit, but have been using the following w/ pyls for the past few days with reasonable results:

https://github.com/tviti/.emacs.d/commit/06ddb8a44cb62924c3524285bc0d49b102ae5731

I've made a few other changes here, one of which is switching to eglot-ensure. Completion works, but flymake and rename do not (these problems might be beyond the scope of this issue ticket though).

seagle0128 commented 4 years ago

flymake is disabled by default. You need to enable it manually. I am using flycheck. Regarding the renaming, it should be supported on server side.

tviti commented 4 years ago

Sorry, I should have specified that I'm not actually using Centaur, and that the linked commit is just me taking that macro and adapting it to my own config (where I do use flymake).

Renaming is indeed supported in pyls, but the language server throws an error when trying to do the rename. Like I said, I haven't tried with other backends, so idk yet if this is just a problem w/ pyls.

I'm curious: Does flycheck+lsp-mode work for you?

seagle0128 commented 4 years ago

I am not using pyls. Check lsp-python-ms. Flychekc+ lsp-mode works well for me.