ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.44k stars 2.81k forks source link

Not an option to set how long for timeout #742

Closed fasterpython closed 10 years ago

fasterpython commented 10 years ago

My project uses Boost that is slow for compiling. I have compiled 'ycm_support_libs' said in the doc, but it seems not much help.

Now ycm is always timeout at trying auto-compete, with message below:

HTTPConnectionPool(host='localhost', port=37075): Read timed out. (read timeout=0.5)

If I try a simple project, Ycm just works fine. (With the old version, Ycm might take about 2 seconds to parse and then do auto-complete.)

There is not an option to set how long for timeout, what about add such an option?

I'm using Intel I7 cpu, and my project is not too large (about 3000 lines of code), but it uses Boost. How can I make it fast for YCM while doing auto-complete?

Valloric commented 10 years ago

You probably have an error in your include files which is preventing Clang from creating a precompiled preamble. This is why your calls to ycmd are timing out.

There is no option to change the timeout value because you should never need it to be higher than 0.5 seconds. If that's not high enough, you have a different problem you need to fix.

fasterpython commented 10 years ago

The project can be compiled sucessed without any warnings or errors. How to find out the error you said “ You probably have an error in your include files which is preventing Clang from creating a precompiled preamble. ” ? Thanks

Valloric commented 10 years ago

You're probably not giving YCM the correct compilation flags.

yumengjie1990 commented 10 years ago

I met the same problem. Sometimes it shows "Still parsing file, no completions yet". How could I debug it?

yumengjie1990 commented 10 years ago

And, auto-compete worked well in previous ycm version, with the same .ycm_extra_conf.py for my project.

axper commented 10 years ago

This happens in python projects as well, so I don't think it has something to do with clang.

ysheng26 commented 10 years ago

This also happens when using Numpy, are there anything we can do to avoid this?

ScorpiusZ commented 9 years ago

also happens in python when using panda,what can i do to fix it?

josefson commented 9 years ago

In my computer, it happens with most of python imports: os, re, requests, beautiful soup, selenium, i could go on and on. I had actually stopped using ycm and started using jedi-vim because of this annoying error, but i actually like the fuzzy completion. I think i will do what @tortoisechan suggested on #777 and see how that goes. But then again, why not making this an option to be set at one's vimrc?

balta2ar commented 8 years ago

Same problem here, python projects.

puremourning commented 8 years ago

@mzavoloka thanks for the report. However, this is a very old issue related to the C++ semantic engine.

If you're having problems with YCM, I'd suggest you follow the instructions in CONTRIBUTING.md. and raise a new issue. While, we're always willing to help, unfortunately, responses like "this is still a problem in [potentially different scenario]" don't help us diagnose the original problem. Val suggested the original problem was probably with compiler flags, which is certainly a possibility, but would not be relevant to Python or OmniSharp completers.

In order to really understand why this is affecting your systems (it has literally never happened for me!), we need as much diagnostic data as we can.

From CONTRIBUTING.md:

If we can't reproduce the issue, then we can't fix it. It's that simple.

art-solopov commented 8 years ago

Same problem, a Python script linked to Matplotlib.

import matplotlib.pyplot as plt

nums = [[i, i] for i in range(100)]

plt.plot([i[0] for i in nums], [i[-1] for i in nums], 'bo')
plt.show()
vheon commented 8 years ago

@art-solopov does it happen only on the first try or always?

puremourning commented 8 years ago

I must confess that I often get timeouts at work. Typically you just keep typing and then get completion from the cache, or hit <ctrl-space> after getting bored waiting for completions to arrive.

vheon commented 8 years ago

@puremourning I was asking because for python usually the slownes is just for the first . because it has to load the module, and then is fast because it has it in cache. So I was thinking of adding the OnFileReadyToParse to the jedi_completer to preload the imports in the file. Just an idea, I don't even know if it would help :stuck_out_tongue_closed_eyes:

puremourning commented 8 years ago

neat idea

art-solopov commented 8 years ago

@vheon It's weird. With plt. from my first example, it happens always. If I write import matplotlib, then save, and then write matplotlib., the completion works.

vheon commented 8 years ago

@art-solopov so you do plt. and you get the timeout; then if you delete the . and re-type it you get the timeout again?

If I write import matplotlib, then save, and then write matplotlib., the completion works.

but what happen after you use matplotlib.pyplot.?

r4nt commented 8 years ago

Note that I also see this happening with gocode when triggering completion on large namespaces (fmt. / ioutil.)

oblitum commented 8 years ago

@r4nt's comments relates with this comment I've posted on https://github.com/Valloric/YouCompleteMe/issues/777#issuecomment-236626561.

marxin commented 7 years ago

I'm adding another context where I see timeouts: having a rich C++ code (GCC source files) and running a make that utilizes all CPUs can increase duration of Completion requests. I would still consider it usefull to have a g:ycm_* option, however editting completion_request.py works for me.

Adding time duration of particular requests is also usefull for me. If the patch is desired for master, I can prepare a patch?