Skip to content

Commit ce3add9

Browse files
authored
Fix document layout and misspellings (#1127)
* fix document layout * fix misspellings
1 parent 4d4a908 commit ce3add9

File tree

6 files changed

+43
-41
lines changed

6 files changed

+43
-41
lines changed

autoload/lsp.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function! lsp#print_server_status() abort
156156
endfunction
157157

158158
" @params {server_info} = {
159-
" 'name': 'go-langserver', " requried, must be unique
159+
" 'name': 'go-langserver', " required, must be unique
160160
" 'allowlist': ['go'], " optional, array of filetypes to allow, * for all filetypes
161161
" 'blocklist': [], " optional, array of filetypes to block, * for all filetypes,
162162
" 'cmd': {server_info->['go-langserver]} " function that takes server_info and returns array of cmd and args, return empty if you don't want to start the server

autoload/lsp/callbag.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ endfunction
14641464
" \ 'env': {},
14651465
" \ })
14661466
" call s:Stdin(1, 'hi')
1467-
" call s:Stdin(2, lsp#callbag#undefined()) " requried to close stdin
1467+
" call s:Stdin(2, lsp#callbag#undefined()) " required to close stdin
14681468
function! lsp#callbag#spawn(cmd, ...) abort
14691469
let l:data = { 'cmd': a:cmd, 'opt': a:0 > 0 ? copy(a:000[0]) : {} }
14701470
return lsp#callbag#create(function('s:spawnCreate', [l:data]))

autoload/lsp/internal/diagnostics/virtual_text.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function! lsp#internal#diagnostics#virtual_text#_enable() abort
4949
let s:enabled = 1
5050

5151
if empty(s:namespace_id)
52-
let s:namespace_id = nvim_create_namespace('vim_lsp_diagnotics_virtual_text')
52+
let s:namespace_id = nvim_create_namespace('vim_lsp_diagnostic_virtual_text')
5353
endif
5454

5555
let s:Dispose = lsp#callbag#pipe(

autoload/lsp/internal/document_range_formatting.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" options - {
22
" bufnr: bufnr('%') " required
3-
" type: '' " optional: defaults to visualmode(). overriden by opfunc
3+
" type: '' " optional: defaults to visualmode(). overridden by opfunc
44
" server - 'server_name' " optional
55
" sync: 0 " optional, defaults to 0 (async)
66
" }

autoload/lsp/ui/vim/completion.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ endfunction
2929
" 6. then the line is `call getbufline(|` in `s:on_complete_done_after`
3030
"
3131
function! s:on_complete_done() abort
32-
" Somtimes, vim occurs `CompleteDone` unexpectedly.
32+
" Sometimes, vim occurs `CompleteDone` unexpectedly.
3333
" We try to detect it by checking empty completed_item.
3434
if empty(v:completed_item) || get(v:completed_item, 'word', '') ==# '' && get(v:completed_item, 'abbr', '') ==# ''
3535
doautocmd <nomodeline> User lsp_complete_done

doc/vim-lsp.txt

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,9 @@ g:lsp_diagnostics_echo_delay *g:lsp_diagnostics_echo_delay*
451451
Type: |Number|
452452
Default: `500`
453453

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.
456457

457458
Example: >
458459
let g:lsp_diagnostics_echo_delay = 200
@@ -462,8 +463,9 @@ g:lsp_diagnostics_float_cursor *g:lsp_diagnostics_float_cursor*
462463
Type: |Number|
463464
Default: `0`
464465

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.
467469

468470
Example: >
469471
let g:lsp_diagnostics_float_cursor = 1
@@ -515,7 +517,7 @@ g:lsp_diagnostics_highlights_enabled *g:lsp_diagnostics_highlights_enabled*
515517
highlight link LspErrorHighlight Error
516518
517519
g:lsp_diagnostics_highlights_insert_mode_enabled
518-
*g:lsp_diagnostics_highlights_insert_mode_enabled*
520+
*g:lsp_diagnostics_highlights_insert_mode_enabled*
519521
Type: |Number|
520522
Default: `1`
521523

@@ -526,7 +528,7 @@ g:lsp_diagnostics_highlights_insert_mode_enabled
526528
let g:lsp_diagnostics_highlights_insert_mode_enabled = 1
527529
let g:lsp_diagnostics_highlights_insert_mode_enabled = 0
528530
529-
g:lsp_diagnostics_highlights_delay *g:lsp_diagnostics_highlights_delay*
531+
g:lsp_diagnostics_highlights_delay *g:lsp_diagnostics_highlights_delay*
530532
Type: |Number|
531533
Default: `500`
532534

@@ -883,7 +885,8 @@ g:lsp_snippet_expand *g:lsp_snippet_expand*
883885
Type: |List|
884886

885887
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.
887890

888891
g:lsp_completion_resolve_timeout *g:lsp_completion_resolve_timeout*
889892
Type: |Number|
@@ -1073,19 +1076,19 @@ The vim |dict| containing information about the server.
10731076
For example: >
10741077
'config': { 'prefer_local': 1 }
10751078
<
1076-
This can then be used by cmd function.
1079+
This can then be used by cmd function.
10771080
>
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')
10891092
<
10901093
Using the `config` key, you can also specify a custom 'typed word
10911094
pattern', or a custom filter for completion items, see
@@ -1204,7 +1207,8 @@ You can use this function to add custom command handler.
12041207
})
12051208
<
12061209

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.
12081212
>
12091213
function! s:rust_analyzer_apply_source_change(context)
12101214
let l:command = get(a:context, 'command', {})
@@ -1227,17 +1231,16 @@ Stream api to listen to responses and notifications from language server or
12271231
vim-lsp. Always verify the existence of request, response and server before
12281232
accessing. Subscribing to stream should never throw an error.
12291233
>
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
12401237
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+
<
12411244
Custom vim-lsp notifications streams:
12421245
vimp-lsp events mimic lsp server notifications.
12431246
* `server` is always `$vimlsp`.
@@ -1271,7 +1274,6 @@ lsp#get_server_status({name-of-server}) *lsp#get_server_status()*
12711274

