@@ -451,8 +451,9 @@ g:lsp_diagnostics_echo_delay *g:lsp_diagnostics_echo_delay*
451
451
Type: | Number |
452
452
Default: `500 `
453
453
454
- Delay milliseconds to echo diagnostic error for the current line to status. Requires
455
- | g:lsp_diagnostics_enabled | and | g:lsp_diagnostics_echo_cursor | set to 1.
454
+ Delay milliseconds to echo diagnostic error for the current line to status.
455
+ Requires | g:lsp_diagnostics_enabled | and | g:lsp_diagnostics_echo_cursor | set
456
+ to 1.
456
457
457
458
Example: >
458
459
let g:lsp_diagnostics_echo_delay = 200
@@ -462,8 +463,9 @@ g:lsp_diagnostics_float_cursor *g:lsp_diagnostics_float_cursor*
462
463
Type: | Number |
463
464
Default: `0 `
464
465
465
- Enables a floating window of diagnostic error for the current line to status. Requires
466
- nvim_win_open() or popup_create is available, and | g:lsp_diagnostics_enabled | set to 1.
466
+ Enables a floating window of diagnostic error for the current line to
467
+ status. Requires nvim_win_open() or popup_create is available, and
468
+ | g:lsp_diagnostics_enabled | set to 1.
467
469
468
470
Example: >
469
471
let g:lsp_diagnostics_float_cursor = 1
@@ -515,7 +517,7 @@ g:lsp_diagnostics_highlights_enabled *g:lsp_diagnostics_highlights_enabled*
515
517
highlight link LspErrorHighlight Error
516
518
517
519
g:lsp_diagnostics_highlights_insert_mode_enabled
518
- *g:lsp_diagnostics_highlights_insert_mode_enabled*
520
+ *g:lsp_diagnostics_highlights_insert_mode_enabled*
519
521
Type: | Number |
520
522
Default: `1 `
521
523
@@ -526,7 +528,7 @@ g:lsp_diagnostics_highlights_insert_mode_enabled
526
528
let g:lsp_diagnostics_highlights_insert_mode_enabled = 1
527
529
let g:lsp_diagnostics_highlights_insert_mode_enabled = 0
528
530
529
- g:lsp_diagnostics_highlights_delay *g:lsp_diagnostics_highlights_delay*
531
+ g:lsp_diagnostics_highlights_delay *g:lsp_diagnostics_highlights_delay*
530
532
Type: | Number |
531
533
Default: `500 `
532
534
@@ -883,7 +885,8 @@ g:lsp_snippet_expand *g:lsp_snippet_expand*
883
885
Type: | List |
884
886
885
887
The integration point to other snippet plugin.
886
- vim-lsp may invoke the first item of this value when it needs snippet expansion.
888
+ vim-lsp may invoke the first item of this value when it needs snippet
889
+ expansion.
887
890
888
891
g:lsp_completion_resolve_timeout *g:lsp_completion_resolve_timeout*
889
892
Type: | Number |
@@ -1073,19 +1076,19 @@ The vim |dict| containing information about the server.
1073
1076
For example: >
1074
1077
'config': { 'prefer_local': 1 }
1075
1078
<
1076
- This can then be used by cmd function.
1079
+ This can then be used by cmd function.
1077
1080
>
1078
- function! s:myserver_cmd(server_info) abort
1079
- let l:config = get(a:server_info, 'config', {})
1080
- let l:prefer_local = get(l:config, 'prefer_local', 1)
1081
- if (l:prefer_local)
1082
- return ['./local-executable']
1083
- else
1084
- return ['/bin/global-exectuable']
1085
- endif
1086
- endfunction
1087
-
1088
- 'cmd': function('s:myserver_cmd')
1081
+ function! s:myserver_cmd(server_info) abort
1082
+ let l:config = get(a:server_info, 'config', {})
1083
+ let l:prefer_local = get(l:config, 'prefer_local', 1)
1084
+ if (l:prefer_local)
1085
+ return ['./local-executable']
1086
+ else
1087
+ return ['/bin/global-exectuable']
1088
+ endif
1089
+ endfunction
1090
+
1091
+ 'cmd': function('s:myserver_cmd')
1089
1092
<
1090
1093
Using the `config` key, you can also specify a custom 'typed word
1091
1094
pattern', or a custom filter for completion items, see
@@ -1204,7 +1207,8 @@ You can use this function to add custom command handler.
1204
1207
})
1205
1208
<
1206
1209
1207
- For example, the rust-analyzer expects the client handles some custom command as below example.
1210
+ For example, the rust-analyzer expects the client handles some custom command
1211
+ as below example.
1208
1212
>
1209
1213
function! s:rust_analyzer_apply_source_change(context)
1210
1214
let l:command = get(a:context, 'command', {})
@@ -1227,17 +1231,16 @@ Stream api to listen to responses and notifications from language server or
1227
1231
vim-lsp. Always verify the existence of request, response and server before
1228
1232
accessing. Subscribing to stream should never throw an error.
1229
1233
>
1230
- function! s:on_textDocumentDiagnostics(x) abort
1231
- echom 'Diagnostics for ' . a:x['server' ] . ' ' . json_encode(a:x['response' ])
1232
- endfunction
1233
-
1234
- au User lsp_setup call lsp#callbag#pipe(
1235
- \ lsp#stream(),
1236
- \ lsp#callbag#filter({x-> has_key(x, 'response' ) && !has_key(x['response' ], 'error' ) && get(x['response' ], 'method' , '') == 'textDocument/publishDiagnostics'}),
1237
- \ lsp#callbag#subscribe({ 'next' :{x->s:on_textDocumentDiagnostics(x)} }),
1238
- \ )
1239
- <
1234
+ function! s:on_textDocumentDiagnostics(x) abort
1235
+ echom 'Diagnostics for ' . a:x['server'] . ' ' . json_encode(a:x['response'])
1236
+ endfunction
1240
1237
1238
+ au User lsp_setup call lsp#callbag#pipe(
1239
+ \ lsp#stream(),
1240
+ \ lsp#callbag#filter({x-> has_key(x, 'response') && !has_key(x['response'], 'error') && get(x['response'], 'method', '') == 'textDocument/publishDiagnostics'}),
1241
+ \ lsp#callbag#subscribe({ 'next':{x->s:on_textDocumentDiagnostics(x)} }),
1242
+ \ )
1243
+ <
1241
1244
Custom vim-lsp notifications streams:
1242
1245
vimp-lsp events mimic lsp server notifications.
1243
1246
* `server` is always `$vimlsp ` .
@@ -1271,7 +1274,6 @@ lsp#get_server_status({name-of-server}) *lsp#get_server_status()*
1271
1274
1272
1275
Get the status of a server.
1273
1276
1274
-
1275
1277
Example: >
1276
1278
call lsp#get_server_status('name-of-server')
1277
1279
<
@@ -1326,7 +1328,7 @@ This method is mainly used to generate 'root_uri' when registering server.
1326
1328
* If there is not directory with the specific files or diretories
1327
1329
found, the method will return an empty string.
1328
1330
1329
- lsp#enable_diagnostics_for_buffer() *lsp#enable_diagnotics_for_buffer ()*
1331
+ lsp#enable_diagnostics_for_buffer() *lsp#enable_diagnostic_for_buffer ()*
1330
1332
1331
1333
Re-enable diagnsostics for the specified buffer. By default diagnostics are
1332
1334
enabled for all buffers.
@@ -1817,8 +1819,8 @@ https://github.com/thomasfaingnaert/vim-lsp-ultisnips
1817
1819
https://github.com/Shougo/neosnippet.vim
1818
1820
https://github.com/thomasfaingnaert/vim-lsp-neosnippet
1819
1821
1820
- Refer to the readme and docs of vim-vsnip, vim-lsp-ultisnips and vim-lsp-neosnippet
1821
- for more information and configuration options.
1822
+ Refer to the readme and docs of vim-vsnip, vim-lsp-ultisnips and
1823
+ vim-lsp-neosnippet for more information and configuration options.
1822
1824
1823
1825
==============================================================================
1824
1826
Folding *vim-lsp-folding*
@@ -1850,7 +1852,7 @@ To display open and closed folds at the side of the window, see
1850
1852
If you want to remove the dashes at the end of the folds, you can change
1851
1853
the fold item of 'fillchars' .
1852
1854
1853
- ===============================================================================
1855
+ ==============================================================================
1854
1856
Semantic highlighting *vim-lsp-semantic*
1855
1857
1856
1858
To use semantic highlighting, you need Neovim highlights, or Vim with the
@@ -1929,7 +1931,7 @@ want function calls to still use the |Label| group, but use |Identifier| for
1929
1931
\ }
1930
1932
\ })
1931
1933
<
1932
- ===============================================================================
1934
+ ==============================================================================
1933
1935
License *vim-lsp-license*
1934
1936
1935
1937
The MIT License (MIT)
0 commit comments