-
Notifications
You must be signed in to change notification settings - Fork 35
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
Possibility to find references #75
Comments
@xcwen any ideas on how to implement this? I know some other simple implementations of this would just do a grep for things that match the symbol name, though that usually has a number of false positives. Maybe we could start with that and then narrow that list by using Seems like there might be a better way, but maybe this could work? Thoughts? (Actually, that alone wouldn't solve the use case mentioned above, but maybe the idea could be extend further for that) Another possibility is to try and use cscope. |
I solved this functionality.
|
@ilyaguy thanks for your solution. I'm going to try it out for a few days. At a first glance, it seems like its definitely useful and better than just a raw search, but it does have a bunch of shortcomings.
|
@tam5 yes, it is just grep over TAGS file. So, it has some false positives. But it is faster than xref may use different backends for search, but at this moment I don't know how to customise it or how to write new backend. |
@tam5 I've found https://github.com/dedi/gxref
|
@ilyaguy You can try out ggtags: https://github.com/leoliu/ggtags The installation method recommends installing an older version of GNU Global and ctags - I've written up instructions but haven't merged them in yet. The instructions are available on the read me of my .emacs.d: https://github.com/jonnycyr/.emacs.d |
@jonnycyr So are the gtags better than the php tags generated through the suggestions in this packages README? Also, do you need both GNU global and ctags? I thought ctags was just for c/c++ so you would need GNU global and something to generate php tags (or does ctags do that?) We need lsp and the different implementations to be finished to we can put the world of tags behind us |
@cmatzenbach The ggtags package just gives you the ability to jump to variables, see occurrences of variables, etc. ac-php let’s you jump to function definitions but not variable definitions (yet). I haven’t used ggtags in a while actually, but I believe ctags helps with php generation, I’m not quite sure. Also, what I linked is now my old configuration. My newer one is here: https://github.com/jonnycyr/.emacs.d I used to use lsp-php, but I stopped because of what you said - it’s really slow. It might be worth checking out eglot. I’ve been trying to use it in my spare time but I’ve run into difficulties trying to install it (I use straight.el instead of the default package manager, that may be why). I also used to use ggtags. I was running into lagging issues so I stopped. I haven’t had time to try and fix it since then. I believe this package is the best to develop php in, I haven’t really felt the need for lsp. Then again, I haven’t used it much, so I don’t know what I’m missing. I’d recommend checking out friends of Emacs php development, I think they’re just Emacs-php on GitHub. There’s a ton of packages being developed, phpactor (I believe) acts like lsp. I apologize for the lack of links, I’m on mobile! |
Is there any possibility to find references to symbol at point?
For example, I want to search "all child of the class".
The text was updated successfully, but these errors were encountered: