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

YouCompleteMe works great for C/C++. Not so great for python (socket library) #2562

Closed
KraneBrain opened this issue Mar 3, 2017 · 11 comments · Fixed by #2768
Closed

YouCompleteMe works great for C/C++. Not so great for python (socket library) #2562

KraneBrain opened this issue Mar 3, 2017 · 11 comments · Fixed by #2768

Comments

@KraneBrain
Copy link

I've been extensively using YouCompleteMe for my C/C++ and I'm loving it. Truly fantastic.

I recently began python development and I feel like it's not nearly as impressive. For example in the below snippet

import socket
import sys

Create a TCP/IP socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.

There's no available autocomplete terms for sock functions such as connect, setblocking, recv, etc...

Is there something I'm doing wrong? The logs appear fine and there is certain autocompletion for most of python (such as time.sleep). It's also able to GoTo the socket library.

@vheon
Copy link
Contributor

vheon commented Mar 3, 2017

I've just tried and I get all the completion. The thing is that jedi at the first call for completion is a little slow but after that it caches all it needs and it starts giving you completion (whenever it can). It doesn't show completion even if you force it with <C-Space>?

@micbou
Copy link
Collaborator

micbou commented Mar 3, 2017

@KraneBrain What's the output of the :YcmDebugInfo command when editing your Python file? I think your issue is related to davidhalter/jedi#826.

@KraneBrain
Copy link
Author

I apologize for the delay
@vheon yes even with <C-Space> it doesn't auto fill.

@micbou here is the log

Printing YouCompleteMe debug information...                                                                                                                                                                 
-- Client logfile: /tmp/ycm_5IThGb.log                                                                                                                                                                      
-- Server has Clang support compiled in: True                                                                                                                                                               
-- Clang version: clang version 3.9.0 (tags/RELEASE_390/final)                                                                                                                                              
-- Python completer debug information:                                                                                                                                                                      
--   JediHTTP running at: http://127.0.0.1:44091                                                                                                                                                            
--   JediHTTP process ID: 7752                                                                                                                                                                              
--   JediHTTP executable: /home/testing/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/JediHTTP/jedihttp.py                                                                                         
--   JediHTTP logfiles:                                                                                                                                                                                     
--     /tmp/jedihttp_44091_stdout_aTPbrv.log                                                                                                                                                                
--     /tmp/jedihttp_44091_stderr_gzVNFK.log                                                                                                                                                                
--   Python interpreter: /usr/bin/python                                                                                                                                                                    
-- Server running at: http://127.0.0.1:36112                                                                                                                                                                
-- Server process ID: 7709                                                                                                                                                                                  
-- Server logfiles:                                                                                                                                                                                         
--   /tmp/ycmd_36112_stdout_DdQO_g.log                                                                                                                                                                      
--   /tmp/ycmd_36112_stderr__1Vt6g.log                                                                                                                                                                      
Press ENTER or type command to continue 

@micbou
Copy link
Collaborator

micbou commented Mar 6, 2017

Are you getting the same completions as the ones in this screenshot?

python2-socket-issue

@KraneBrain
Copy link
Author

@micbou
Here is a picture of what you sepcified. Also, here's a list of what's NOT in the list

next
dict
long
module
native
nonzero
unicode
weakref

Why do you (and me) not have connect?

ycm

@vheon
Copy link
Contributor

vheon commented Mar 8, 2017

@KraneBrain what happen if you type c or co?

EDIT: actually I tried again and I don't have connect either, so at this point I think is a problem with jedi itself.

@KraneBrain
Copy link
Author

@vheon Thank you for confirming. Should I reach out to the jedi group about the issue?

@micbou
Copy link
Collaborator

micbou commented Apr 19, 2017

Jedi author doesn't seem to be interested in fixing the issue and recommend to use Python 3 in that case.

@vheon We could directly implement the fix in JediHTTP by adding the socket module to the auto_import_modules option on Python 2.

@vheon
Copy link
Contributor

vheon commented Apr 20, 2017

