Home

Awesome

<p align="left"> <a href="https://github.com/manateelazycat/lsp-bridge/actions/workflows/test.yml"><img src="https://github.com/manateelazycat/lsp-bridge/actions/workflows/test.yml/badge.svg"/></a> <a href ="https://github.com/manateelazycat/lsp-bridge/blob/master/README.zh-CN.md"><img src="https://img.shields.io/badge/README-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-555555.svg"/></a> <hr> <a href="https://github.com/manateelazycat/lsp-bridge?tab=readme-ov-file#installation"><strong>Installation</strong></a> • <a href="https://github.com/manateelazycat/lsp-bridge?tab=readme-ov-file#supported-language-servers"><strong>Support languages</strong></a> • <a href="https://github.com/manateelazycat/lsp-bridge?tab=readme-ov-file#keymap"><strong>Keymaps</strong></a> • <a href="https://github.com/manateelazycat/lsp-bridge?tab=readme-ov-file#lsp-server-options"><strong>Customize options</strong></a> • <a href="https://github.com/manateelazycat/lsp-bridge?tab=readme-ov-file#join-development"><strong>Join development</strong></a> <hr>

lsp-bridge

The goal of lsp-bridge is to implement the fastest LSP client in the Emacs ecosystem using multi-threading technology, with a plug-and-play design philosophy to save you time and effort, because time is money.

Advantages of lsp-bridge:

  1. Blazingly fast: Offload LSP request and data analysis to an external process, preventing Emacs from getting stuck due to delays or large data triggering garbage collection
  2. Remote Completion: Built-in support for remote server code completion, with various login methods such as passwords and public keys, supports tramp protocol and jump server, supports Docker
  3. Plug and play: Can be used immediately after installation, requires no additional configuration, no need to manually set up frontend completion, backend completion, or multi-backend integration configurations, code completion also works in org-mode src blocks
  4. Multi-server fusion: A simple JSON is all you need to combine multiple LSP Servers into one file that provides services for example Python which offers code completion with Pyright and diagnostic and formatting capabilities with Ruff
  5. Flexible Customization: Customizing LSP server options is as simple as using a JSON file, allowing different projects to have different JSON configurations with just a few lines of rules
<img src="./screenshot.png">

The video explains the principle of lsp-bridge

<a href="https://emacsconf.org/2022/talks/lspbridge/">EmacsConf 2022 talk page</a>
<img src="https://i.ytimg.com/vi/vLdqcYafY8w/hqdefault.jpg" width=600>

Installation

  1. Install Emacs 28 or higher version

  2. Install Python dependencies: pip3 install epc orjson sexpdata six setuptools paramiko rapidfuzz watchdog (orjson is optional, orjson is based on Rust, providing faster JSON parsing performance)

  3. Install Elisp dependencies: markdown-mode, yasnippet

  4. Download this repository using git clone, and replace the load-path path in the configuration below.

  5. Add the following code to your configuration file ~/.emacs:

