]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp-ale/README.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '56df844d3c39ec494dacc69eae34272b27db185a' as '.vim/bundle/asyncomplete'
[etc/vim.git] / .vim / bundle / vim-lsp-ale / README.md
1 [vim-lsp][] + [ALE][]
2 =====================
3 [![Build Status][ci-badge]][ci]
4 [![Coverage Status][codecov-badge]][codecov]
5
6 [vim-lsp-ale][] is a Vim plugin for bridge between [vim-lsp][] and [ALE][]. Diagnostics results received
7 by vim-lsp are shown in ALE's interface.
8
9 When simply using ALE and vim-lsp, both plugins run LSP servers respectively. Running multiple server processes
10 consume resources and may cause some issues. And showing lint results from multiple plugins is confusing.
11 vim-lsp-ale solves the problem.
12
13 <img alt="screencast" src="https://github.com/rhysd/ss/blob/master/vim-lsp-ale/main.gif?raw=true" width="582" height="316"/>
14
15 ## Installation
16
17 Install [vim-lsp][], [ale][ALE], [vim-lsp-ale][] with your favorite package manager or `:packadd` in your `.vimrc`.
18
19 An example with [vim-plug](https://github.com/junegunn/vim-plug):
20
21 ```viml
22 Plug 'dense-analysis/ale'
23 Plug 'prabirshrestha/vim-lsp'
24 Plug 'rhysd/vim-lsp-ale'
25 ```
26
27 ## Usage
28
29 Register LSP servers you want to use with `lsp#register_server` and set `vim-lsp` linter to `g:ale_linters`
30 for filetypes you want to check with vim-lsp.
31
32 The following example configures `gopls` to check Go sources.
33
34 ```vim
35 " LSP configurations for vim-lsp
36 if executable('gopls')
37     autocmd User lsp_setup call lsp#register_server({
38         \   'name': 'gopls',
39         \   'cmd': ['gopls'],
40         \   'allowlist': ['go', 'gomod'],
41         \ })
42 endif
43
44 " Set 'vim-lsp' linter
45 let g:ale_linters = {
46     \   'go': ['golint'], " vim-lsp is implicitly active
47     \ }
48 ```
49
50 This plugin configures vim-lsp and ALE automatically. You don't need to setup various variables.
51
52 When opening a source code including some lint errors, vim-lsp will receive the errors from language server
53 and ALE will report the errors in the buffer.
54
55 ALE supports also many external programs. All errors can be seen in one place. The above example enables
56 vim-lsp and golint.
57
58 For more details, see [the documentation](./doc/vim-lsp-ale.txt).
59
60 ## Testing
61
62 There are unit tests and integration tests. CI runs on GitHub Actions.
63 See [test/README.md](./test/README.md) for more details.
64
65 ## License
66
67 Licensed under [the MIT license](./LICENSE).
68
69 [vim-lsp]: https://github.com/prabirshrestha/vim-lsp
70 [ALE]: https://github.com/dense-analysis/ale
71 [vim-lsp-ale]: https://github.com/rhysd/vim-lsp-ale
72 [ci-badge]: https://github.com/rhysd/vim-lsp-ale/workflows/CI/badge.svg?branch=master&event=push
73 [ci]: https://github.com/rhysd/vim-lsp-ale/actions?query=workflow%3ACI+branch%3Amaster
74 [codecov-badge]: https://codecov.io/gh/rhysd/vim-lsp-ale/branch/master/graph/badge.svg
75 [codecov]: https://codecov.io/gh/rhysd/vim-lsp-ale