Top Related Projects
Visual Studio Code
Vim-fork focused on extensibility and usability
Emacs client/library for the Language Server Protocol
A client for Language Server Protocol servers
Language Server Protocol (LSP) support for vim and neovim.
async language server protocol plugin for vim and neovim
Quick Overview
The lsp-ui
project is a set of UI components for the Language Server Protocol (LSP) in Emacs. It provides a variety of features to enhance the user experience when working with LSP-enabled programming languages, such as code diagnostics, code actions, and hover information.
Pros
- Comprehensive UI Integration:
lsp-ui
seamlessly integrates with the Emacs environment, providing a consistent and intuitive user interface for LSP-related functionality. - Extensive Functionality: The project offers a wide range of features, including code diagnostics, code actions, symbol information, and more, making it a powerful tool for Emacs users.
- Customizability:
lsp-ui
is highly customizable, allowing users to tailor the UI to their preferences and workflow. - Active Development: The project is actively maintained and regularly updated, ensuring compatibility with the latest versions of Emacs and LSP implementations.
Cons
- Dependency on LSP:
lsp-ui
is dependent on the Language Server Protocol, which means that it requires a compatible LSP server to be set up for each programming language. - Emacs-specific: The project is designed specifically for the Emacs text editor, which may limit its usefulness for users of other development environments.
- Learning Curve: While the project provides a comprehensive set of features, the learning curve for new users may be steeper compared to simpler LSP integration solutions.
- Performance Considerations: Depending on the complexity of the project and the capabilities of the LSP server,
lsp-ui
may have some performance implications, especially in larger codebases.
Code Examples
Here are a few examples of how to use lsp-ui
in your Emacs configuration:
- Enabling
lsp-ui
for a specific programming language:
(use-package lsp-ui
:commands lsp-ui-mode
:hook (lsp-mode . lsp-ui-mode))
- Customizing the
lsp-ui
sidebar:
(setq lsp-ui-sideline-show-hover t
lsp-ui-sideline-show-diagnostics t
lsp-ui-sideline-show-code-actions t)
- Configuring the
lsp-ui
code actions menu:
(setq lsp-ui-imenu-enable t
lsp-ui-imenu-kind-position 'top)
- Enabling the
lsp-ui
documentation popup:
(setq lsp-ui-doc-enable t
lsp-ui-doc-position 'at-point
lsp-ui-doc-include-signature t)
Getting Started
To get started with lsp-ui
, you'll need to have the following set up:
- Install the
lsp-ui
package in your Emacs configuration:
(use-package lsp-ui
:commands lsp-ui-mode
:hook (lsp-mode . lsp-ui-mode))
-
Ensure that you have the Language Server Protocol (LSP) set up for your programming language of choice. This typically involves installing the appropriate LSP server and configuring it in your Emacs environment.
-
Once the LSP server is set up,
lsp-ui
will automatically integrate with it and provide the various UI features, such as code diagnostics, code actions, and hover information. -
You can further customize the behavior of
lsp-ui
by adjusting the various configuration options, as shown in the code examples above.
Competitor Comparisons
Visual Studio Code
Pros of vscode
- More user-friendly interface, especially for beginners
- Extensive marketplace with a wide range of extensions
- Regular updates and active development from Microsoft
Cons of vscode
- Heavier resource usage compared to Emacs with lsp-ui
- Less customizable than Emacs, which may limit advanced users
Code comparison
lsp-ui (Emacs):
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode
:config
(setq lsp-ui-sideline-enable t))
vscode (settings.json):
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue"
}
Both projects aim to enhance the development experience with Language Server Protocol (LSP) integration. lsp-ui focuses on providing UI enhancements for Emacs users working with lsp-mode, while vscode is a full-featured IDE that includes built-in LSP support.
vscode offers a more polished, out-of-the-box experience with its graphical interface and extensive marketplace. However, lsp-ui provides Emacs users with powerful LSP integration, allowing for a highly customizable development environment within their preferred text editor.
The choice between the two largely depends on personal preference, workflow, and the level of customization desired in the development environment.
Vim-fork focused on extensibility and usability
Pros of neovim
- More extensive and active development community
- Built-in terminal emulator for seamless integration
- Lua scripting support for enhanced customization
Cons of neovim
- Steeper learning curve for new users
- Less integrated with external tools compared to Emacs ecosystem
Code comparison
lsp-ui (Emacs):
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode
:config
(setq lsp-ui-doc-enable t))
neovim:
vim.cmd [[packadd nvim-lspconfig]]
require'lspconfig'.pyright.setup{}
vim.o.completeopt = "menuone,noselect"
Summary
neovim is a powerful, extensible text editor with a strong focus on performance and modern features. It offers a more active development community and built-in terminal emulation. However, it may have a steeper learning curve compared to Emacs with lsp-ui.
lsp-ui, on the other hand, is a package for Emacs that enhances the Language Server Protocol (LSP) integration. It provides a more user-friendly interface for LSP features within the Emacs ecosystem, which may be easier for some users to adopt.
Both projects aim to improve the editing experience for developers, with neovim offering a more comprehensive solution and lsp-ui focusing on enhancing LSP functionality within Emacs.
Emacs client/library for the Language Server Protocol
Pros of lsp-mode
- Core LSP functionality for Emacs, providing a solid foundation for language server integration
- Supports a wide range of programming languages and language servers
- Highly customizable with extensive configuration options
Cons of lsp-mode
- Can be complex to set up and configure for beginners
- May require additional packages for enhanced UI features
Pros of lsp-ui
- Enhances the visual experience of lsp-mode with UI improvements
- Provides additional features like inline documentation, code actions, and signature help
- Easier to set up for users who want a more polished LSP experience out of the box
Cons of lsp-ui
- Depends on lsp-mode, so it's not a standalone solution
- May introduce performance overhead for some users, especially on slower machines
Code Comparison
lsp-mode (basic setup):
(require 'lsp-mode)
(add-hook 'python-mode-hook #'lsp)
lsp-ui (enhancing lsp-mode):
(require 'lsp-mode)
(require 'lsp-ui)
(add-hook 'python-mode-hook #'lsp)
(add-hook 'lsp-mode-hook #'lsp-ui-mode)
In summary, lsp-mode provides the core LSP functionality for Emacs, while lsp-ui enhances the user interface and adds extra features on top of lsp-mode. Users often use both packages together for a comprehensive LSP experience in Emacs.
A client for Language Server Protocol servers
Pros of eglot
- Lightweight and minimalistic approach, focusing on core LSP functionality
- Seamless integration with built-in Emacs features like xref and completion-at-point
- Faster startup time and lower memory footprint
Cons of eglot
- Fewer customization options and UI enhancements compared to lsp-ui
- Limited support for some advanced LSP features and extensions
- Smaller ecosystem of extensions and plugins
Code Comparison
eglot:
(use-package eglot
:ensure t
:hook ((python-mode . eglot-ensure)
(rust-mode . eglot-ensure)))
lsp-ui:
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode
:config
(setq lsp-ui-sideline-enable t
lsp-ui-doc-enable t))
The code examples demonstrate the simplicity of eglot's configuration compared to lsp-ui's more extensive setup options. eglot requires minimal configuration, while lsp-ui offers more customization possibilities for UI elements like sideline and documentation display.
Language Server Protocol (LSP) support for vim and neovim.
Pros of LanguageClient-neovim
- Designed specifically for Neovim, offering better integration and performance
- Supports a wider range of programming languages out-of-the-box
- More active development and frequent updates
Cons of LanguageClient-neovim
- Less extensive UI customization options
- Requires more manual configuration for advanced features
- May have a steeper learning curve for new users
Code Comparison
LanguageClient-neovim configuration:
let g:LanguageClient_serverCommands = {
\ 'rust': ['rustup', 'run', 'stable', 'rls'],
\ 'javascript': ['javascript-typescript-stdio'],
\ 'python': ['pyls'],
\ }
lsp-ui configuration:
(use-package lsp-ui
:ensure t
:config
(setq lsp-ui-doc-enable t
lsp-ui-sideline-enable t
lsp-ui-flycheck-enable t))
Both repositories aim to provide Language Server Protocol (LSP) support for their respective editors. LanguageClient-neovim focuses on Neovim integration, while lsp-ui enhances the LSP experience in Emacs. LanguageClient-neovim offers broader language support and tighter integration with Neovim, but lsp-ui provides more extensive UI customization options and a potentially gentler learning curve for Emacs users. The choice between the two largely depends on the user's preferred editor and specific requirements for LSP functionality.
async language server protocol plugin for vim and neovim
Pros of vim-lsp
- Lightweight and fast, with minimal dependencies
- Supports a wide range of language servers out of the box
- Easy integration with other Vim plugins and workflows
Cons of vim-lsp
- Less feature-rich UI compared to lsp-ui
- Documentation and community support may be less extensive
- Configuration can be more complex for advanced setups
Code Comparison
vim-lsp configuration example:
let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_highlight_references_enabled = 1
if executable('pyls')
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
lsp-ui configuration example:
(use-package lsp-ui
:ensure t
:config
(setq lsp-ui-doc-enable t
lsp-ui-doc-use-childframe t
lsp-ui-doc-position 'top
lsp-ui-doc-include-signature t
lsp-ui-sideline-enable nil
lsp-ui-flycheck-enable t
lsp-ui-flycheck-list-position 'right
lsp-ui-flycheck-live-reporting t
lsp-ui-peek-enable t
lsp-ui-peek-list-width 60
lsp-ui-peek-peek-height 25))
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
lsp-ui
Table of Contents
Intro
This package contains all the higher level UI modules of lsp-mode
, like flycheck support and code lenses.
By default, lsp-mode
automatically activates lsp-ui
unless lsp-auto-configure
is set to nil
.
You only have to put (use-package lsp-ui)
in your config and the package will work out of the box.
(use-package)
Or use the builtin package manager.
M-x package-install [RET] lsp-ui [RET]
lsp-ui-sideline:
Show informations of the symbols on the current line. It also show flycheck diagnostics and LSP code actions
Customization:
lsp-ui-sideline-show-diagnostics
show diagnostics messages in sidelinelsp-ui-sideline-show-hover
show hover messages in sidelinelsp-ui-sideline-show-code-actions
show code actions in sidelinelsp-ui-sideline-update-mode
When set to 'line' the information will be updated when user changes current line otherwise the information will be updated when user changes current pointlsp-ui-sideline-delay
seconds to wait before showing sideline
lsp-ui-peek:
Add peek feature
You may remap xref-find-{definitions,references}
(bound to M-. M-? by default):
(define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)
There is a window-local jump list dedicated to cross references:
(lsp-ui-peek-jump-backward)
(lsp-ui-peek-jump-forward)
Other cross references:
(lsp-ui-peek-find-workspace-symbol "pattern 0")
;; If the server supports custom cross references
(lsp-ui-peek-find-custom 'base "$cquery/base")
Customization:
lsp-ui-peek-enable
enable âlsp-ui-peekâlsp-ui-peek-show-directory
show the directory of files
lsp-ui-doc
Show object documentation at point in a child frame.
Show documentation in a WebKit widget
Focus into lsp-ui-doc-frame
Customization:
lsp-ui-doc-enable
Enable lsp-ui-doclsp-ui-doc-position
Where to display the doc (top, bottom or at-point)lsp-ui-doc-side
Where to display the doc (left or right)lsp-ui-doc-delay
Number of seconds before showing the doclsp-ui-doc-show-with-cursor
When non-nil, move the cursor over a symbol to show the doclsp-ui-doc-show-with-mouse
When non-nil, move the mouse pointer over a symbol to show the doc
lsp-ui-imenu
Show imenu entries.
Customization:
lsp-ui-imenu-kind-position
place to show entries kindlsp-ui-imenu-buffer-position
place to show the buffer windowlsp-ui-imenu-window-width
set window widthlsp-ui-imenu-window-fix-width
when non-nil, the window will not be resizable (eg. unaffected bybalance-windows
)lsp-ui-imenu--custom-mode-line-format
mode line formatlsp-ui-imenu-auto-refresh
auto refresh when necessarylsp-ui-imenu-refresh-delay
delay to refresh imenu
Contributing
Any kind of help is appreciated. If you want to help us maintaining this package, leave a note.
Top Related Projects
Visual Studio Code
Vim-fork focused on extensibility and usability
Emacs client/library for the Language Server Protocol
A client for Language Server Protocol servers
Language Server Protocol (LSP) support for vim and neovim.
async language server protocol plugin for vim and neovim
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot