clang

Clancs is finally in a usable state

It’s been three weeks since I started working on the plugin, and now it’s finally in a working state. I’ll get around to finally adding a README to the project soon, but in the meantime here’s a bunch of things in no particular order: Parsing and compiling the file takes around 1-3 seconds depending on the size of the file and the sizes of all includes, but it’s completely asynchronous and as such will later be done as part of a visit-file hook.

Standalone libclang utility library available now

Emboldened by my previous success and with a better idea as to how SublimeClang fetches code completions internally, I set about trying to make the Emacs plugin a reality once more. I initially figured that I would write it entirely in C++, with Emacs communicating with the server using sockets or something like that. However, I soon realized that most of the code I wrote would be more or less identical to how SublimeClang works.

Progress with libclang! (in C++, not Python)

As you might remember, I gave up on porting SublimeClang over to Emacs. After raising two bugs on irony-mode, one of which ended up with the author (who seems to be a really nice guy, by the way) cloning my repo to see why it wasn’t working, I finally managed to get auto-completion up and running with irony-mode. And it turned out to be too slow. I mean, for me it was even slower than brianjcj’s auto-complete-clang plugin, which uses the clang binary to drive completions.

I give up on the plugin

Instead of giving me context-sensitive completions, it’s basically returning a list of every symbol it can find in every header file. I just want decent code completion in C++, I don’t want a fucking PhD in a language that has no dedicated return statement and a library whose stable release can’t compile on all “supported” platforms after being out in the wild for several years. I’ll just wait for irony-mode’s author to fix this issue and then use that thing instead.

Progress with clancs

Clancs being the name of the repo I’ve created on Github to track my efforts at porting SublimeClang to Emacs, as documented in a previous post. So far I’ve removed (almost) everything ST2-specific (and Python 3-specific, just to make it easier to narrow in on what’s not working) from the plugin, I’ve also taken care to ensure that anything Emacs-specific is being done only from a handful of functions in one module.

Getting libclang to work.. anywhere

People at my office currently use Source Insight (sorry, can’t be bothered to put a link, just look it up in your favorite search engine) to navigate and edit our codebase which is comprised of bazillion lines of code spread across a million files. Recently, upper management heard about this wonderful tool called Eclipse (again, just search for it) that some people use and which just happens to be FREE! Also, we use QNX, and Momentics (which is a modified version of Eclipse) is used for live-debugging of systems runinng QNX, so it made sense to them that their engineers use Eclipse.