Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtags support #2834

Closed
wants to merge 4 commits into from
Closed

rtags support #2834

wants to merge 4 commits into from

Conversation

mheathr
Copy link

@mheathr mheathr commented Aug 31, 2015

Adds support for rtags to spacemacs' c-c++ layer. https://github.com/Andersbakken/rtags

@person808
Copy link
Contributor

Should probably rename this PR. I thought this was one of those spam PRs that are @robbyoconnor's worst nightmares :)

@mheathr mheathr changed the title Develop rtags support Aug 31, 2015
@TheBB
Copy link
Collaborator

TheBB commented Aug 31, 2015

So, only the last commit is useful, right?

@mheathr
Copy link
Author

mheathr commented Aug 31, 2015

Yes, that is the one with relevant changes to it.

@robbyoconnor
Copy link
Contributor

Should probably rebase as well...You shouldn't see merge commits -- always do git pull --rebase

@robbyoconnor
Copy link
Contributor

Also, you should probably use feature branches and not work directly on develop :P -- It could be a while until this is merged and anything you push to this branch will be added to this PR.

@robbyoconnor
Copy link
Contributor

Also why is rtags better than both gtags and ctags (both of which spacemacs has support for)? Like seriously -- This should be its own layer -- not packaged in the c-c++ layer...

@mheathr
Copy link
Author

mheathr commented Aug 31, 2015

The helper functions in the rtags-post-init utilize gtags as a fallback when there is not a compilation database available for rtags, and it utilizes the helm-gtags functions directly within those helper functions.

Like with company-clang, rtags utilizes clang's compilation database for auto-completion, quick movement within and outside of semantic contexts, and has a helm-like interface for presenting and narrowing information. Rtags also has support for objective-c and objective-c++ in addition to its semantic motions and autocompletion and database querying functionality.

Rtags provides either an autocomplete or company front end but is configured in the pull request to utilize company.

@robbyoconnor
Copy link
Contributor

@mheathr you might want to rebase this so it's cleaner :P

@mheathr
Copy link
Author

mheathr commented Aug 31, 2015

Okay, will do. Would you like for me to include documentation on the keybindings that rtags uses like what is done with semantic-refactor? Rtags has around 25 interactive functions that are provided, so it would make the documentation significantly longer as it results it at minimum a 26 x 3 table.

One thing I left off about rtags is that it also provides an interface to clang's fixits.

@robbyoconnor
Copy link
Contributor

Always document (it's one of the things that makes spacemacs amazing) -- if you add stuff -- Document it! :)

@jmacdonagh
Copy link

@robbyoconnor rtags supports all the deep dark corners of C++. It can follow template instantiations, virtual function calls, overloaded functions, etc... It's incredibly valuable for most medium to large scale C++ projects. C++ is complex ;)

@mheathr do we want to make this a bit more integrated, like irony-mode? For example, should it start rdm for us automatically? Should we have a command similar to irony-install-server where we bring the rtags source along with us in the package and allow the user to build it straight in their .cache directory? This would require some changes upstream but would make the experience significantly better in my opinion.

@robbyoconnor
Copy link
Contributor

This should apply cleanly -- but a simply git pull --rebase upstream develop -- should make this sexy lookin :P

@qqldd
Copy link

qqldd commented Oct 24, 2015

What happened to this commit, will it merge into the spacemacs?

@robbyoconnor
Copy link
Contributor

You should probably clean up merge conflicts ;)

@robbyoconnor
Copy link
Contributor

Also, it sometimes takes awhile for things to get merged...be patient -- it's basically a one-man show...and that man has a day job!

@qqldd
Copy link

qqldd commented Oct 25, 2015

@robbyoconnor Thanks for the answer. I just want to make sure we want rtags in C/C++ private layer. If @mheathr does not have time for this. I can test the tags code here and submit a clean pull request later.

@TheBB
Copy link
Collaborator

TheBB commented Oct 25, 2015

There was some discussion of the future of tags support in #3273. The implementation of that idea is still a ways off, however. I don't see why we can't do this in the meantime.

@naseer
Copy link
Contributor

naseer commented Nov 2, 2015

I tried this out - the rtags reference find is pretty accurate but pressing Enter on any of the references does not take me to the code.

@tdejager
Copy link

tdejager commented Dec 3, 2015

Is someone still working on this, seems it could be integrated if the conflicts are resolved :)?

@magthe
Copy link
Contributor

magthe commented Dec 23, 2015

I've made an attempt to rebase this onto develop. It was rather easy, though it probably needs the eyes of a more experienced elisp/spacemacs developer to see if it's done in a good way. It is working, but playing with it a little raises a few doubts about its inclusion in the current state:

  1. rdm has to be started outside of emacs. There's a recipe for hooking it up to launchd, and it is probably easy to write a recipe for systemd too, but is that enough?
  2. There seems to be no function for indexing a project. I think such a function should be connected to projectile in some way to simplify finding the compilation database.
  3. The source code navigation is not hooked up to any sort of stack, i.e. one can jump in one direction, but not back. I'm not really sure where and how to add this, jumping with gtags has a jump stack, would it be possible for rtags to use the same one?

@cviebig
Copy link

cviebig commented Feb 6, 2016

Hi @magthe and all the others,

