LSP Mode

语言服务器协议的 Emacs 客户端/库。「Emacs client/library for the Language Server Protocol」

Github星跟踪图

标题 说明
LSP 模式 -- 支持 Emacs 的语言服务器协议。 支持多种语言的语言服务器协议,支持Emacs。

支持 Emacs 的语言服务器协议


主页安装语言设置扩展故障排除屏幕截图FAQ

为什么?

  • 社区驱动
  • 功能齐全 -- 支持语言服务器协议 v3.14 的所有功能。
  • 快速 -- 见性能部分。
  • 灵活 -- 可以选择具有华丽用户界面的完整集成开发环境,也可以选择最小化的免打扰。
  • 易于配置 -- 开箱即用,如果有额外的包,则自动升级。

概述

语言服务器协议的客户端(v3.14),lsp-mode 的目的是提供类似 IDE 的体验,它提供了与最流行的 Emacs 包的可选集成,如 company、flycheck 和 projectile。

  • 非阻塞异步调用
  • 当Emacs>26时,通过 flycheck(推荐)或 flymake 进行实时诊断//linting(需要flymake>=1.0.5)
  • 代码完成 -- company-capf / completion-at-point(注意,不再支持company-lsp)。
  • 悬停 -- 使用 lsp-ui
  • 代码动作 -- 通过 lsp-execute-code-action、modeline(推荐)或 lsp-ui sideline。
  • 代码大纲 -- 使用内置的 imenu 或 helm-imenu。
  • 代码导航 -- 使用内置的 xreflsp-treemacs 树形视图或 lsp-ui peek 函数。
  • 代码透镜
  • 符号亮点
  • 格式化
  • 模型上的项目错误
  • 调试器 -- dap-mode
  • 标题行上的面包屑
  • Helm 集成 -- helm-lsp
  • Ivy 集成 -- lsp-ivy
  • Treemacs 集成 -- lsp-treemacs
  • LSP 3.16 所定义的语义高亮(兼容的语言服务器包括 clangd 和 rust-analyzer 的最新开发版本)。
  • 整合 which-key,更好的发现

演讲/演示

另见

  • lsp-docker -- 提供带有预配置语言服务器的 docker 镜像和相应的 emacs 配置。
  • company-box -- 带有图标的 company 前端。
  • dap-mode -- lsp-mode 的调试器集成。
  • eglot -- 另一种最小化 LSP 实现。
  • which-keyy -- Emacs 包,可在弹出式中显示可用的键绑定。
  • projectile -- Emacs 的项目交互库。
  • emacs-tree-sitter -- 通过 tree-sitter 实现更快、更精细的代码高亮。
  • gccemacs -- 修改后的 Emacs 能够作为本地代码编译和运行 Emacs Lisp。

贡献

欢迎大家踊跃贡献。

支持本项目

emacs-lsp 组织有超过 20.000 行代码,为了保持所有这些工作,我们需要实现新特性,并在许多问题上帮助社区。

你可以通过 支持这个项目 来帮助我们继续下去并改进它。

成员

这里是目前 lsp-mode 成员的名单,以及他们主要工作/负责的内容。

(恕删略。请参见自述文件)

(First version translated and edited by vz on 2020.12.20)

主要指标

概览
名称与所有者emacs-lsp/lsp-mode
主编程语言Emacs Lisp
编程语言Emacs Lisp (语言数: 9)
平台Linux, Mac, Windows
许可证GNU General Public License v3.0
所有者活动
创建于2016-12-02 17:08:23
推送于2025-04-14 08:13:47
最后一次提交2025-04-14 17:12:14
发布数13
最新版本名称9.0.0 (发布于 )
第一版名称4.1 (发布于 )
用户参与
星数4.9k
关注者数88
派生数0.9k
提交数4k
已启用问题?
问题数2075
打开的问题数407
拉请求数2241
打开的拉请求数35
关闭的拉请求数226
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

title: LSP Mode - Language Server Protocol support for Emacs
description: Language Server Protocol support with multiples languages support for Emacs




Language Server Protocol Support for Emacs

LSP mode

Why?

  • :heart: Community Driven
  • :gem: Fully featured - supports all features in Language Server Protocol v3.14.
  • :rocket: Fast - see performance section.
  • :star2: Flexible - choose between full-blown IDE with flashy UI or minimal distraction free.
  • :gear: Easy to configure - works out of the box and automatically upgrades if additional packages are present.

Overview

Client for Language Server
Protocol

(v3.14). lsp-mode aims to
provide IDE-like experience by providing optional integration with the
most popular Emacs packages like company, flycheck and projectile.

  • Non-blocking asynchronous calls
  • Real-time Diagnostics/linting via
    flycheck (recommended) or
    flymake when Emacs > 26 (requires flymake>=1.0.5)
  • Code completion - company-capf / completion-at-point (note that
    company-lsp is no
    longer supported).
  • Hovers - using lsp-ui
  • Code actions - via lsp-execute-code-action, modeline (recommended) or lsp-ui sideline.
  • Code outline - using builtin
    imenu
    or helm-imenu
  • Code navigation - using builtin
    xref,
    lsp-treemacs tree views
    or lsp-ui peek functions.
  • Code lens
  • Symbol highlights
  • Formatting
  • Project errors on modeline
  • Debugger - dap-mode
  • Breadcrumb on headerline
  • Helm integration -
    helm-lsp
  • Ivy integration - lsp-ivy
  • Treemacs integration -
    lsp-treemacs
  • Semantic highlighting as defined by LSP 3.16 (compatible language servers include recent development builds of clangd and rust-analyzer)
  • which-key integration
    for better discovery

Presentations/demos

See also

  • lsp-docker - provide
    docker image with preconfigured language servers with corresponding
    emacs configuration.
  • company-box -
    company frontend with icons.
  • dap-mode - Debugger
    integration for lsp-mode.
  • eglot - An alternative
    minimal LSP implementation.
  • which-key - Emacs
    package that displays available keybindings in popup
  • projectile - Project
    Interaction Library for Emacs
  • emacs-tree-sitter - Faster, fine-grained code highlighting via tree-sitter.
  • gccemacs - modified Emacs capable of compiling and running Emacs Lisp as native code.

Contributions

Contributions are very much welcome.

Support the project

The emacs-lsp organization has more than 20.000 lines of code, to keep all of this working,
we need to implement new features and help the community on a lot of issues.

You can help us keep going and improving it by supporting the project

Members

Here it is a list of the current lsp-mode members and what they are
primary working on/responsible for.