@micbou I saw that you asked on jedi's tracker about adding socket to auto_import_modules. I'm fine if we want to patch it JediHTTP but do we want to wait and see if they include it upstream first? We could also just put it in JediHTTP and remove it if they merge it upstream.

@puremourning
Copy link
Member

I think this is fixed upstream now and just needs the JediHTTP module updating ? Can someone confirm?

@micbou
Copy link
Collaborator

micbou commented Aug 10, 2017

Yes but JediHTTP was updated with a version of Jedi that doesn't pass the ycmd tests because of some docstring issues. They are fixed in Jedi dev branch (see PRs davidhalter/jedi#941 and davidhalter/jedi#942) and we are now waiting for these fixes to be included in the master branch.

zzbot added a commit that referenced this issue Sep 10, 2017
[READY] Update ycmd

This new version of ycmd includes the following changes:

 - PR ycm-core/ycmd#795: add option to make relative paths in flags from extra conf absolute;
 - PR ycm-core/ycmd#802: fix compilation on Haiku;
 - PR ycm-core/ycmd#804: add libclang detection on FreeBSD;
 - PR ycm-core/ycmd#808: write python used during build before installing completers;
 - PR ycm-core/ycmd#810: support unknown languages from tags;
 - PR ycm-core/ycmd#811: update Universal Ctags languages list;
 - PR ycm-core/ycmd#814: resolve symlinks in extra conf glob patterns;
 - PR ycm-core/ycmd#815: update JediHTTP;
 - PR ycm-core/ycmd#816: update Boost to 1.65.0;
 - PR ycm-core/ycmd#819: filter and sort candidates when query is empty;
 - PR ycm-core/ycmd#820: improve LLVM root path search for prebuilt binaries;
 - PR ycm-core/ycmd#822: inline critical utility functions;
 - PR ycm-core/ycmd#824: do not sort header paths in filename completer;
 - PR ycm-core/ycmd#825: implement partial sorting;
 - PR ycm-core/ycmd#830: add max_num_candidates option;
 - PR ycm-core/ycmd#831: fix multiline comments and strings issues;
 - PR ycm-core/ycmd#832: update Clang to 5.0.0.

The `g:ycm_max_num_candidates` and `g:ycm_max_num_identifier_candidates` options are added to the documentation.

The link to ycmd extra conf is updated.

Fixes #2562.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2768)
<!-- Reviewable:end -->
zzbot added a commit that referenced this issue Sep 10, 2017
[READY] Update ycmd

This new version of ycmd includes the following changes:

 - PR ycm-core/ycmd#795: add option to make relative paths in flags from extra conf absolute;
 - PR ycm-core/ycmd#802: fix compilation on Haiku;
 - PR ycm-core/ycmd#804: add libclang detection on FreeBSD;
 - PR ycm-core/ycmd#808: write python used during build before installing completers;
 - PR ycm-core/ycmd#810: support unknown languages from tags;
 - PR ycm-core/ycmd#811: update Universal Ctags languages list;
 - PR ycm-core/ycmd#814: resolve symlinks in extra conf glob patterns;
 - PR ycm-core/ycmd#815: update JediHTTP;
 - PR ycm-core/ycmd#816: update Boost to 1.65.0;
 - PR ycm-core/ycmd#819: filter and sort candidates when query is empty;
 - PR ycm-core/ycmd#820: improve LLVM root path search for prebuilt binaries;
 - PR ycm-core/ycmd#822: inline critical utility functions;
 - PR ycm-core/ycmd#824: do not sort header paths in filename completer;
 - PR ycm-core/ycmd#825: implement partial sorting;
 - PR ycm-core/ycmd#830: add max_num_candidates option;
 - PR ycm-core/ycmd#831: fix multiline comments and strings issues;
 - PR ycm-core/ycmd#832: update Clang to 5.0.0.

The `g:ycm_max_num_candidates` and `g:ycm_max_num_identifier_candidates` options are added to the documentation.

The link to ycmd extra conf is updated.

Fixes #2562.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2768)
<!-- Reviewable:end -->
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants