nvim-lua / completion-nvim

A async completion framework aims to provide completion to neovim's built in LSP written in Lua
Apache License 2.0
973 stars 78 forks source link

Strange completion sorting with right behavior after backspace #401

Open ghost opened 3 years ago

ghost commented 3 years ago

Relevant information

Nvim v.0.5.0 LuaJIT 2.1.0-beta3 Clangd 12.0.1

init.vim

lua require'lspconfig'.clangd.setup{on_attach=require'completion'.on_attach} inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\"

set number set relativenumber set completeopt=menuone,noinsert,noselect set shortmess+=c let g:completion_matching_strategy_list = [ 'exact' , 'substring' , 'fuzzy' ] let g:completion_matching_ignore_case = 1 let g:completion_trigger_character = ['.', '->'] let g:completion_sorting = "length"

Issue and expectation

When I start to type vkimage I will get this when I get to letter i:

•VkImageFormatListCreateInfoKHR •VkFilter
•VkDeviceSize
•vkQueueWaitIdle(VkQueue queue)
•VkPipelineLayout
•VkSubmitInfo2KHR
•VkLayerProperties
...

Also, VkImage will not show up, even if I type the the whole word vkimage.

But, if I press backspace to remove letter i and type it again, I will get this:

•VkImage
•VkInstance
•VkImageType
•VkImageView
•VkIndexType
•VkIndexType
•VkImageCopy
•VkImageCopy
•VkImageType
...

Which is what I am expecting. I can reproduce this issue with other words too. Not sure how to start testing the root cause.