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.
1 *vim-lsp-ale.txt* Bridge between vim-lsp and ALE
3 Author: rhysd <https://rhysd.github.io>
5 CONTENTS *vim-lsp-ale-contents*
7 Introduction |vim-lsp-ale-introduction|
8 Install |vim-lsp-ale-install|
9 Usage |vim-lsp-ale-usage|
10 Variables |vim-lsp-ale-variables|
11 Functions |vim-lsp-ale-functions|
12 Issues |vim-lsp-ale-issues|
13 License |vim-lsp-ale-license|
16 ==============================================================================
17 INTRODUCTION *vim-lsp-ale-introduction*
19 *vim-lsp-ale* is a plugin for bridge between |vim-lsp| and |ale|.
21 When using ALE and vim-lsp, both plugins run language server process
22 respectively. It's resource consuming and may cause some issues due to
23 multiple server processes running at the same time.
25 |vim-lsp-ale| solves the problem by getting diagnostics results from vim-lsp
26 and by sending them to ALE. It means vim-lsp can be handled as one of linters
29 It's also possible to disable LSP features in ALE and use both ALE and
30 vim-lsp's |:LspDocumentDiagnostics| together. But managing linter results
31 with multiple plugins is complicated and confusing since behaviors of each
32 plugins are not persistent.
34 Screencast: https://github.com/rhysd/ss/blob/master/vim-lsp-ale/main.gif
36 ==============================================================================
37 INSTALL *vim-lsp-ale-install*
39 Install |ale|, |vim-lsp| and |vim-lsp-ale| with your favorite plugin manager
41 The following is an example using vim-plug.
44 Plug 'dense-analysis/ale'
45 Plug 'prabirshrestha/vim-lsp'
46 Plug 'rhysd/vim-lsp-ale'
50 - ALE: https://github.com/dense-analysis/ale/
51 - vim-lsp: https://github.com/prabirshrestha/vim-lsp
52 - vim-lsp-ale: https://github.com/rhysd/vim-lsp-ale
55 ==============================================================================
56 USAGE *vim-lsp-ale-usage*
58 Register LSP servers you want to use with |lsp#register_server()| and set
59 "vim-lsp" linter to |g:ale_linters| for filetypes you want to check with
62 The following example configures gopls and golint to check Go sources. ALE
63 will automatically reports diagnostics results from gopls and lint errrors
64 from golint when you're writing Go source code.
66 if executable('gopls')
67 autocmd User lsp_setup call lsp#register_server({
70 \ 'allowlist': ['go', 'gomod'],
74 \ 'go': ['vim-lsp', 'golint'],
77 gopls: https://github.com/golang/tools/tree/master/gopls
79 vim-lsp-ale configures vim-lsp and ALE automatically. You don't need to setup
80 various variables for them.
82 vim-lsp-ale automatically does:
84 - disable showing diagnostics results from vim-lsp since ALE will show the
86 - disable LSP support of ALE since vim-lsp handles all LSP requests/responses
88 If you don't want them to be done automatically, see
89 |g:lsp_ale_auto_config_vim_lsp| and |g:lsp_ale_auto_config_ale|
92 ==============================================================================
93 VARIABLES *vim-lsp-ale-variables*
95 Behavior of vim-lsp-ale can be customized with some global variables.
97 ------------------------------------------------------------------------------
98 *g:lsp_ale_auto_config_vim_lsp* (Default: |v:true|)
100 When |v:true| is set, vim-lsp-ale automatically sets several variables
101 for configuring vim-lsp not to show diagnostics results in vim-lsp side.
103 At the time of writing, setting |v:true| is the same as:
105 let g:lsp_diagnostics_enabled = 1
106 let g:lsp_diagnostics_echo_cursor = 0
107 let g:lsp_diagnostics_float_cursor = 0
108 let g:lsp_diagnostics_highlights_enabled = 0
109 let g:lsp_diagnostics_signs_enabled = 0
110 let g:lsp_diagnostics_virtual_text_enabled = 0
112 When |v:false| is set, vim-lsp-ale does not set any variables to configure
113 vim-lsp so that you can configure them by yourself.
115 ------------------------------------------------------------------------------
116 *g:lsp_ale_auto_config_ale* (Default: |v:true|)
118 When |v:true| is set, vim-lsp-ale automatically sets several variables
119 for configuring ALE not to start LSP server process.
121 At the time of writing, setting |v:true| is the same as:
123 let g:ale_disable_lsp = 1
125 When |v:false| is set, vim-lsp-ale does not set any variables to configure
126 ALE so that you can configure them by yourself.
128 ------------------------------------------------------------------------------
129 *g:lsp_ale_auto_enable_linter* (Default: |v:true|)
131 When |v:true| is set, vim-lsp-ale automatically enables itself as a linter for
132 all filetypes. It does not modify |g:ale_linters|.
134 When |v:false| is set, vim-lsp-ale is only active when configured as a linter
137 let g:ale_linters = {
139 \ 'lua': ['vim-lsp'],
140 \ 'python': ['vim-lsp'],
143 ------------------------------------------------------------------------------
144 *g:lsp_ale_diagnostics_severity* (Default: "information")
146 Severity level of reported diagnostics results. Possible values are "error",
147 "warning", "information", "hint". Diagnostics results will be filtered by the
148 severity set to this variable.
149 For example, when "warning" is set, "error"/"warning" results are shown
150 and "information"/"hint" results are not shown.
153 ==============================================================================
154 FUNCTIONS *vim-lsp-ale-functions*
156 ------------------------------------------------------------------------------
157 lsp#ale#enable() *lsp#ale#enable*
159 Enables bridge between vim-lsp and ALE. This function is automatically called
160 when |lsp_setup| autocmd event is triggered by vim-lsp. So basically you don't
161 need to call this function.
163 ------------------------------------------------------------------------------
164 lsp#ale#disable() *lsp#ale#disable*
166 Disables bridge between vim-lsp and ALE. After this function is called,
167 diagnostics results will no longer be sent to ALE until |lsp#ale#enable| is
170 ------------------------------------------------------------------------------
171 lsp#ale#enabled() *lsp#ale#enabled*
173 Returns whether bridge between vim-lsp and ALE is enabled.
176 ==============================================================================
177 ISSUES *vim-lsp-ale-issues*
179 When you find some issues or you have some feature requests to vim-lsp-ale,
180 visit GitHub repository page and make a new issue:
182 https://github.com/rhysd/vim-lsp-ale/issues/new
185 ==============================================================================
186 LICENSE *vim-lsp-ale-license*
188 vim-lsp-ale is distributed under the MIT license.
190 The MIT License (MIT)
192 Copyright (c) 2021 rhysd
194 Permission is hereby granted, free of charge, to any person obtaining a copy
195 of this software and associated documentation files (the "Software"), to deal
196 in the Software without restriction, including without limitation the rights
197 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
198 of the Software, and to permit persons to whom the Software is furnished to do so,
199 subject to the following conditions:
201 The above copyright notice and this permission notice shall be included in all
202 copies or substantial portions of the Software.
204 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
205 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
206 PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
207 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
208 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
209 THE USE OR OTHER DEALINGS IN THE SOFTWARE.
212 ==============================================================================
213 vim:tw=78:ts=8:ft=help:norl:et:fen:fdl=0: