Readme for the C/C++ plugin for IntelliJ IDEA
1. About the product
Advanced Tools is a small startup company, trying to develop a
tool for C++ editing and refactoring. This version of plugin for
IntelliJ IDEA is an early alpha-version, which was made open
for public in order to better debug it (there is still a lot of work).
In future there will be available versions for other popular IDEs.
We do not guarantee that your work with the product will be smooth
(we hope that such plugin version will appear in near future).
However, with some patience this tool can be helpful even in its current
state.
2. Changes from the previous version
Version 0.8, 2010.10.03
- Major feature: initial support for handling Cpp and C files without
switching settings.
- Completion of member names in constructor initializer list.
Find usages over string literal will find other occurrences of the same
literal.
- Completion of macros parameters inside macro body.
Assorted performance and usability fixes got from dog fooding :).
- Completion / navigation for targets / value references in makefiles.
- Recent find usages action works in usage view for c++ symbols.
- Option to disable multiple definition checks (C++ Project
Settings|Settings).
- No absent definition error produced for declaration of static integral
constant inside class.
- Leading // file level header comments are folded.
- Fixed bug with broken "Navigate to constant / macro".
- Added IdeaX support.
- Dropped Idea 6 (Demetra) and Idea 7 (Selena) support.
Version 0.6
- Completion, find usages and syntax highlighting
now works in full for macro names, macro parameters and include files.
The completion is "honest", that is the plugin gives only those variants,
which are available in the current context.
- The following actions were added:
- Show all project errors and warnings
(Tools | Cpp Support | Show All Errors And Warnings).
- Goto super method (Ctrl+U) —
for IntelliJ IDEA 7.0 (Selena).
- Goto Implementations (Ctrl+Alt+B)
- View Implementations (Ctrl+Shift+I).
- Parameter info action (Ctrl+P) for
function/method/macro invocations.
- Generate case branches action for switch over enum was implemented.
- Different highlighting for (static) fields/methods
and parameters was implemented.
- Goto File action now allows navigation to (system)
include files.
- Autopopup completion after dot, arrow, namespace selector
was added.
- Support of C++ files with .cc extension by default.
- A large amount of bug fixing work was performed. Overall
plug-in stability was seriously improved.
- Almost all C and C++ constructions, used in Win32 API
headers, are now supported (including Microsoft non-standard extensions,
e.g. #define LN /##/).
3. Setting up the plugin
Install the plugin. There will appear no special project type for
C/C++ projects. Just take/create any Java project, and the plugin
will process all *.c/*.cc/*.cpp source files from the project source
roots.
Then you need to specify the C/C++ dialect. Open
Settings->IDE Settings->C/C++.
There are three options, which can be used for tuning:
- Compiler selector —
you may choose between GCC and MS VC dialects
- Use C dialect —
this option makes the compiler to treat the
sources like C, not CPP files.
- GCC executable name —
gcc is used if this field is left blank. This option is important
for GCC configuration autodetection.
To parse the files you also need to specify include paths for your
C/C++ environment. Currently, the plugin can automatically detect
GCC include paths, in case of other compilers you need to specify the
include paths by yourself. Additional include files can be specified
for each project separately. Automatic gcc include paths detection works only
if your compiler presents in path. If it does not (or if you want to use
include-paths of a non-default compiler), then you should specify the name
(full name, if necessary) of gcc executable in GCC executable name
field.
4. Working with the plugin
No additional tuning is necessary, the plugin should start working.
The following features should work relatively reliably:
- Syntax highlighting. It should appear shortly after opening of any
C/C++ file. The first highlighting can take considerable time, re-highlighting (after
file change) should work quicker. Use additional C/C++ tab in
Settings->IDE Settings->Colors&Fonts
to customize the text appearance.
- Error check. Both macroprocessor and C/C++ errors
are highlighted, in different colors.
- Code navigation. Use traditional Ctrl+B, Alt+F7,
Ctrl+N, Ctrl+Alt+Shift+N. Also you can use constant navigation
feature, which allows to navigate to macro (Ctrl+Alt+M) and
constant (Ctrl+Alt+N) definitions.
The navigation works for C code as well as for preprocessor. Class
hierarchy is also retrieved and can be used for navigation.
- Code block foldings.
- Name completion.
- Goto super method (Ctrl+U):
IntelliJ IDEA 7.0 (Selena) only.
- Goto Implementations (Ctrl+Alt+B) /
View Implementations (Ctrl+Shift+I).
The following features are present, but should be used with care:
- Rename of variables/functions/macroses.
5. Performance and hardware requirements
For a project of about 200 thousand lines of C++ code with Windows API
it should take about 20s for its full reparse on Pentium-IV 1700 under
Windows XP. In case of 2 GHz quad-core processors full reparse takes about
5s.
The use of multi-core processors also improves responce, because it can
effectively separate Java processes from plugin processes (this is especially
important for Windows operating system).
6. Errors and reliability
Remember about responce delays: if the source is not highlighted,
wait a bit, maybe it will change.
Error diagnostics may be not accurate.
As it was stated above, this is an alpha version of the plugin. The
following problems can arise while working with the plugin:
- Some parts of the source files may be not highlighted, or the
highlighting may be wrongly bound. However, this also can happen because
of some real errors in your code. E.g., if a class method declaration
is incorrect, it's uses in code may be not highlighted and
be unsearchable.
- Some syntax constructions may be incorrectly marked as erroneous.
- IDEA can be extremly slow when editing large (more than 1000 lines)
files, when run at computers with one-core processor. This problem exists
for any large file in IDEA, not only for C/C++ files. Multi-core processor can
lower the negative effect of this problem.
- The plugin may crash. When this happens, all non-local highlighting
(i.e., errors, unused identifiers etc) disappears. The plugin
automatically restarts, but if it does not help, then it probably
cannot handle the code in the editor.
7. Feedback and bugs reporting
If you have a question, suggestion, or you have a bug to reprot, then
please email us at
support@youradvancedtools.com.
Also, our bug tracking server is accessible at
bugs.adv-tools.com.