Sublime Text 3 C, C++ and Objective C code completion, navigation plugin based on RTags.
This is a fork of the original sublime-rtags by Sergei Turukin. New features have been added and merging those back into the original sublime-rtags has become a bottleneck this fork avoids.
Install RTags - for all of the latest features, version 2.19 is the oldest we support. You will however get most functionality with RTags version 2.0 already.
- Install Package Control
- Run “Package Control: Install Package”
- Install "RTagsComplete"
cd <sublime-text-Packages-dir>
git clone https://github.com/tillt/RTagsComplete
Jump to the definition or declaration of a symbol.
Shows all references of the symbol under the cursor.
Finds and displays dead functions.
Allows to refactor symbols. Select a symbol with your cursor, activate the function and enter the new name.
Finds the include file for the symbol under the cursor. If any are found, shows a quick panel that copies the selected include into the clipboard when hitting return.
Replaces the 'auto' keyword with the type retrieved from RTags, if possible.
Shows a popup containing information about the symbol under the cursor.
Validates your current code and shows errors and warnings inline.
- Make sure
rdm
is active. - Obtain compile_commands.json from the build chain of your project/s.
- Supply rdm with compile_commands.json of your project/s.
- That's it - ready to code with ease.
The default key bindings were originally inspired by Qt Creator.
- Symbol navigation - F2
- Find usages / references - CTRL+Shift+u
- Rename symbol - CTRL+Shift+Alt+u
- Find virtual function re-implementations - CTRL+Shift+x
- Symbol information - CTRL+Shift+i
- Use Alt+/ explicitly for auto-completion
- Mouse button8 to go backwards (mouse wheel left)
- Error, fixit and warning navigation - CTRL+Shift+e
- Find unused functions - Alt+Super+Shift+d
- Find include file for symbol - CTRL+i
- Expand auto type for symbol - CTRL+Shift+a
- Show navigation history - CTRL+Shift+h
Customize your Key Bindings via Preferences > Package Settings > RTagsComplete > Key Bindings > User
Setup the plugin within the User Settings via Preferences > Package Settings > RTagsComplete > Settings > User
If you need Auto Completion add the following to Preferences > Settings > User
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},{
"characters": ".>: ",
"selector": "source.c++.11, source.c++, source.c - string - comment - constant.numeric"
}
]
For a typical setup of a larger codebase built via autotools, check out Simplify development by adding RTags to your text editor.
Original code by Sergei Turukin. Hacked with plenty of new features by Till Toenshoff. Some code lifted from EasyClangComplete by Igor Bogoslavskyi.
On that thought, I would like to mention that EasyClangComplete is an excellent plugin, far more complex and in many ways superior to RTagsComplete. However, the approach taken by EasyClangComplete is arguably not so great for larger projects. EasyClangComplete aims to make things conveniently easy while RTagsComplete is attempting to offer plenty of features with highest possible performance at scale.
Maybe some day EasyClangComplete will be based on clangd
and that is likely the day I stop tinkering with RTagsComplete.