Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 3f2d3f0

Browse files
committed
README update
1 parent 78582e1 commit 3f2d3f0

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,18 @@ want more trigger characters, add it by
166166
let g:completion_trigger_character = ['.', '::']
167167
```
168168

169+
### Sorting completion items
170+
171+
- You can decide how your items being sorted in the popup menu. The default value
172+
is `"alphabet"`, change it by
173+
```.vim
174+
" possible value: "length", "alphabet", "none"
175+
let g:completion_sorting = "length"
176+
```
177+
178+
- If you don't want any sorting, you can set this value to `"none"`, however, you
179+
shouldn't be setting this if you have multiple sources enable.
180+
169181
*NOTE* use `:lua print(vim.inspect(vim.lsp.buf_get_clients()[1].server_capabilities.completionProvider.triggerCharacters))`
170182
to see the trigger character of your language server.
171183

@@ -187,6 +199,25 @@ augroup end
187199
let g:completion_timer_cycle = 200 "default value is 80
188200
```
189201

202+
## Compatibility with diagnostic-nvim
203+
204+
- This plugin only focus on the **completion** part of the built-in LSP. If you want setup in the diagnostic part
205+
(e.g. virtual text, jump through diagnostic, open line diagnostic automatically...), take a loot at [diagnostic-nvim]
206+
(https://github.com/haorenW1025/diagnostic-nvim).
207+
208+
- Both diagnostic-nvim and completion-nvim require setting up via `on_attach`. To use them together, create a wrapper
209+
function like this.
210+
211+
```vim
212+
lua << EOF
213+
local on_attach_vim = function()
214+
require'completion'.on_attach()
215+
require'diagnostic'.on_attach()
216+
end
217+
require'nvim_lsp'.pyls.setup{on_attach=on_attach}
218+
EOF
219+
```
220+
190221
## Trouble Shooting
191222

192223
- This plugin is in the early stages and might have unexpected issues.

0 commit comments

Comments
 (0)