Comments (14)
Strange. The old cache should be completely replaced, not updated. I can't reproduce your example, but I also noticed that it sometimes doesn't add [jedi]
for some completions until I try completing again.
from deoplete-jedi.
@tweekmonster
I was type
c
- <BS>
- s
- <BS>
- t
Maybe reproduced it.
I debbuging now.
from deoplete-jedi.
@tweekmonster
I found the regularity.
This seems more likely to occur in Python builtins
.
but, Sometimes it occurs even otherwise :(
from deoplete-jedi.
Hmm. Does deoplete.nvim modify the results dict? If so, that may be the problem.
On L183, try changing it to:
out = cached.get('completions', [])[:]
To return a copy of the cache.
from deoplete-jedi.
@tweekmonster Yes! I have found the cause.
If menu
is empty, deoplete.nvim
will be add self.mark
to menu
.
https://github.com/Shougo/deoplete.nvim/blob/master/rplugin/python3/deoplete/deoplete.py#L215-L221
It's not a bug. specification of deoplete.nvim
.
So, We need a
out.append({
'$type': _type,
'word': word,
'abbr': abbr,
'kind': self.format_description(c.description),
'info': docstring,
# this line
'menu': self.mark,
'dup': 1,
})
The problem does not occur.
from deoplete-jedi.
@zchee Great! Seems strange that it was accumulating marks though. Maybe that accumulation is a bug itself. If deoplete.nvim was adding it, that means it was no longer empty and shouldn't add it again.
from deoplete-jedi.
@tweekmonster Hmm...
Is that regex wrong?
re.match(r'\[.*\]', context['candidates'][0].get('menu', ''))):
from deoplete-jedi.
@zchee It's not wrong. The only issue I see with it is re.match()
vs re.search()
which may have unintended results. https://docs.python.org/3.4/library/re.html#search-vs-match
For example, if Base.mark
is set to ' [jedi]'
it won't match.
The issue I see is here: https://github.com/Shougo/deoplete.nvim/blob/master/rplugin/python3/deoplete/deoplete.py#L215
On that line, it only checks the first completion. If there are multiple sources mixed in the results, and the first one doesn't have menu
defined, all of them are updated even if other results already have the menu
key:
candidate['menu'] = source.mark + ' ' + candidate.get('menu', '')
from deoplete-jedi.
@tweekmonster OK. I understand.
and, Thanks for good reference :)
but, If fix deoplete.nvim
behavior to check all candidates['menu']
in context['candidates']
list, will reduce performance.
So, I think a better way is only to add 'menu': self.mark,
for now.
WDYT?
from deoplete-jedi.
@zchee That will work, but only for this case. If another source comes before Jedi, I think duplicates will happen again. I might be wrong since I don't know deoplete.nvim as well as you do.
For performance concerns, I think deoplete.nvim should not do the menu
update on L215. It should do it in merge_results()
since there is already a loop occurring there: https://github.com/Shougo/deoplete.nvim/blob/master/rplugin/python3/deoplete/deoplete.py#L248 (and it might need to happen on L238, too)
Actually I read over deoplete.py again, and I think I'm getting the indent scopes confused. Are the results from multiple sources combined before L215?
from deoplete-jedi.
@tweekmonster Yes, only for this case. I was known.
but, but... Now deoplete-jedi
master branch will occur self.mark
duplicate.
It will increase the other issue thread.
So, add 'menu': self.mark,
for now.
But, If I or you or Shougo resolved this problem someday, will revert (remove) 'menu': self.mark,
.
It's tentative workaround.
How would you like it? π
from deoplete-jedi.
@tweekmonster I also read deoplete.nvim
sources.
I will do my best to resolve.
from deoplete-jedi.
How would you like it? π
γγͺγγδΈεΈγ§γ π
from deoplete-jedi.
@tweekmonster lol.
Committed: a5b10f6
To avoid misunderstanding of the other users, close once.
but, We should remember this matter.
from deoplete-jedi.
Related Issues (20)
- Python completion sometimes produce noise HOT 2
- deoplete-jedi fails to load on vim + pynvim 0.4.0 HOT 6
- Deoplete-jedi causes vim to crash when editing a specific file HOT 4
- Option to disable/remove advanced/private members like __init__() HOT 1
- Add call signatures HOT 1
- broken with pandas completion HOT 10
- long stacktraces when completing docstring HOT 16
- no module named 'deoplete.base' HOT 3
- Deoplete throws error between two strings HOT 6
- Should `which pyenv` return a shell function in Fish? HOT 3
- Latest version of jedi crash on Windows HOT 8
- Changing the kind/type of completion-matches HOT 8
- Dont add parameter-information to functions HOT 6
- PosixPath object has not attribute 'endswidth' HOT 1
- Error from jedi: __init__() got an unexpected keyword argument 'code' HOT 4
- How I can turn off preview windows HOT 1
- deoplete-jedi crashes when trying to complete pandas DataFrame attributes HOT 3
- How to set autocomplete key to TAB? HOT 5
- Preview window doesn't show method signature HOT 5
- python versions for virtualenv HOT 3
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 deoplete-jedi.