Skip to content
New issue

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

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

Already on GitHub? # to your account

issue with phpactor-find-references #20

Open
kermorgant opened this issue Mar 4, 2019 · 3 comments
Open

issue with phpactor-find-references #20

kermorgant opened this issue Mar 4, 2019 · 3 comments

Comments

@kermorgant
Copy link

Hello,

First, thanks for this package ! In fact, my issue is more with phpactor.el's phpactor-find-references function but having written it, I thought I'd ask for advice here. I hope it's ok.

So after having registered phpactor.el for smartjump, when I run smart-jump-references , both phpactor-find-references and smart-jump-find-references-with-ag run and each of them opens a new buffer.

Could you confirm it's not the expected behaviour and maybe suggest an example to take inspiration from ?

@jojojames
Copy link
Owner

Cool package.

I'm guessing phpactor finds references asynchronously?
https://github.com/jojojames/smart-jump/blob/master/smart-jump-typescript-mode.el

Should be an example if so.

If it's not ran asynchronously, can you post the snippet used for registering?

@kermorgant
Copy link
Author

thanks !

In fact no, phpactor.el calls phactor with call-process-region (code path goes from here, here , here and here) so it should be synchrounously.

Here's the snippet I've used

(defun mk/smartjump-php ()
  "Registers smartjump function for php."
  (smart-jump-register :modes '(php-mode yaml-mode)
                       :jump-fn 'phpactor-goto-definition
                       :refs-fn 'phpactor-find-references
                       :should-jump t
                       :heuristic 'point
                       :async nil
                       :order 1))

@jojojames
Copy link
Owner

Maybe the point is not moving after find-references completes successfully. For example, when I call find-references, I usually have the point move to the references window.

Maybe trying use 'error instead of 'point and see where that gets you.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants