@@ -166,6 +166,18 @@ want more trigger characters, add it by
166166let 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)) `
170182to see the trigger character of your language server.
171183
@@ -187,6 +199,25 @@ augroup end
187199let 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