(add-to-list 'load-path "<path-to-lsp-bridge>")

(require 'yasnippet)
(yas-global-mode 1)

(require 'lsp-bridge)
(global-lsp-bridge-mode)

Note: To use completion in terminal, please install the compiled tty-child-frames branch of Emacs

(use-package lsp-bridge
  :straight '(lsp-bridge :type git :host github :repo "manateelazycat/lsp-bridge"
            :files (:defaults "*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources")
            :build (:not compile))
  :init
  (global-lsp-bridge-mode))

add this to your packages.el

(when (package! lsp-bridge
        :recipe (:host github
                 :repo "manateelazycat/lsp-bridge"
                 :branch "master"
                 :files ("*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources")
                 ;; do not perform byte compilation or native compilation for lsp-bridge
                 :build (:not compile)))
  (package! markdown-mode)
  (package! yasnippet))

and add this to your config.el

(use-package! lsp-bridge
  :config
  (setq lsp-bridge-enable-log nil)
  (global-lsp-bridge-mode))

and run doom sync to install it.

If you are unable to use normally after installing it, please read Report bug first

Please note:

  1. When using lsp-bridge, please first disable other completion plugins, such as lsp-mode, eglot, company, corfu, etc. lsp-bridge provides a complete solution from the completion backend, completion frontend to multi-backend integration
  2. In addition to providing LSP completion, lsp-bridge also provides many non-LSP completion backends, including capf, file words, paths, Yas/Tempel, TabNine, Codeium, Copilot, Tabby, Citre, Ctags, Org roam and other completion backends. If you expect to provide these completions in a certain mode, please add the corresponding mode to lsp-bridge-default-mode-hooks. Customize the order of backend, please check acm-backend-order.
  3. Please do not perform byte compilation or native compilation for lsp-bridge as it will result in a difference in API and the latest version after upgrading compiling afterwards, Lsp-bridge is designed with multi-threading that does not require compilation to speed it up

Local Usage

Lsp-bridge works plug-and-play. After installing the corresponding LSP server and mode plugin for the language, you can start coding directly without any additional settings.

It should be noted that lsp-bridge has three scanning modes:

  1. Determine the project's root directory by searching upward for a .git or .dir-locals.el file, thereby providing completion for the entire project directory.
  2. If a .git or .dir-locals.el file is not found, lsp-bridge will only provide single file completion for the opened file.
  3. You can also tell lsp-bridge the root directory of the project by customizing the lsp-bridge-get-project-path-by-filepath function. This function takes the path string of the opened file as the input parameter and outputs the project directory path.

Remote Usage

Remote SSH server

lsp-bridge can perform code syntax completion on files on a remote server, similar to VSCode. The configuration steps are as follows:

  1. Install lsp-bridge and the corresponding LSP Server on the remote server.
  2. Start lsp-bridge: python3 lsp-bridge/lsp_bridge.py.
  3. Use the lsp-bridge-open-remote-file command to open files, entering the username, IP, SSH port (default 22), and path, such as user@ip:[ssh_port]:/path/file
  4. Enabling the lsp-bridge-enable-with-tramp option allows direct opening of tramp files, using the efficient algorithm of lsp-bridge instead of tramp, achieving smooth completion. If the host in tramp is defined in ~/.ssh/config, lsp-bridge can synchronize the following options for remote connection:
    • HostName (must be in IP format, domain format may cause issues)
    • User
    • Port
    • GSSAPIAuthentication
    • ProxyCommand (currently only supports ProxyCommand option, does not support ProxyJump option)
  5. (setq lsp-bridge-remote-start-automatically t) can automatically start the lsp_bridge.py process on the remote host (which needs to support bash) when opening a tramp file, and it will also automatically close the process when quitting emacs. When using this feature, the following options need to be correctly set:
    • lsp-bridge-remote-python-command: the name of the python command on the remote host
    • lsp-bridge-remote-python-file: the full path of lsp_bridge.py on the remote host
    • lsp-bridge-remote-log: the full path for log output of lsp_bridge.py on the remote host

Principle of remote completion:

  1. Log in to the server with SSH authentication, access and edit files.
  2. When editing a replica of a remote file, real-time diff sequences will be sent to lsp-bridge, and the server side will use these sequences to rebuild the file and calculate the completion data by the remote LSP Server.
  3. The remote LSP Server will send back the completion data to the local side, and Emacs will display the completion menu.

Note:

  1. If the completion menu is not displayed, check the output of lsp_bridge.py on the remote server, it may be that the LSP Server is not fully installed.
  2. lsp-bridge will use the first *.pub file in ~/.ssh as a login credential. If public key login fails, you will be asked to enter a password. lsp-bridge will not store the password, it is recommended to use public key login to avoid repeated password entry.
  3. To run lsp_bridge.py successfully you need to completely download the entire git repository of lsp-bridge on a remote server, and switch into its directory, lsp_bridge.py requires other files to function properly, so copying only the lsp_bridge.py file can't work
  4. If a tramp file encounters an lsp-bridge connection error, you can execute the lsp-bridge-tramp-show-hostnames function and then check if the output of the host configuration options meets expectations
  5. If you encounter errors like remote file ... is updating info... skip call ..., please ensure that you open the file via SSH and note that ivy-mode may interfere with C-x C-f

Local devcontainer

lsp-bridge now support completion on files on devcontainer, similar to VSCode. This is done by using devcontainer-feature-emacs-lsp-bridge.

Here is a compelte configuration example

devcontainer.json

.devcontainer/devcontainer.json

{
    "name": "Ubuntu",
    // Your base image
    "image": "mcr.microsoft.com/devcontainers/base:jammy",
    // Features to add to the dev container. More info: https://containers.dev/features.
    "features": {
        "ghcr.io/nohzafk/devcontainer-feature-emacs-lsp-bridge/gleam:latest": {}
    },
    "forwardPorts": [
        9997,
        9998,
        9999
    ],
    // More info: https://aka.ms/dev-containers-non-root.
    "remoteUser": "vscode"
}

start the devcontainer and use file-find /docker:user@container:/path/to/file to open the file.

If you use apheleia as formatter, lsp-bridge now support auto formatting file on devcontainer.

;; setup PATH for remote command execution
(with-eval-after-load 'tramp
  (add-to-list 'tramp-remote-path "~/.nix-profile/bin")
  (add-to-list 'tramp-remote-path 'tramp-own-remote-path))

(use-package apheleia
  :config
  ;; which formatter to use
  (setf (alist-get 'python-mode apheleia-mode-alist) 'ruff)
  (setf (alist-get 'python-ts-mode apheleia-mode-alist) 'ruff)
  ;; don't mess up with lsp-mode
  (setq +format-with-lsp nil)
  ;; run the formatter inside container
  (setq apheleia-remote-algorithm 'remote))

more detail about using lsp-bridge in devcontainer please refer to emacs-devcontainer.

Keymap

KeyCommandDescription
Alt + nacm-select-nextSelect next candidate
Downacm-select-nextSelect next candidate
Alt + pacm-select-prevSelect previous candidate
Upacm-select-prevSelect previous candidate
Alt + ,acm-select-lastSelect last candidate
Alt + .acm-select-firstSelect first candidate
Ctrl + vacm-select-next-pageSelect next page candidate
Alt + vacm-select-prev-pageSelect previous page candidate
Ctrl + macm-completeComplete completion
Returnacm-completeComplete completion
Tabacm-completeComplete completion
Alt + hacm-completeComplete completion
Alt + Hacm-insert-commonInsert common part of candidates
Alt + uacm-filterPerforming second-level filtering on candidate words, similar to the fuzzy search feature in other auto-complete frontends
Alt + dacm-doc-toggleEnable or disable candidate documentation
Alt + jacm-doc-scroll-upScroll up candidate documentation
Alt + kacm-doc-scroll-downScroll down candidate documentation
Alt + lacm-hideHide completion menu
Ctrl + gacm-hideHide completion menu
Alt + Numberacm-complete-quick-accessSelecting candidate quickly, need to enable acm-enable-quick-access first
Numberacm-complete-quick-accessSelecting candidate (even more) quickly, need both acm-enable-quick-access and acm-quick-access-use-number-select enabled

Commands

LSP server options

lsp-bridge provides support for more than two language servers for many languages. You can customize the following options to choose the language server you prefer:

Options

Supported language servers

You need to install the LSP server corresponding to each programming language, then lsp-bridge can provide code completion service.

If your language supports mixed multi-language servers, it is recommended to check the multi-language server definition under multiserver, and install multiple LSP servers to get a more complete experience. For example, for the Python language, according to the default basedpyright_ruff.json definition, you should install basedpyright and ruff.

LanguageLSP ServerNote
Adaada_language_server
Ansibleansible-language-serverAnsible uses YAML as source code, you’ll need to customize lsp-bridge-get-single-lang-server-by-project to return "ansible-language-server".
Astroastronpm i -g @astrojs/language-server
Ballerinaballerina-lang-server
Bashbash-language-server
Beancountbeancount-language-servercargo install beancount-language-server
BibTexcitation-langserver
Clojureclojure-lspIf you use homebrew, please ensure install clojure-lsp/brew/clojure-lsp-native clojure-lsp-native
Cmakecmake-language-serverpip install cmake-language-server
Cobolche-che4z-lsp-for-cobol
CSSvscode-css-language-servernpm i -g vscode-langservers-extracted
Cucumbercucumber-language-servernpm install @cucumber/language-server
C#csharp-lsUse command dotnet tool install -g csharp-ls install csharp-ls, lsp-bridge-csharp-lsp-server set to csharp-ls
omnisharp-dotnetOmniSharp is a .NET development platform based on Roslyn workspaces. use M-x lsp-bridge-install-omnisharp to install it. lsp-bridge-csharp-lsp-server set to omnisharp-dotnet (6.0)
omnisharp-monoOmniSharp is a .NET development platform based on Roslyn workspaces. use M-x lsp-bridge-install-omnisharp to install it. lsp-bridge-csharp-lsp-server set to omnisharp-mono
C++clangdYou need to configure compile_commands.json or CMakeLists.txt files in root directory of project
cclslsp-bridge-c-lsp-server set to ccls, you need to configure compile_commands.json first
CclangdYou need to configure compile_commands.json or CMakeLists.txt files in root directory of project
cclslsp-bridge-c-lsp-server set to ccls, you need to configure compile_commands.json first
Common Workflowbentenpip3 install benten
Dserve-dserve-d does not support single file mode, please init .git repository under project root at first or custom lsp-bridge-get-project-path-by-filepath function
Dartdart-analysis-server
DenodenoDeno runtime use TypeScript as source code, you need customize option lsp-bridge-get-single-lang-server-by-project that return result "deno" when project-path match Deno project.
Dockerfilesdocker-language-server
ElixirelixirLSPlease ensure that the elixir-ls release directory is in your system PATH at first
lexicalKindly make sure that the lexical release directory is included in your system’s PATH and that lexical has been compiled using the same version of Elixir/Erlang as your project.
nextls
Elmelm-language-server
Erlangerlang-ls
Fennelfennel-ls
Fortranfortls
Futharkfuthark-lsp
Fuzionfuzion-lsp-server
F#fsautocomplete
Gleamgleam lsp
GLSLglsl-language-server
GogoplsMake sure install go-mode and gopls in PATH, please do ln -s ~/go/bin/gopls ~/.local/bin, and do go mod init first
GraphQLgraphql-lsp
Groovygroovy-language-serverCreate a script "groovy-language-server" in PATH, with $JAVA_HOME/bin/java -jar <path>/groovy-language-server-all.jar
Haskellhls
HLASMche-che4z-lsp-for-hlasm
HTMLvscode-html-language-servernpm i -g vscode-langservers-extracted
Javaeclipse.jdt.lsPlease ensure that org.eclipse.jdt.ls.product/target/repository/bin is in your system PATH at first, please see the details at Wiki
Javascripttypescriptnpm i -g typescript
typescript-language-servernpm i -g typescript-language-server
JSONvscode-json-language-servernpm i -g vscode-langservers-extracted
Jsonnetjsonnet-language-server
Juliajulials
Kotlinkotlin-language-serverIf you want Inlay Hints feature, you need build with source code to return Inlay Hint information
Latexdigestiflsp-bridge-tex-lsp-server set to digestif
texlablsp-bridge-tex-lsp-server set to texlab
ltex-lslsp-bridge-tex-lsp-server set to ltex-ls
LESSemmet-lsnpm install -g emmet-ls
LuasumnekoPlease ensure bin under sumneko installation is in your system PATH at first
lua-lsp
Markdownvale-lsInstall vale first, then use cargo build and install vale-ls from github, and make sure vale-ls in PATH
Mintmint-ls
Mojomojomodular install mojo-lsp-server
Movemove-analyzerThe move-analyzer is included in the move language repository
Nickelnlscargo add nickel-lang-lsp
Nixnillsp-bridge-nix-lsp-server set to nil
rnix-lsplsp-bridge-nix-lsp-server set to rnix-lsp
nixdlsp-bridge-nix-lsp-server set to nixd
Object-CclangdYou need to configure compile_commands.json or CMakeLists.txt files in root directory of project
cclslsp-bridge-c-lsp-server set to ccls, you need to configure compile_commands.json first
Odinols
Ocamlocamllsp
OpenSCADopenscad-lspcargo install openscad-lsp
Org-modeds-pinyincargo install ds-pinyin-lsp, download dict.db3 of ds-pinyin, and save to ~/.emacs.d/ds-pinyin/ directory, then turn on option lsp-bridge-use-ds-pinyin-in-org-mode
Wenpip install pygls pypinyin, then turn on option lsp-bridge-use-wenls-in-org-mode
Perlperl-language-server
PHPintelephensenpm i intelephense -g
Phpactorlsp-bridge-php-lsp-server set to phpactor
PureScriptpurescript-language-server
Pythonjedilsp-bridge-python-lsp-server set to jedi
pylsplsp-bridge-python-lsp-server set to pylsp
basedpyrightpip install basedpyright, lsp-bridge-python-lsp-server set to basedpyright
pyrightlsp-bridge-python-lsp-server set to pyright, pyright-background-analysis is faster sometimes, but it can’t response diagnostic informations
python-msLegacy language server for Python2
ruffpip install ruff-lsp, lsp-bridge-python-lsp-server is set to ruff, which only has the function of linter. If you need to complete the functions, install other Python language servers, and set the lsp-bridge-python-multi-lsp-server to [LSP NAME]_ruff
QMLqmllsThe qmlls binary should be part of the normal Qt packages since Qt 6.3.0 Ensure that the directory of qmlls binary file is in PATH
Puppetpuppet-languageserver
Rrlanguageserver
Racketracket-langserver
Reacttypescriptnpm i -g typescript
typescript-language-servernpm i -g typescript-language-server
Regoregal
Robotvscode-rf-language-serverpip install robotframework --user
Rubysolargraph
Rustrust-analyzer
SASSemmet-lsnpm install -g emmet-ls
Scalametals
SCSSemmet-lsnpm install -g emmet-ls
Standard MLmillet
Sveltesvelte
Swiftsourcekit-lspThe SourceKit-LSP server is included with the Swift toolchain.
Tailwindcsstailwindcss-language-servernpm install -g @tailwindcss/language-server , and need config tailwind.config.js follow install manual
Terraformterraform-ls
TTCN-3ntt
Typescripttypescript
Typsttypst-lsp
tinymist
Vv-analyzer
Verilogveriblelsp-bridge-verilog-lsp-server set to verible
svlslsp-bridge-verilog-lsp-server set to svls
VHDLvhdl-tool
Vimvim-language-servernpm install -g vim-language-server
Vuevolarnpm install -g typescript @vue/language-server
Wxmlwxml-language-server
XMLlemminxlsp-bridge-xml-lsp-server set to lemminx
camellslsp-bridge-xml-lsp-server set to camells
Yangyang-ls
Yamlyaml-language-servernpm install -g yaml-language-server
ZigzlsExecute zls config to generate configuration for zls. see Configuration Options
Soliditysolidity-language-servernpm install -g @nomicfoundation/solidity-language-server. see Solidity Language Server

FAQ

Support capf

Currently, the design of capf is not suitable for the LSP protocol. The capf completion backend is only suitable for non-LSP scenarios. You can enable completion by setting (setq acm-enable-capf t).

If there is no capf completion, please ensure that the current mode is present in acm-backend-capf-mode-list. If it's not in acm-backend-capf-mode-list, pull request are welcome.

Note: after enable acm-enable-capf emacs becomes slow and its definitely a problem with the capf backend implementation not an issue with lsp-bridge itself

pyenv configuration

If you use a Python distribution installed via pyenv, you must adjust your lsp-bridge-python-command variable to point to the actual python3 executable for your selected Python version, instead of the pyenv shim for python3. Place one of the following setq expressions within your lsp-bridge configuration:

;; OPTION 1 (static)
;; Replace <VERSION> with the actual Python version number (i.e., 3.11.4).
(setq lsp-bridge-python-command "~/.pyenv/versions/<VERSION>/bin/python3")

;; OPTION 2 (dynamic)
;; This is a better option if the `pyenv' executable is discoverable on `exec-path':
(setq lsp-bridge-python-command (string-trim
                                 (shell-command-to-string "pyenv which python3")))

Customize language server configuration

The configuration for the LSP server of each language in lsp-bridge is stored in lsp-bridge/langserver.

In most cases, you can customize the server configuration according to the following priority order:

  1. lsp-bridge-get-single-lang-server-by-project: A user-defined function that takes project-path and file-path as input parameters and returns the corresponding LSP server string. You can query the names of all LSP servers in the lsp-bridge-single-lang-server-mode-list list. By default, this function returns nil.
  2. lsp-bridge-single-lang-server-extension-list: Returns the server based on the file extension, for example, when opening a *.wxml file, we will use the wxml LSP server for completion.
  3. lsp-bridge-single-lang-server-mode-list: Returns the corresponding server based on Emacs’s major-mode.

If you are writing JavaScript code, you may need to customize multiple server configurations:

  1. lsp-bridge-get-multi-lang-server-by-project: A user-defined function that takes project-path and file-path as input parameters and returns the multiple server configuration names. You can search for them in the subdirectory lsp-bridge/multiserver.
  2. lsp-bridge-multi-lang-server-extension-list: Returns multiple server configuration names based on the file extension. For example, when opening a *.vue file, we will use volar_emmet to simultaneously utilize volar and emmet-ls for completion.
  3. lsp-bridge-multi-lang-server-mode-list: Returns the corresponding multiple server configuration names based on Emacs’s major-mode.

For example, we can enable the Deno LSP server for Deno scripts with the following configuration:

;; lsp-bridge first try `lsp-bridge--get-multi-lang-server-func', then try `lsp-bridge--get-single-lang-server-func'
;; So we need remove `ts' and `tsx' setting from default value of lsp-bridge-multi-lang-server-extension-list.
(setq lsp-bridge-multi-lang-server-extension-list
      (cl-remove-if (lambda (item)
                      (equal (car item) '("ts" "tsx")))
                    lsp-bridge-multi-lang-server-extension-list))

;; Last we customize `lsp-bridge-get-single-lang-server-by-project' to return `deno' lsp server name.
;; I recommand you write some code to compare project-path or file-path, return `deno' only if match target path.
(setq lsp-bridge-get-single-lang-server-by-project
      (lambda (project-path file-path)
	(when (or (string-suffix-p ".ts" file-path)
		  (string-suffix-p ".tsx" file-path))
	  "deno")))

Note: Some advanced LSP server, such as tailwindcss and emmet-ls, require a languageId and file extension that cannot be one-to-one corresponded. Instead, they dynamically return the languageId based on different frontend projects environment. In this case, you need to customize the lsp-bridge-get-language-id function to meet this requirement.

Customize language server configuration file

Copy the configuration files in lsp-bridge/langserver or lsp-bridge/multiserver to lsp-bridge-user-langserver-dir or lsp-bridge-user-multiserver-dir for customization. Lsp-bridge will prioritize reading the configuration files in lsp-bridge-user-langserver-dir or lsp-bridge-user-multiserver-dir.

We can set the value of lsp-bridge-user-langserver-dir or lsp-bridge-user-multiserver-dir before starting lsp-bridge-mode to achieve different project-specific configuration files.

(defun enable-lsp-bridge()
  (when-let* ((project (project-current))
              (project-root (nth 2 project)))
    (setq-local lsp-bridge-user-langserver-dir project-root
                lsp-bridge-user-multiserver-dir project-root))
  (lsp-bridge-mode))

Add support for new language?

  1. Create a configuration file in the lsp-bridge/langserver directory. For example, pyright.json is the configuration file for the pyright server (use pyright_windows.json for Windows and pyright_darwin.json for macOS).
  2. Add (mode . server_name) to the lsp-bridge-single-lang-server-mode-list option in the lsp-bridge.el file, for example, (python-mode . "pyright").
  3. Add a new mode-hook to the lsp-bridge-default-mode-hooks option in the lsp-bridge.el file.
  4. Add a new indentation variable to the lsp-bridge-formatting-indent-alist option in the lsp-bridge.el file.

We welcome patches to help us support more LSP servers. Thank you for your help!

Join development

The following is the framework of lsp-bridge:

<img src="./framework.png"> <img src="./remote_file_framework.png">

The following is the directory structure of the lsp-bridge project:

FilenamePurpose
lsp-bridge.elThe main Elisp logic part of lsp-bridge, providing custom options and Elisp functions for the python subprocess, such as code jump, rename, etc.
lsp-bridge-epc.elCode for communicating with the lsp-bridge python subprocess, mainly implementing Elisp IPC to dock with Python EPC, realizing data serialization, sending, receiving, and deserialization
lsp-bridge-call-hierarchy.elDisplay the call order relationship of the code in the pop-up Frame
lsp-bridge-code-action.elCode related to code correction
lsp-bridge-diagnostic.elDiagnostic information related code
lsp-bridge-ref.elCode reference viewing framework, providing reference viewing, batch renaming, reference result regular filtering, etc., core code forked from color-rg.el
lsp-bridge-inlay-hint.elProvides code type hints, more useful for static languages, such as Rust or Haskell
lsp-bridge-semantic-tokens.elProvides semantic tokens, more syntax highlighting
lsp-bridge-jdtls.elProvides third-party library jump function for Java language
lsp-bridge-dart.elProvides support for Dart's private protocols, such as Dart's Closing Labels protocol
lsp-bridge-semantic-tokens.elFlexible display of certain semantic symbols is especially useful for static languages such as C or C++.
lsp-bridge-lsp-installer.elInstall TabNine and Omnisharp
lsp-bridge-peek.elUse peek windows to view definitions and references, similar to the experience of Code Lens in VSCode
lsp-bridge.pyThe main Python logic part of lsp-bridge, providing event loops, message scheduling, and status management
acm/acm.elAsynchronous completion menu, designed specifically for the lsp-bridge backend, supporting lsp, elisp, words, TabNine and other backends
core/fileaction.pyMainly records the status of each file, processes LSP response messages, and calls Emacs Elisp functions
core/lspserver.pyLSP message processing module, mainly for parsing, sending and receiving LSP messages, and ensuring that LSP requests are in order according to LSP protocol specifications
core/remote_file.pyUsed to handle remote server file access and synchronization
core/utils.pySome global utility functions, convenient for various modules to call
core/mergedeep.pyJSON information merging, mainly used to send custom options to the LSP server
core/handler/Implementation of LSP message sending and receiving, where __init__.py is the base class
core/tabnine.pyTabNine backend search and completion
core/codeium.pyCodeium backend search and completion
core/copilot.pyCopilot backend search and completion
core/search_file_words.pyAsynchronous backend for file word search
core/search_paths.pyAsynchronous backend for file path search
core/search_sdcv_words.pyEnglish word search backend, can be replaced with StarDict dictionaries of other languages
core/search_list.pyAsynchronous search framework, can be used to write your own asynchronous search backend
langserverMainly places the configuration of the LSP server, each server has a json file, defining the server's name, language ID, startup command, and setting options, etc.
multiserverMainly places the configuration of multiple LSP servers
resourcesEnglish dictionary data, mainly serving Chinese users

Please read below articles first:

Then turn on develop option lsp-bridge-enable-log and happy hacking! ;)

Report bug

For some common problems, please read Wiki first.

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 still exists:

  1. Turn on option lsp-bridge-enable-log
  2. Use lsp-bridge-restart-process to restart the LSP-BRIDGE process
  3. Report issue 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:

  1. Install gdb and turn on option lsp-bridge-enable-debug
  2. Use the command lsp-bridge-restart-process to restart the LSP-BRIDGE process
  3. Send issue with *lsp-bridge* buffer content when next crash

Contributor

lsp-bridge's rapid development couldn't have been possible without the strong support and selfless contributions from the community's experts. Without the community’s support, lsp-bridge wouldn’t be where it is today. Thank you to the loveliest people in the world, happy hacking ;)

<a href = "https://github.com/manateelazycat/lsp-bridge/graphs/contributors"> <img src = "https://contrib.rocks/image?repo=manateelazycat/lsp-bridge"/> </a>