lsp-bridge's goal is to become the fastest LSP client in the Emacs.
lsp-bridge use python threading technology build cache bridge between Emacs and LSP server, you will never feel stuck when you write the code.
- Install python-epc:
pip install epc
- Clone or download this repository (path of the folder is the
<path-to-lsp-bridge>
used below). - Add follow code in your ~/.emacs:
(add-to-list 'load-path "<path-to-lsp-bridge>")
(require 'lsp-bridge)
;; For python and pyright
(dolist (hook (list
'c-mode-hook
'c++-mode-hook
'python-mode-hook
'ruby-mode-hook
'rust-mode-hook
'elixir-mode-hook
'go-mode-hook
'haskell-mode-hook
'haskell-literate-mode-hook
'dart-mode-hook
'scala-mode-hook
'tuareg-mode-hook
'typescript-mode-hook
'js2-mode-hook
'js-mode-hook
))
(add-hook hook (lambda ()
(lsp-bridge-enable)
)))
Key | Event |
---|---|
TAB |
lsp-bridge-complete-selection |
RET |
lsp-bridge-complete-selection |
M-h |
lsp-bridge-complete-selection |
M-H |
lsp-bridge-complete-common |
M-n |
lsp-bridge-select-next |
M-p |
lsp-bridge-select-previous |
M-, |
lsp-bridge-select-last |
M-. |
lsp-bridge-select-first |
lsp-bridge load lang server configuration from directory lsp-bridge/langserver.
But default configuration maybe not works with your environment, you can change lsp-bridge-lang-server-list
to customize language server configuration.
Example, we can change (python-mode . "pyright")
to (python-mode . "/my_directory/pyright.json")
then lsp-bridge will load configuration from /my_directory/pyright.json
instead load from lsp-bridge/langserver/pyright.json
.
- Create settings file under lsp-bridge/langserver, such as
pyright.json
is use for pyright. - Add
(mode . server_name)
in lsp-bridge-lang-server-list, such as(python-mode . "pyright")
- Then add
(lsp-bridge-enable)
in mode-hook for test.
Welcome send PR to help us improve support for LSP servers, thank you!
- clangd (c++)
- pyright (python)
- solargraph (ruby)
- rust-analyzer (rust)
- elixirLS (elixir) Note: please ensure export
elixir-ls
release directory in your system PATH at first. - gopls (go)
- hls (haskell)
- dart_analysis_server (dart)
- metals (scala)
- typescript (typescript, javascript)
- ocaml (ocamllsp)
- Find references UI: use color-rg or xref
- Popup web document window by Popweb
- To support more LSP servers
Please use emacs -q
and load a minimal setup with only lsp-bridge to verify that the bug is reproducible. If emacs -q
works fine, probably something is wrong with your Emacs config.
If the problem persists, please report it here with *lsp-bridge*
buffer content, it contains many clues that can help us locate the problem faster.
If you get a segfault error, please use the following way to collect crash information:
- Install gdb and turn on option
lsp-bridge-enable-debug
- Use the command
lsp-bridge-stop-process
to stop the current process - Restart lsp-bridge, send issue with
*lsp-bridge*
buffer content when next crash