Skip to content

Added Emacs Tips Documentation #3247

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

Merged
merged 14 commits into from
Aug 1, 2022
Prev Previous commit
Next Next commit
docs: fixed emacs lsp mode server id
  • Loading branch information
Ubuntu committed Jul 29, 2022
commit d7b18bc4eb24274e35246598f9d3b4a9bb1beeb9
2 changes: 1 addition & 1 deletion docs/ides/configuring-emacs-tramp.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ This tells `lsp-mode` to look for a language server binary named `<LSP SERVER BI

- `<LSP SERVER BINARY>` : The name of the language server binary, without any path components. For example to use the Deno Javascript language server use the value `deno`.
- `<LANGUAGE MODE>`: The name of the Emacs major mode for which the language server should be used. For example to enable the language server for Javascript development use the value `web-mode`.
- `<LANGUAGE SERVER ID>`: The ID that `lsp-mode` uses to identify the language server, often this is the name of the language server binary, but not always. A good way to find this ID is to find variables starting with `lsp-clients-`. For each language server `lsp-mode` knows about there will be a series of variables like `lsp-clients-<LANGUAGE SERVER ID>-server`, `lsp-clients-<LANGUAGE SERVER ID>-server-args`, ect. To find these variables use the variable help function built into Emacs via `C-h v` and start typing `lsp-clients-` and then hit `TAB`. Emacs will autocomplete with the available variables. Start typing in the name of the language server binary and see if there are any variables which match. If you can't find any results also try the name of the language and its abbreviation. Sometimes the [`lsp-mode` languages docs](https://emacs-lsp.github.io/lsp-mode/page/languages/) page for a specific language server will also list the ID or at least the variables discussed earlier. It is important that you do not make this language server ID up, as `lsp-mode` might have specific configuration it needs to access by this ID in order to run the language server properly.
- `<LANGUAGE SERVER ID>`: This is just the name that `lsp-mode` will use to refer to this language server. If you are ever looking for output buffers or files they may have this name in them.

Calling the `lsp-register-client` function will tell `lsp-mode` the name of the LSP server binary. However this binary must be accessible via the path. If the language server binary is not in the path you must modify `tramp-remote-path` so that `lsp-mode` knows in what directories to look for the LSP server. To do this use TRAMP's connection profiles functionality. These connection profiles let you customize variables depending on what machine you are connected to. Add the following to your `init.el`:

Expand Down