12721275
Get the status of a server.
12731276

1274-
12751277
Example: >
12761278
call lsp#get_server_status('name-of-server')
12771279
<
@@ -1326,7 +1328,7 @@ This method is mainly used to generate 'root_uri' when registering server.
13261328
* If there is not directory with the specific files or diretories
13271329
found, the method will return an empty string.
13281330

1329-
lsp#enable_diagnostics_for_buffer() *lsp#enable_diagnotics_for_buffer()*
1331+
lsp#enable_diagnostics_for_buffer() *lsp#enable_diagnostic_for_buffer()*
13301332

13311333
Re-enable diagnsostics for the specified buffer. By default diagnostics are
13321334
enabled for all buffers.
@@ -1817,8 +1819,8 @@ https://github.com/thomasfaingnaert/vim-lsp-ultisnips
18171819
https://github.com/Shougo/neosnippet.vim
18181820
https://github.com/thomasfaingnaert/vim-lsp-neosnippet
18191821

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.
18221824

18231825
==============================================================================
18241826
Folding *vim-lsp-folding*
@@ -1850,7 +1852,7 @@ To display open and closed folds at the side of the window, see
18501852
If you want to remove the dashes at the end of the folds, you can change
18511853
the fold item of 'fillchars'.
18521854

1853-
===============================================================================
1855+
==============================================================================
18541856
Semantic highlighting *vim-lsp-semantic*
18551857

18561858
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
19291931
\ }
19301932
\ })
19311933
<
1932-
===============================================================================
1934+
==============================================================================
19331935
License *vim-lsp-license*
19341936

19351937
The MIT License (MIT)

0 commit comments

Comments
 (0)