Sublime Text 3 RTags plugin.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
messages
plugin
site
tests
themes/Default
.coveragerc Adde travis CI integration. Jul 29, 2018
.travis.yml
Default (Linux).sublime-keymap
Default (Linux).sublime-mousemap
Default (OSX).sublime-keymap
Default (Windows).sublime-keymap
Main.sublime-menu
README.md
RTagsComplete.sublime-settings
messages.json
rtags.py
unittesting.json

README.md

      ___       ___          ___          ___          ___
     /\  \     /\  \        /\  \        /\  \        /\  \
    /::\  \    \:\  \      /::\  \      /::\  \      /::\  \
   /:/\:\  \    \:\  \    /:/\:\  \    /:/\:\  \    /:/\ \  \
  /::\~\:\  \   /::\  \  /::\~\:\  \  /:/  \:\  \  _\:\~\ \  \
 /:/\:\ \:\__\ /:/\:\__\/:/\:\ \:\__\/:/__/_\:\__\/\ \:\ \ \__\
 \/_|::\/:/  //:/  \/__/\/__\:\/:/  /\:\  /\ \/__/\:\ \:\ \/__/
    |:|::/  //:/  /          \::/  /  \:\ \:\__\   \:\ \:\__\
    |:|\/__/ \/__/           /:/  /    \:\/:/  /    \:\/:/  /
    |:|  |                  /:/  /      \::/  /      \::/  /
     \|__|                  \/__/        \/__/        \/__/
      ___          ___          ___          ___                    ___                 ___
     /\__\        /\  \        /\  \        /\  \                  /\__\               /\__\
    /:/  /       /::\  \      |::\  \      /::\  \                /:/ _/_       ___   /:/ _/_
   /:/  /       /:/\:\  \     |:|:\  \    /:/\:\__\              /:/ /\__\     /\__\ /:/ /\__\
  /:/  /  ___  /:/  \:\  \  __|:|\:\  \  /:/ /:/  /___     ___  /:/ /:/ _/_   /:/  //:/ /:/ _/_
 /:/__/  /\__\/:/__/ \:\__\/::::|_\:\__\/:/_/:/  //\  \   /\__\/:/_/:/ /\__\ /:/__//:/_/:/ /\__\
 \:\  \ /:/  /\:\  \ /:/  /\:\~~\  \/__/\:\/:/  / \:\  \ /:/  /\:\/:/ /:/  //::\  \\:\/:/ /:/  /
  \:\  /:/  /  \:\  /:/  /  \:\  \       \::/__/   \:\  /:/  /  \::/_/:/  //:/\:\  \\::/_/:/  /
   \:\/:/  /    \:\/:/  /    \:\  \       \:\  \    \:\/:/  /    \:\/:/  / \/__\:\  \\:\/:/  /
    \::/  /      \::/  /      \:\__\       \:\__\    \::/  /      \::/  /       \:\__\\::/  /
     \/__/        \/__/        \/__/        \/__/     \/__/        \/__/         \/__/ \/__/

Master Build Status Staging Build Status

About

Sublime Text 3 C/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.

Installation

Make sure you installed 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.

Via Package Control

  • Install Package Control
  • Run “Package Control: Install Package”
  • Install "RTagsComplete"

Manually

cd <sublime-text-Packages-dir>
git clone https://github.com/tillt/RTagsComplete

Features

Symbol navigation (Goto definition/declaration)

Find usages (Find symbol references, Find virtual function re-implementations, Find unused functions)

Rename symbol

Symbol information

Symbol Info Example

Code completion

Completion Example

Code validation - shows errors and warnings inline

Fixits Example

Usage

Typical work-flow

Default key bindings

Key bindings were originally inspired by Qt Creator.

  • Symbol navigation - F2
  • Find usages - 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

Customization

Keybindings

Customize your own key bindings via Preferences > Package Settings > RTagsComplete > Key Bindings > User

[
  # Find usages
  {"keys": ["ctrl+shift+u"], "command": "rtags_location", "args": {"switches": ["--absolute-path", "-r"]} },

  # Rename symbol
  {"keys": ["ctrl+shift+alt+u"], "command": "rtags_symbol_rename", "args": {"switches": ["--absolute-path", "--rename", "-e", "-r"]} },

  # Find virtual function re-implementations
  {"keys": ["ctrl+shift+x"], "command": "rtags_location", "args": {"switches": ["--absolute-path", "-k", "-r"]} },

  # Symbol information - needs RTags version 2.5 or higher.
  {"keys": ["ctrl+shift+i"], "command": "rtags_symbol_info", "args": {"switches": ["--absolute-path", "--json", "--symbol-info"]} },

  # Jump to definition
  {"keys": ["f2"], "command": "rtags_location", "args": {"switches": ["--absolute-path", "-f"]} },

  # Backwards in history
  {"keys": ["ctrl+shift+b"], "command": "rtags_go_backward" },

  # Show errors, warnings and fixits
  {"keys": ["ctrl+shift+e"], "command": "rtags_show_fixits" },

  # Find unused / dead functions - needs RTags version 2.19 or higher.
  {"keys": ["alt+super+shift+d"], "command": "rtags_file", "args": {"switches": ["--absolute-path", "--find-dead-functions"]} }
]

Settings

Customize settings via Preferences > Package Settings > RTagsComplete > Settings > User

{
  # Path to rc utility if not found in $PATH.
  "rc_path": "/usr/local/bin/rc",

  # Seconds for rc utility communication timeout default.
  "rc_timeout": 0.5,

  # max number of jump steps.
  "jump_limit": 10,

  # Supported source file types.
  "file_types": ["source.c", "source.c++", "source.c++.11"],

  # Statusbar status key - sorting is done alphabetically.
  "status_key": "000000_rtags_status",

  # Statusbar results key - sorting is done alphabetically.
  "results_key": "000001_rtags_status",

  # Statusbar progress indicator key - sorting is done alphabetically.
  "progress_key": "000002_rtags_status",

  # Enable auto-completion.
  "auto_complete": true,

  # Auto-completion triggers internal to RTagsComplete.
  "triggers" : [ ".", "->", "::", " ", "  ", "(", "[" ],

  # Enable displaying fixits, warnings and errors.
  "fixits": true,

  # Enable hover symbol info - needs at least RTags V2.5.
  "hover": true,

  # Enable enhanced, rather verbose logging for troubleshooting.
  "verbose_log": true,

  # Enable auto-reindex unsaved file.
  "auto_reindex": true,

  # Seconds of idle-time before auto-reindex is triggered.
  "auto_reindex_threshold": 30,

  # clang cursor kind as returned by RTags not adding value to the
  # symbol information popup.
  "filtered_clang_cursor_kind": [
    "arguments",
    "baseClasses",
    "cf",
    "cfl",
    "cflcontext",
    "context",
    "endLine",
    "endColumn",
    "functionArgumentCursor",
    "functionArgumentLength",
    "functionArgumentLocation",
    "functionArgumentLocationContext",
    "invocation",
    "invocationContext",
    "invokedFunction",
    "location",
    "parent",
    "range",
    "startLine",
    "startColumn",
    "symbolLength",
    "usr",
    "xmlComment"
  ]
}

If you need auto-completion add 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"
  }
]

Further reading

For a typical setup of a larger codebase built via autotools, check out Simplify development by adding RTags to your text editor.

Credits

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.