Hacker News new | ask | show | jobs
by soinus 3678 days ago
Hello HN, I couldn't find any plugin for Sublime Text that would autocomplete C++ code and would be easy to setup, so I have written one. It is not fully polished, but works for me and a bunch of people, so I thought it was a good idea to expose it here.

The reason I post it here is two-fold.

First, I wrote it to make it useful, so I wanted to test it in real world,

Second, I tried to use libclang for autocompletion, but it works only for Linux currently. OSX and Windows for now resort to parsing the output from `clang -code-complete-at` command envoked in a subprocess. I would really love to make the plugin use libclang everywhere. So I would really like to get some help from people who are more familiar with OSX or Windows than I am and to generally spawn discussions on design desicions taken by me in this plugin.

Hope you guys like it. I am open to discussions and to your suggestions!

1 comments

I very much want something like this. I'm skeptical as to how useful it will be on large projects. Every project I've ever worked in Visual Studio intelligence has eventually died. I have no hope this would work. But oh how I wish it to be true! :)

I wonder if a Sublime plugin could piggyback Visual Studio generated data. I believe VS now has the ability to compile via clang. Could you let VS manage all compilation and projects and dependencies? Use PDBs or some such to generate sublime intellisense? I've no idea. But something along those lines seems like it would be most likely to work.

We've got some pretty hairy legacy C++ and all versions of VS prior to 2015 fell over it. 2015 handles it just fine, it's worth trying again.

Regardless, clang just uses the headers - at least that's the story with clang-autocomplete. It seems to parse them much faster than VS does, so reusing the VS cache me might cause perf impediments.

I can confirm that clang just uses headers, no linking involved. No project either. Only the headers you include in your file. So it should not compile a lot unless you have a file that includes the whole project, which is probably not the case.
I'm currently on a unity project but I'm sure at some point I'll work with UE4. I very much look forward to seeing how it performs.
Please let me know when you know more. I am also interested.
It is hard for me to compare. Last time I opened Visual Studio was like 5 years ago. This plugin would actually not try to compete with VS, as this thing is a monster and this plugin is a hobby project. :)

Originally I wanted to have some lightweight autocompletion for Linux and have added Windows and OSX support because people were trying to use it.

What you say about using VS to manage all compilation and project dependencies sounds really nice and logical, but unfortunately I have no knowledge whatsoever about how VS does this, so I'm not sure I can do this alone. However, I would love to discuss it should anyone have any nice ideas.

I definitely intend to give your plugin s shot. My fear is that C++ is to hairy fora hobby project. But my fingers are crossed!
Yes, do it! Shoot me an issue should something go wrong! :) I hope with the help of clang this will be manageable :)