Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CDT auto-completion based on YouCompleteMe Daemon?

Hi Doug,

Thanks for your reply!

Could you provide a link to any information about the Language Server work from Microsoft, Red Hat & others? Any ideas about when is it intended to land as a feature?

I'm an Eclipse/CDT user for more than a decade. And in my experience, when I work with complex C++ code bases like e.g. the source code of LLVM or Clang, the Clang-based auto-completion beats Eclipse hands down. After so many years working with Eclipse I had to switch to VIM + YouCompleteMe to be able to reasonably work with those complex C++ projects.  

As far as I understand, Microsoft & Red Hat effort will simply standardize the JSON-based API to be used when you talk to the Language Server. Semantically, it will be almost the same as talking to the YouCompleteMe daemon. The difference is: the YouCompleteMe Daemon is available today and works, where as MS & RedHat effort is a work in progress....

IMHO, if the integration with YouCompleteMe Deamon is pretty straight-forward and probably requires just a couple of days or a week to implement, this is a way to go for now! And once  Microsoft & Red Hat have landed a standard, then CDT could switch to it. 

-Leo


On Tuesday, September 6, 2016 12:10 PM, Doug Schaefer <dschaefer@xxxxxxxxxxxxxx> wrote:


I’m somewhat more inclined to see what happens with the Language Server work that Microsoft, Red Hat, and others are working on. That has a chance of becoming an industry standard, and certainly an Eclipse standard.

But, no, no one I know is actively working on an external parser/indexer for CDT. If such a thing comes along and proves better than our internal ones, then we’d obviously consider it.

Doug.

From: <cdt-dev-bounces@xxxxxxxxxxx> on behalf of Leo Romanoff <romixlev@xxxxxxxxx>
Reply-To: Leo Romanoff <romixlev@xxxxxxxxx>, "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Date: Tuesday, September 6, 2016 at 2:29 PM
To: "CDT General Developers List." <cdt-dev@xxxxxxxxxxx>
Subject: [cdt-dev] CDT auto-completion based on YouCompleteMe Daemon?

Hi,

I know that CDT has its own C/C++ parsers developed over many years and a lot of effort was invested into making them better and support C/C++ syntax as good as possible. I also know that in spite of all this, CDT is still having some issues with auto-completion of the C++ code written using the latest C++ standards. These issues are known and I guess CDT developers are trying to solve them. 

At the same time, quite some C++ IDEs have switched over last years to clang-based auto-completion from their own homegrown solutions (KDevelop, QtCreator, Code::Blocks, etc), because clang is pretty good when it comes to supporting the latest C++ features and it is being kept up-to-date, when standards change.

The problem with a clang-based approach is that the functionality for the auto-completion is provided by the libclang, which is a native C++ library. This is not an issue for the IDEs which are not running on top of the JVM. But Eclipse is implemented in Java and so using a native library may result in portability issues, need to support platform specific builds, etc.

Now, there are some plugins for VIM and Emacs, which were developed to provide auto-completion for a number of languages including C/C++. One of those plugins is YouCompleteMe (https://github.com/Valloric/YouCompleteMe). 

YouCompleteMe is rather interesting in term of its architecture. It is just a thin wrapper which talks with the remote auto-completion daemon over HTTP. The daemon is called  YCMD (https://github.com/Valloric/ycmd), i.e. YouCompleteMeDaemon. This daemon is a native process which actually loads the libclang and uses its APIs. YCMD is already supported by a number of editors including vim, emacs, Atom and Sublime. YCMD is supposed to be installed separately from the editors using it and can be used by multiple different editors at the same time. And it supports more than C/C++, e.g. C#, Go, Rust, Python, TypeScript, _javascript_.

It seems like it should be pretty trivial to integrate with YCMD and get a clang-based auto-completion for CDT. One would just need to write a thin wrapper which speaks JSON with YCMD over HTTP. No need for shipping native, platform-specific libs. No need for in-process integration with a C++ libraries, etc. IMHO, it sounds pretty interesting. 

So, my question is:
- Has the described possibility ever been considered by the CDT developers already?
- Is there any interest in having support for this feature?
- Is there anyone interested in implementing such a feature?

Thanks,
  Leo



Back to the top