Comments (3)
It turns out that gopls
pre-selects an item each time an auto-completion list is generated. And gopls
's pre-selection does not respect the ordering of the list generated by the completion source. As a workaround, you can prevent this behavior by setting preselect
to cmp.PreselectMode.None
. E.g:
local cmp = require("cmp")
cmp.setup({
preselect = cmp.PreselectMode.None
})
from nvim-cmp.
It turns out that
gopls
pre-selects an item each time an auto-completion list is generated. Andgopls
's pre-selection does not respect the ordering of the list generated by the completion source. This behavior can be prevented by settingpreselect
tocmp.PreselectMode.None
. E.g:local cmp = require("cmp") cmp.setup({ preselect = cmp.PreselectMode.None })
With this setting there is no preselect at all. What if I want the first one to be selected always?
from nvim-cmp.
The problem is that nvim-cmp
reorders the items of the completion list dynamically. What this means is that the order of items in the completion list depends on the current state of the source file. For example, if the name of a function has already appeared in the file at least once, then that item will be placed higher up the list. I've already described the issue in detail here: golang/go#61533 (comment)
Unfortunatly, nvim-cmp
's dynamic reordering does not take LSP preselection into account. By right, nvim-cmp
should place the item that is preselected by the LSP at the top of the list. That is why I resorted to turn off the preselect
feature altogether.
I can reopen this issue if you want. But at the moment, I'm not interested in any further investigation into this issue.
from nvim-cmp.
Related Issues (20)
- lua print(require("cmp")) -> ture
- feature request: support labeldetail field HOT 2
- [NEED HELP] What kind of popup is this? It blocks the completion list and I canβt see it. HOT 3
- The wrong suggestion gets confirmed HOT 1
- Feature Request: Use headlines.nvim for Rendering Markdown in Documentation Window
- Parsing error: Error 08:05:18 notify.error ...local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/snippet.lua:411: snippet parsing failed. HOT 5
- luarocks package very outdated
- Cmp Menu is occupying unnecessary space HOT 1
- feature-request: allow more control over completion highlight HOT 2
- How to change the completion sources based on line contents HOT 1
- `<C-p>` does not move the cursor up correctly
- Expanding `%` on cmdline keeps percent sign at the beginning of path
- Completion not working HOT 1
- how to make tab compeletion ignore the word that already compeleted HOT 3
- Long startup times HOT 1
- Emmet-ls completion for sass/scss variables fails
- Created a custom plugin, it loads but I get `cache.lua invalid value (table) at index 2 `
- `SelectBehavior.insert` merges completion with a following text
- [Feature request] wildmenu view for cmdline with multiple horizontal lines HOT 3
- cmp.core:prepare() is expansive and calls for every InsertEnter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-cmp.