Giter Site home page Giter Site logo

andersbakken / rtags Goto Github PK

View Code? Open in Web Editor NEW
1.8K 80.0 253.0 24.85 MB

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.

Home Page: http://www.rtags.net

License: GNU General Public License v3.0

Shell 1.30% CMake 2.57% C 2.72% C++ 71.27% QMake 0.09% Objective-C 0.19% Emacs Lisp 20.70% Python 1.00% Makefile 0.17%

rtags's Introduction

MELPA MELPA
rtags
MELPA
rtags-xrefac-rtagscompany-rtagsflycheck-rtagshelm-rtagsivy-rtags
MELPAMELPAMELPAMELPAMELPAMELPA

Introduction

RTags is a client/server application that indexes C/C++ code and keeps a persistent file-based database of references, declarations, definitions, symbolnames etc. There’s also limited support for ObjC/ObjC++. It allows you to find symbols by name (including nested class and namespace scope). Most importantly we give you proper follow-symbol and find-references support. We also have neat little things like rename-symbol, integration with clang’s “fixits” (https://clang.llvm.org/diagnostics.html). We also integrate with flymake using clang’s vastly superior errors and warnings. Since RTags constantly will reindex “dirty” files you get live updates of compiler errors and warnings. Since we already know how to compile your sources we have a way to quickly bring up the preprocessed output of the current source file in a buffer.

While existing taggers like gnu global, cscope, etags, ctags etc do a decent job for C they often fall a little bit short for C++. With its incredible lexical complexity, parsing C++ is an incredibly hard task and we make no bones about the fact that the only reason we are able to improve on the current tools is because of clang (https://clang.llvm.org/). RTags is named RTags in recognition of Roberto Raggi on whose C++ parser we intended to base this project but he assured us clang was the way to go. The name stuck though.

Tarball releases are available here: https://github.com/Andersbakken/rtags/releases/

TLDR Quickstart

We assume you have something to generate a JSON Compilation Database for your project. Your build system probably has a way to generate it, or you can look at something like Bear.

Build RTags

git clone --recursive https://github.com/Andersbakken/rtags.git
cd rtags
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
make

Start the RTags daemon (rdm)

./bin/rdm &

Index the RTags project, and wait until rdm is silent

./bin/rc -J .

Open source file in emacs

emacs +74:34 src/rdm.cpp

Load rtags.el

M-: (load-file "rtags.el") RET

Ensure rc can be found

M-x set-variable RET rtags-path RET "../bin" RET

Call rtags-find-symbol-at-point

M-x rtags-find-symbol-at-point RET

Your location is now on the definition of Server::instance()

Documentation

The documentation can be found in the Wiki.

Disclaimer

RTags is still under development and is not the most stable piece of software you’ll ever find. We’re constantly working to improve on it.

rtags's People

Contributors

andersbakken avatar baol avatar bbannier avatar bkoropoff avatar casch-at avatar clapautius avatar ddanilov avatar dushistov avatar erreina avatar gvol avatar hongxuchen avatar hotpxl avatar jhanssen avatar jhanssen-work avatar jomiller avatar juergenhoetzel avatar lefterisjp avatar louxiu avatar lyuts avatar marxin avatar maskray avatar ptrv avatar redbeard0531 avatar silex avatar smagnuso avatar smoofra avatar terranpro avatar tom-seddon avatar vibrys avatar wisemaestro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtags's Issues

Templatized functions do not work entirely right

Can't follow this symbol in Connection.h:

template bool Connection::send(const T *message)
{
return send(...
} /
||

This might just be the way it is. Maybe we could do something along the lines of not blocking template functions cursors since they maybe appear different in translation units where they are used vs when they are not used.

support ninja

ninja -t or something like that gives us everything we need.

rtags-find-virtual-methods doesn't find "siblings"

E.g.

struct Base
{
virtual void foo() {} // <- this finds everything
};

struct One : public Base
{
virtual void foo() {} // <- this only finds itself and Base::foo()
}

struct Two : public Base
{
virtual void foo() {}
}

Still at least one problem with constructors

struct F
{
F();
F(const F &f) {}
};

int main()
{
F f = F();
}

somehow the F() call refers to the struct F, not the default
constructor, also, f does not refer to the copy constructor.

Trying to improve the current hacks in origin/workonstupidconstuctor

FileSystemWatcher issue with fsevents and kqueue

The kqueue and fsevents watchers both have an issue where if you watch /foo,
then /foo/bar and then unwatch /foo then none of the paths are watched.
In addition, the kqueue watcher has an issue where if you watch /foo/bar,
then watch /foo and then unwatch /foo, then /foo/bar is no longer watched either.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.