I just want to better understand how this all works together…And also make it work…
I have tried to search all over the internet for a singularly decent tutorial or example and cannot find anything of use. The LSP-mode tutorial is basically useless
Reddit doesn’t have anything of use. One thread showed some promise.
What happened?
Open a project on remote server. I get this error:
LSP :: There are no language servers supporting current mode `python-mode' registered with `lsp-mode'.
This issue might be caused by:
1. The language you are trying to use does not have built-in support in `lsp-mode'. You must install the required support manually. Examples of this are `lsp-java' or `lsp-metals'.
2. The language server that you expect to run is not configured to run for major mode `python-mode'. You may check that by checking the `:major-modes' that are passed to `lsp-register-client'.
3. `lsp-mode' doesn't have any integration for the language behind `python-mode'. Refer to https://emacs-lsp.github.io/lsp-mode/page/languages and https://langserver.org/ .
4. You are over `tramp'. In this case follow https://emacs-lsp.github.io/lsp-mode/page/remote/.
5. You have disabled the `lsp-mode' clients for that file. (Check `lsp-enabled-clients' and `lsp-disabled-clients').
You can customize `lsp-warn-no-matched-clients' to disable this message.
mouse-minibuffer-check: Minibuffer window is not active
So, then I follow the terrible tutorial that LSP-mode creator provided and put this code in my config.el
(lsp-register-client
(make-lsp-client :new-connection (lsp-tramp-connection "pyright")
:major-modes '(python-mode)
:remote? t
:server-id 'pyright-remote))
And doom doesn’t load:
Error caused by user's config or system: /home/user/.doom.d/config.el, (void-function lsp-register-client)
Here it is with --debug-init
Debugger entered--Lisp error: (void-function lsp-register-client)
(lsp-register-client (make-lsp-client :new-connection (lsp-tramp-connection "pyright") :major-modes '(python-mode) :remote\? t :server-id 'pyright-remote))
load-with-code-conversion("/home/goberlan/.doom.d/config.el" "/home/goberlan/.doom.d/config.el" nil t)
load("~/.doom.d/config" nil nomessage)
(condition-case e (load path noerror 'nomessage) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (setq path (locate-file path load-path (get-load-suffixes))) (signal (cond ((not (and path (featurep ...))) 'error) ((file-in-directory-p path (expand-file-name "cli" doom-core-dir)) 'doom-cli-error) ((file-in-directory-p path doom-core-dir) 'doom-core-error) ((file-in-directory-p path doom-user-dir) 'doom-user-error) ((file-in-directory-p path doom-profile-dir) 'doom-profile-error) ((file-in-directory-p path doom-modules-dir) 'doom-module-error) ('doom-error)) (list path e))))
doom-load("~/.doom.d/config")
byte-code("\305\306\307\310\311\3
Once it does load, it likely still won’t work, but I haven’t made it that far.
###eglot With eglot, it also failed, with:
Error in post-command-hook (#[0 "\303\304\301\242\305#\210\300\306!\205\0r\211q\210
?\205\0\307\310\311 \")\207" [#<buffer 1slot_clock.py> (#0) eglot--managed-mode remove-hook post-command-hook nil buffer-live-p apply eglot--connect eglot--guess-contact] 4]): (error "None of ’pylsp, pyls, pyright-langserver, jedi-language-server’ are valid executables")
Anaconda Jump Proxy: nil
I have pyright installed globally, and in each pyenv I use. Still doesn’t work. eglot is suppose to “just work” with TRAMP, but that is not the case.
What did you expect to happen?
LSP would work…
Steps to reproduce
- Enable LSP-mode (+eglot or without)
- install pyright or pyls locally and on remote server
- Open a python project on remote server over TRAMP
System information
WSL2 - Arch Linux
Loading data dump...
I would prefer not to use an emacs on the remote server because it completely prevents the benefit of using one single emacs that I can navigate to everything I want/need. On windows, on WSL, on my remote work server