question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How about joining up for Python code completion? (YouCompleteMe)

See original GitHub issue

[Replicating our private email discussion in a more public forum]

I’m the author of a YouCompleteMe (YCM), a recently released (Feb 2013) OSS code completion system for Vim. It’s become very popular very quickly (~1300 stars on GitHub).

YCM comes with out-of-the box support for semantic completion for C-family languages like C/C++/Objective-C/Objective-C++ (using libclang as the engine) and also has a language-agnostic identifier completer. The GIF on the project page is a thousand words and there’s also an extensive introduction there so I’ll spare you the details that you can easily grab.

Getting to the point, an external developer contributed a Jedi-based semantic completer for YCM today. YCM actually provides a generic framework for writing custom semantic completers (for any language) that can then take advantage of the code completion infrastructure that YCM provides (non-blocking operation that lets Vim continue to process events, a smart caching layer, the subsequence-based completion filtering system and the advanced completion ranking algorithm etc). You can see just how small the file for jedi-based semantic Python completion is in YCM.

I see that Jedi (which is freaking awesome btw, congrats on that) also has other features too, like goto etc. Any chance on us teaming up to bring those features to YCM? I see that you have written the jedi-vim plugin. While I haven’t tried it I’m sure it’s awesome (hey, it’s using Jedi) but I think it’s sad that we have this duplication of work. I’d also like to see YCM become a common framework for code completion in Vim, much like Syntastic is the common framework for displaying compilation/lint errors.

YCM will expand into more IDE features with go-to-definition/declaration. Basically all the useful features that one can build when one has an engine that provides a semantic understanding of the codebase. These features would be accessed through the new :YcmCompleter [completer sub-command] [sub-command arguments] interface that also recently landed. That command calls OnUserCommand on the Completer object with the arguments the user provided after the sub-command name. From then on, the Completer writer can do anything he wishes.

So my idea is to expand the functionality of YCM’s jedi_completer until it does everything jedi-vim can. That’s it. I’ll probably end up doing all this myself if no one else does but I’d love it if you could contribute pull-requests. Correct me if I’m wrong, but your goal is to build the best possible Python code completion system. You shouldn’t have to spend time on the VimScript parts and other Vim plugin boilerplate. You should be able to focus on making Jedi, the library, even better.

If you’re not interested, that’s perfectly fine. I just think it’s sad that there’s this duplication of efforts; I spent a ton of time writing the ycm_core library in C++ so that completions in Vim can be super-fast. I’d love to see others leverage that work to improve editing in Vim even more.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:47 (14 by maintainers)

github_iconTop GitHub Comments

5reactions
josecostamartinscommented, Apr 2, 2014

To disable YCM for python i’ve put the following snippet in my .vimrc:

let g:ycm_filetype_specific_completion_to_disable = { 'python' : 1 }
let g:ycm_filetype_blacklist = { 'python' : 1 }

So far seems like everything is going as planned.

How is the conversation about a merger/integration going? You probably already thought about this, but how hard it is to make jedi-vim a module of YCM?

1reaction
davidhaltercommented, Dec 26, 2020

I think that it’s save to say that we have in some ways worked together. Jedi is used within YCM and jedi-vim has always been a side-project.

The times have been changing and language servers have emerged as the new market leader. I still think that language servers have a bit too much overhead (both in complexity and resources), but that’s probably not going to stop people from using them.

So I’m glad YCM, jedi and jedi-vim have become what they are now. Cheers to a few more years!

Read more comments on GitHub >

github_iconTop Results From Across the Web

YouCompleteMe: A code-completion engine for Vim - Gitee
YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim. It has several completion engines: an identifier-based engine that works ...
Read more >
Vim Code Completion for Python 3
The ideal way is to get Vim's source and compile it yourself. Step 1: For Debian-like systems, get the required packages:
Read more >
Python Code Completion in VIM | 100% Working - YouTube
In this video we will learn series of steps to install vim8 with python 3 support and then we will install the youcompleteme...
Read more >
vim youcompleteme cannot auto-complete self-defined python ...
I using youcommpleteme to auto-complete assist writing python code. And I find that the build-in modules such as os or simplejson will work...
Read more >
How vim completers work? YCM, COC, etc. - Reddit
Autocomplete is a must for any serious programmer, and it is atrocious in Vim. Completely unusable. None of the plugins work, setting up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found