Comments (4)
This should be easy to implement. Need to update s:python_refresh_completions
.
Here is the pseudo code.
for [l:name, l:info] in sort_by_priority(items(s:matches))
from asyncomplete.vim.
Hmm, I'm bad a Vim script, so this is probably inefficient. But wouldn't this work? Seems to do the trick when I tried it for a minute.
diff --git a/autoload/asyncomplete.vim b/autoload/asyncomplete.vim
index b102471..3fa7e6c 100644
--- a/autoload/asyncomplete.vim
+++ b/autoload/asyncomplete.vim
@@ -326,6 +326,7 @@ function! s:python_refresh_completions(ctx) abort
let l:filtered_matches = []
+ let l:matches = filter(copy(l:matches), 'index(l:matches, v:val, v:key+1) == -1')
let l:sources = sort(keys(s:matches), function('s:sort_sources_by_priority'))
for l:name in l:sources
Mostly stolen from https://stackoverflow.com/a/6630950/1862923
from asyncomplete.vim.
@Renstrom it works but could slow down if you have lot of items. If we put this behind a flag I'm ok with it. Feel free to send a PR.
Out of curiosity what language are you using? I mainly use typescript and I disable all buffer, syntax and omni sources when in Typescript. If I don't have a proper language server I use omni, followed by syntax and then buffer.
from asyncomplete.vim.
Feel free to send a PR.
I'll see what I can do.
Out of curiosity what language are you using?
Well mainly Python. But also a bunch of other languages every now and then like C/C++, Markdown, YAML, Go, Rust, Bash, Javascript, etc. But now that you mention it, I could certainly improve my white- and blacklists for my sources! I still think dedupe is a worthy feature though, especially coupled with priority (just noticed a bug in the diff, the dedupe should happen after sorting).
from asyncomplete.vim.
Related Issues (20)
- Completion of buffer/workspace content HOT 3
- Auto-select the first candidate in the popup HOT 4
- Unable to list all the matching candidates if struct having a lot of methods for Go HOT 1
- Enter a new line ONLY when nothing is selected?
- Popup doesn't show for eclipse-jdt-ls HOT 6
- Avoid crlf line endings HOT 13
- [help] Is it possible to limit completion to one level instead of searching recursively? HOT 1
- [Question] How to auto popup struct field or class memer in C/C++ when you type dot or -> HOT 4
- Vim9Script HOT 1
- Add smart-case sensitive completion HOT 1
- How to disable arguments hinting window ? HOT 1
- [feature-request] Use a customizable popup window instead of vim native completion popup ? HOT 1
- Completion menu is opening/closing rapidly HOT 1
- asyncomplete should popup only snippets
- Dependency Dashboard HOT 1
- Strange behaviour with vim-lsp+clangd+asyncomplete-lsp HOT 1
- different complete behavier when open a file directly and enter nvim then use `e` command. HOT 1
- asyncomplete lags during gdscript completion (godot lsp) HOT 2
- Omni-completion is causing some issue with autocomplete, and doesn't work most of the time HOT 1
- nextword auto complete not working
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 asyncomplete.vim.