Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weilbith/nvim-lsp-bacomp
A NeoVim plugin for using language server capabilites with backward compatibility in mind
https://github.com/weilbith/nvim-lsp-bacomp
neovim neovim-lsp neovim-plugin
Last synced: 2 days ago
JSON representation
A NeoVim plugin for using language server capabilites with backward compatibility in mind
- Host: GitHub
- URL: https://github.com/weilbith/nvim-lsp-bacomp
- Owner: weilbith
- License: mit
- Created: 2020-05-11T08:10:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T21:50:14.000Z (about 4 years ago)
- Last Synced: 2024-08-03T13:06:16.090Z (4 months ago)
- Topics: neovim, neovim-lsp, neovim-plugin
- Language: Lua
- Homepage:
- Size: 11.7 KB
- Stars: 13
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NeoVim Language Server Backwards Compatibility
This plugin provides the convenience to run LSP related commands with capability
checks to the language server and allow to fall back to alternative "old school"
solutions.## Installation
Install the plugin with your favorite manager tool. Here is an example using
[dein.vim](https://github.com/Shougo/dein.vim):```vim
call dein#add('weilbith/nvim-lsp-backomp', {'on_cmd': 'LspBacomp'})
```It is recommended to use the [nvim-lsp](https://github.com/neovim/nvim-lsp)
plugin to attach language client to your buffers.## Usage
The following are examples by using the `:LspBacomp` command directly. Checkout
the docs for further functionality and more details. There are a bunch of
functions to simplify your own _Lua_ scripts.Establish an auto-command to leverage LSP document highlighting if available:
```vim
autocmd! CursorHold * silent! LspBacomp documentHighlightProvider
\ lua\ vim.lsp.buf.document_highlight()
autocmd CursorMoved * lua vim.lsp.buf.clear_references()
```Define a mapping to jump to the definition of the word under the cursor. Either
by the language server if possible, else fall back to the tag file.```vim
nnoremap gd LspBacomp definitionProvider lua\ vim.lsp.buf.definition()
\ execute\ 'tjump\ '.expand('')
```---
**Note:**
Please mind that _NeoVim_ is not fully consistent at the current state. This
means that some methods for language servers are exposed via the `lsp-buf` API,
but are not covered by the server compatibilities. Thereby this plugin can't
check for them. Such are for example the `declarationProvider`. It is planned to
open a PR to add them. The [`lsp_provider_names.lua`
module](./lua/lsp_bacomp/lsp_provider_names.lua) includes a list of all missing
providers according to the official LSP specification.