thank you for working on this. I just migrated from plain emacs wonder how to install rtags. In my old init.el I used rtags in conjunction with cmake-ide which seems to do a lot of configuration stuff (for cmake projects). Would this package solve the problem of running rdm?

My old configuration looks as follows:

(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
;; https://github.com/Andersbakken/rtags/issues/218
(require 'rtags)
(require 'rtags-ac)
(rtags-enable-standard-keybindings c-mode-base-map)
(require 'company-rtags)
(add-to-list 'company-backends 'company-rtags)
(setq company-rtags-begin-after-member-access t)
(setq rtags-completions-enabled t)
(rtags-diagnostics)

It is taken from rtags #218

PS: I just found spacemacs #2327 where this is already discussed. Sorry for the noise.

@TheBB TheBB mentioned this pull request Apr 7, 2016
@steve-lorimer
Copy link
Contributor

Status on this?

@BinaryKhaos
Copy link

Judging from the lack of activity on this PR, no one is actively working on this anymore?

To get this moving again and to make it easier for someone to possibly take-over this task: What is the current stance on how rtags should be integrated into Spacemacs?

Since it is basically limited to C/C++, it should imho really go into the c-c++ layer itself, be coupled with cmakes-ide and be compiled/installed/updated locally for the user by Spacemacs, to have a great out of the box experience because most dists simply don't carry rtags in their official repositories.

@TheBB
Copy link
Collaborator

TheBB commented Sep 16, 2016

No, better to predicate the enabling of rtags support on whether rtags is installed rather than compiling it automatically. We're having enough trouble supporting the different varieties of systems even with Emacs acting as an abstraction layer.

@BinaryKhaos
Copy link

@TheBB: Was there anything in particular holding this pull request back from being actually merged or are there any open points of criticism that haven't been addressed?

If no one picks this up, I might have a look at it after I have finished my current projects. It would be nice to have this merged for 0.200.0 along with cmake-ide which would make this a bit more comfortable to use. Is there a time-frame when 0.200.0 is going to be released?

@TheBB
Copy link
Collaborator

TheBB commented Oct 17, 2016

I will have a look at the C/C++ layer soon™, including this and the cmake-ide PR.

uberjay pushed a commit to uberjay/spacemacs that referenced this pull request Nov 29, 2016
cmake-ide nicely orchestrates between cmake, flycheck, company-clang and
RTags by using cmake to generate a compile_commands.json that it uses to
set the appropriate compile flags for flycheck and company-clang. This
nicely centralizes all build related settings where they belong: in the
build system itself.

It comes with a zero need for configuration and usually works just out
of the box. Nevertheless, and recommended as well, build directory and
additional compile flags (...) can also be set through directory local
variables. In the future, we could improve here on the user experience
by providing an automatic and predicable naming scheme for build dirs
that the user can partially influence through a base directory variable.
With that in place, those build directories would be fully automatic and
still reusable by cmake-ide.

Since cmake-ide makes it a breeze to use RTags by automating much of the
necessary setup, I see this as a precursor to proper RTags support which
also requires the rtags lisp package to be installed and required along
with the RTags client/server counterpart (see pull request syl20bnr#2834).
@pedrovanzella
Copy link

What is the status on this one?

@jeremyong
Copy link

Bump please. The existing C++ layer is pretty useless imo

@syohex
Copy link
Contributor

syohex commented Apr 5, 2017

melpa/melpa#4672

rtags package have been separated into several packages. Please check it.

@delaanthonio
Copy link
Contributor

@TheBB I'm going have a go at adding support for rtags in the c-c++ layer. This is my plan:

  • refactor the c-c++ layer in preparation of adding support for rtags
  • add an rtags layer
  • add rtags support in the c-c++ layer

@deepankarsharma
Copy link

Any updates on getting rtags support for the C++ layer?

@robbyoconnor
Copy link
Contributor

@deepankarsharma - dead unless @mheathr rebases. Otherwise contribute it.

@serhii-serdiuk
Copy link

Hi All,

First of all thanks for your work on such a great project!
Could someone clarify the state of this PR?
Was it indeed merged to develop branch cause I could not find it there?

Thanks!

@myrgy
Copy link
Contributor

myrgy commented Nov 14, 2017

Hi @sserdyuk1991,

I think rtags support is currently on hold - I did preparing PR with cmake-ide.( #9432 )
Unfortunately it has a bug and slowdown emacs significantly in some cases (please see related MR discussions)

I'm using rtags locally - I took that and probably somebody's else PR and blended it together.
For now I'm very busy - so not able to prepare PR. (my version if on github)

@serhii-serdiuk
Copy link

Hi @myrgy,

Thanks for prompt reply!
I took a look at your version of rtags integration and at first glimpse it looks like more complete and up to date than one related to this thread. It would be great if it is merged to main repo.

I'm new to emacs and lisp so unfortunately I can't help with it right now.
Will be waiting for your PR.
Have a nice day!

@myrgy
Copy link
Contributor

myrgy commented Dec 17, 2017

Second try to integrate rtags: #9956
based on current rtags from MELPA

@syl20bnr
Copy link
Owner

@mheathr Thank you! 💜

My sincere apologies, this PR has not been merged in due time and has been replaced by a more recent PR #9956. I hope it won't prevent you from opening new PRs, don't hesitate to ping me with a PM on gitter if you have stalled PRs that you judge important and useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.