Live data from Hacker News

Include-what-you-use: Clang tool to analyze includes in C and C++ source files

include-what-you-use.org

41–43 of 43 posts

Re: Include-what-you-use: Clang tool to analyze includes in C and C++ source files

#41
post #39
post #23

Earlier quoted context omitted.

I think you'll enjoy this talk: CppCon 2015: Atila Neves "Emacs as a C++ IDE" - https://m.youtube.com/watch?v=5FQwQ0QWBTU

The main feature that I miss from CLion is the ability to refactor. In CLion you can rename a class, and all of its usages, declarations, etc. will be renamed. The most useful thing CLion can do is change the signature of a function, and its corresponding implementation and header declarations will be changed. So, you can rename a parameter and its declaration and implementation will be renamed for you, or you can de…

>and all of its usages, declarations, etc. will be renamed.

Along with header include statements in any file that referenced the class - so say I refactored class Foo in include/mylib/foo.hpp and it's included in src/mylib/foo.cpp as - CLion happily "refactors" that to #include "foo.hpp" - spent the same ammount of time fixing this stuff as I would manually renaming use cases...

Re: Include-what-you-use: Clang tool to analyze includes in C and C++ source files

#42
post #13

I would love if imperfect #includes (what I understand this tool is supposed to point out) simply became a compile warning and part of the toolchain. I would love such a feature and would use it a lot. However wrt this project I just looked at the "Instructions for Users" and it tells me how to build it and that I need to observe this and that and a lot of other things for it not to go wrong. Sorry, I just don't have…

If you're using Ubuntu, it's this package:

sudo apt-get install iwyu

I agree the name isn't clear; I also wasted time downloading and compiling stuff until I realized it was in apt after all.

On my VS 2015, in C#, the IDE grays out unused includes, so Microsoft has at least ~something. I'm hoping these tool are just a first step towards mostly automatic #include management.

Re: Include-what-you-use: Clang tool to analyze includes in C and C++ source files

#43
post #39
post #23

Earlier quoted context omitted.

I think you'll enjoy this talk: CppCon 2015: Atila Neves "Emacs as a C++ IDE" - https://m.youtube.com/watch?v=5FQwQ0QWBTU

The main feature that I miss from CLion is the ability to refactor. In CLion you can rename a class, and all of its usages, declarations, etc. will be renamed. The most useful thing CLion can do is change the signature of a function, and its corresponding implementation and header declarations will be changed. So, you can rename a parameter and its declaration and implementation will be renamed for you, or you can de…

As a new IDE user, I was very excited about the language-aware "rename" refactoring ability. But I realized that the variables I rename are mostly badly chosen names in IDE code-generated boilerplate, i.e. names of widgets inserted into forms. When I'm writing new code in vim I just choose good names to begin with, so it's a bit of a wash for me.

I hope there is room in my brain to stay good at vim despite using VS at work.

Post reply on HN