Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong completion with more than 10 (ten) imports #3291

Closed
10 of 12 tasks
chrishaig14 opened this issue Jan 7, 2019 · 2 comments
Closed
10 of 12 tasks

Wrong completion with more than 10 (ten) imports #3291

chrishaig14 opened this issue Jan 7, 2019 · 2 comments

Comments

@chrishaig14
Copy link

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • I have read and understood YCM's [CONTRIBUTING][cont] document.
  • I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
  • I have read and understood YCM's [README][readme], especially the
    [Frequently Asked Questions][faq] section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. ([Example Google
    search.][search])
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

  • What did you do?

test.py:

class Test1:
    def __init__(self,a):
        self.a = a
 # Test2, Test3, ..., Test11 exactly the same as above

main.py:

from test import Test1, Test2, Test3, Test4, Test5, Test6, Test7, Test8, Test9, Test10, Test11
t = Te#<C-Space> here
  • What did you expect to happen?

Should suggest:

  ~       Test1                 c class Test1                                               
  ~       Test2                 c class Test2                                               
  ~       Test3                 c class Test3                                               
  ~       Test4                 c class Test4                                               
             ...                                            
  ~       Test11                c class Test11                  
  • What actually happened?

Instead, I get "module" and not "class":

  ~       Test1                 m module Test1                                               
  ~       Test2                 m module Test2                                               
  ~       Test3                 m module Test3                                               
  ~       Test4                 m module Test4                                               
            ...                                        
  ~       Test11                m module Test11                

I don't get the __init__ documentation in the scratch window. But it still works OK for any other completion besides the constructor, e.g. if I type t = Test7() and then t.#<C-Space> it actually shows 'a'.

It works fine with less than 11 imports

Diagnostic data

Output of vim --version

gist

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Client logfile: /tmp/ycm_MQWL3B.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.6.6
-- Server has Clang support compiled in: False
-- Clang version: None
-- No extra configuration file found
-- Python completer debug information:
-- Python interpreter: /usr/bin/python3
-- Python path: ['/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dyn
load', '/home/chris/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packa
ges', '/usr/lib/python3/dist-packages']
-- Python version: 3.6.6
-- Jedi version: 0.13.1
-- Parso version: 0.3.1
-- Server running at: http://127.0.0.1:51799
-- Server process ID: 13866
-- Server logfiles:
-- /tmp/ycmd_51799_stdout_FSzsak.log
-- /tmp/ycmd_51799_stderr_L3i_1G.log

Contents of YCM, ycmd and completion engine logfiles

Add let g:ycm_log_level = 'debug' to vimrc, restart Vim, reproduce the
issue, and include link here to a [gist][] containing the entire logfiles for
ycm, ycmd and any completer logfiles listed by :YcmToggleLogs.

I triggered completion just before this point

   2019-01-07 13:49:38,196 - INFO - Received completion request
   2019-01-07 13:49:38,196 - DEBUG - Using filetype completion: True
   2019-01-07 13:49:40,142 - INFO - Received event notification
   2019-01-07 13:49:40,142 - DEBUG - Event name: FileReadyToParse
   2019-01-07 13:49:40,142 - INFO - Adding buffer identifiers for file: /home/chris/code/importtest/main.py
   2019-01-07 13:49:40,148 - INFO - Received event notification
   2019-01-07 13:49:40,148 - DEBUG - Event name: InsertLeave
   2019-01-07 13:49:40,148 - INFO - Adding ONE buffer identifier for file: /home/chris/code/importtest/main.py
   2019-01-07 13:49:45,387 - INFO - Received debug info request
   2019-01-07 13:49:51,157 - INFO - Received debug info request 
   2019-01-07 13:49:53,025 - INFO - Received debug info request

I see nothing relevant in the other logs listed.

OS version, distribution, etc.

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

@micbou
Copy link
Collaborator

micbou commented Jan 7, 2019

Thanks for the report. This behavior is due to a Jedi workaround to improve responsiveness when completing modules like tensorflow. I am not a fan of this workaround and expressed my opinion about it in davidhalter/jedi#1116 (comment). Anyway, there is not much we can do except maybe convincing Jedi's author to revert this.

@bstaletic
Copy link
Collaborator

Since this is a Jedi "feature" and not a YCM bug, I'm going to close this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants