]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp-ale/doc/vim-lsp-ale.txt

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 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / vim-lsp-ale / doc / vim-lsp-ale.txt
1 *vim-lsp-ale.txt*                   Bridge between vim-lsp and ALE
2
3 Author: rhysd <https://rhysd.github.io>
4
5 CONTENTS                            *vim-lsp-ale-contents*
6
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|
14
15
16 ==============================================================================
17 INTRODUCTION                                          *vim-lsp-ale-introduction*
18
19 *vim-lsp-ale* is a plugin for bridge between |vim-lsp| and |ale|.
20
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.
24
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
27 supported by ALE.
28
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.
33
34 Screencast: https://github.com/rhysd/ss/blob/master/vim-lsp-ale/main.gif
35
36 ==============================================================================
37 INSTALL                                                    *vim-lsp-ale-install*
38
39 Install |ale|, |vim-lsp| and |vim-lsp-ale| with your favorite plugin manager
40 or using |:packadd|.
41 The following is an example using vim-plug.
42
43 >
44   Plug 'dense-analysis/ale'
45   Plug 'prabirshrestha/vim-lsp'
46   Plug 'rhysd/vim-lsp-ale'
47 <
48 Repositories:
49
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
53
54
55 ==============================================================================
56 USAGE                                                        *vim-lsp-ale-usage*
57
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
60 vim-lsp.
61
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.
65 >
66   if executable('gopls')
67       autocmd User lsp_setup call lsp#register_server({
68           \ 'name': 'gopls',
69           \ 'cmd': ['gopls'],
70           \ 'allowlist': ['go', 'gomod'],
71           \ })
72   endif
73   let g:ale_linters = {
74       \   'go': ['vim-lsp', 'golint'],
75       \ }
76 <
77 gopls: https://github.com/golang/tools/tree/master/gopls
78
79 vim-lsp-ale configures vim-lsp and ALE automatically. You don't need to setup
80 various variables for them.
81
82 vim-lsp-ale automatically does:
83
84 - disable showing diagnostics results from vim-lsp since ALE will show the
85   results
86 - disable LSP support of ALE since vim-lsp handles all LSP requests/responses
87
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|
90
91
92 ==============================================================================
93 VARIABLES                                                *vim-lsp-ale-variables*
94
95 Behavior of vim-lsp-ale can be customized with some global variables.
96
97 ------------------------------------------------------------------------------
98 *g:lsp_ale_auto_config_vim_lsp* (Default: |v:true|)
99
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.
102
103 At the time of writing, setting |v:true| is the same as:
104 >
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
111 <
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.
114
115 ------------------------------------------------------------------------------
116 *g:lsp_ale_auto_config_ale* (Default: |v:true|)
117
118 When |v:true| is set, vim-lsp-ale automatically sets several variables
119 for configuring ALE not to start LSP server process.
120
121 At the time of writing, setting |v:true| is the same as:
122 >
123   let g:ale_disable_lsp = 1
124 <
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.
127
128 ------------------------------------------------------------------------------
129 *g:lsp_ale_auto_enable_linter* (Default: |v:true|)
130
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|.
133
134 When |v:false| is set, vim-lsp-ale is only active when configured as a linter
135 for a filetype:
136 >
137   let g:ale_linters = {
138       \   'go':     ['vim-lsp'],
139       \   'lua':    ['vim-lsp'],
140       \   'python': ['vim-lsp'],
141       \ }
142 <
143 ------------------------------------------------------------------------------
144 *g:lsp_ale_diagnostics_severity* (Default: "information")
145
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.
151
152
153 ==============================================================================
154 FUNCTIONS                                                *vim-lsp-ale-functions*
155
156 ------------------------------------------------------------------------------
157 lsp#ale#enable()                                                *lsp#ale#enable*
158
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.
162
163 ------------------------------------------------------------------------------
164 lsp#ale#disable()                                              *lsp#ale#disable*
165
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
168 called again.
169
170 ------------------------------------------------------------------------------
171 lsp#ale#enabled()                                              *lsp#ale#enabled*
172
173 Returns whether bridge between vim-lsp and ALE is enabled.
174
175
176 ==============================================================================
177 ISSUES                                                      *vim-lsp-ale-issues*
178
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:
181
182 https://github.com/rhysd/vim-lsp-ale/issues/new
183
184
185 ==============================================================================
186 LICENSE                                                    *vim-lsp-ale-license*
187
188 vim-lsp-ale is distributed under the MIT license.
189 >
190   The MIT License (MIT)
191
192   Copyright (c) 2021 rhysd
193
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:
200
201   The above copyright notice and this permission notice shall be included in all
202   copies or substantial portions of the Software.
203
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.
210 <
211
212 ==============================================================================
213 vim:tw=78:ts=8:ft=help:norl:et:fen:fdl=0: