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

Improves jump-to-definition for Clojure modes #9792

Closed
wants to merge 1 commit into from

Conversation

agzam
Copy link
Contributor

@agzam agzam commented Oct 28, 2017

What does this PR do?

Improves/fixes jump-to-definition for Clojure layer

Rationale

Jump to definition in Clojure modes doesn't work reliably.

  • CIDER's default cider-find-var only works when CIDER is connected or jacked-in and even then it doesn't always work.
    • it doesn't work in cljs, cljc files and cider-repl-mode
    • sometimes it doesn't correctly recognize symbol-at-point and prompts user to enter one

The idea is to use cider-find-var whenever possible. If it is not available, or if it fails: use the fallback option - dumb-jump-go, it is simple and it works reliably in most cases (but CIDER's fn still preferable).

How to test?

  • Open any Clojure/Clojurescript project
  • try using g d and , g g
  • try in Clojure, Clojurescript and .cljc files if possible
  • execute M-x cider-jack-in
  • wait for CIDER to get connected to the REPL
  • try using g d and , g g again

@agzam
Copy link
Contributor Author

agzam commented Oct 28, 2017

related: #8663

@eggsyntax
Copy link

I've been using this for a week, and it's been a nice improvement over the default behavior. I think it'd make a nice improvement to SM.

@syl20bnr
Copy link
Owner

Thank you ! 💜
Cherry-picked into develop branch, you can safely delete your branch.

@syl20bnr syl20bnr closed this Dec 18, 2017
@syl20bnr syl20bnr removed the Merged label Dec 18, 2017
agzam added a commit to agzam/.spacemacs.d that referenced this pull request Dec 22, 2017
agzam added a commit to agzam/.spacemacs.d that referenced this pull request Jan 21, 2018
practicalli-johnny added a commit to practicalli-johnny/spacemacs-fork that referenced this pull request Jul 12, 2019
Update the existing `SPC m g g` keybinding to use the command
`spacemacs/clj-find-var`.  This makes finding a function definition a much
better experience as you dont have to have the REPL running to find a
definition, but when it is you can use a CIDER specific function.

`spacemacs/clj-find-var` is a wrapper that calls `cider-find-var` if the REPL is
running, otherwise it uses `dump-jump-go`.

Wrapper added in syl20bnr#9792
practicalli-johnny added a commit to practicalli-johnny/spacemacs-fork that referenced this pull request Jul 13, 2019
Update the existing `SPC m g g` keybinding to use the command
`spacemacs/clj-find-var`.  This makes finding a function definition a much
better experience as you dont have to have the REPL running to find a
definition, but when it is you can use a CIDER specific function.

`spacemacs/clj-find-var` is a wrapper that calls `cider-find-var` if the REPL is
running, otherwise it uses `dump-jump-go`.

Wrapper added in syl20bnr#9792
duianto pushed a commit that referenced this pull request Jul 13, 2019
Update the existing `SPC m g g` keybinding to use the command
`spacemacs/clj-find-var`.  This makes finding a function definition a much
better experience as you dont have to have the REPL running to find a
definition, but when it is you can use a CIDER specific function.

`spacemacs/clj-find-var` is a wrapper that calls `cider-find-var` if the REPL is
running, otherwise it uses `dump-jump-go`.

Wrapper added in #9792
kommen added a commit to kommen/spacemacs that referenced this pull request Aug 25, 2019
`cider-jump-to-var` was renamed to `cider-find-var` here:
clojure-emacs/cider@ceb2d7d#diff-e39c33031dc8d3e78b32ebee83293cd6L809-R846

In syl20bnr#9792 `spacemacs/clj-find-var`
was added to be used as the jump handler for clojure modes. It uses
`cider-find-var` which doesn't push jump positions onto the evil jump stack so
the no longer current defadvice was more apparent.
kommen added a commit to kommen/spacemacs that referenced this pull request Aug 25, 2019
`cider-jump-to-var` was renamed to `cider-find-var` here:
clojure-emacs/cider@ceb2d7d#diff-e39c33031dc8d3e78b32ebee83293cd6L809-R846

In syl20bnr#9792 `spacemacs/clj-find-var`
was added to be used as the jump handler for clojure modes. It uses
`cider-find-var` which doesn't push jump positions onto the evil jump stack so
the no longer current defadvice was more apparent.
smile13241324 pushed a commit that referenced this pull request Aug 31, 2019
`cider-jump-to-var` was renamed to `cider-find-var` here:
clojure-emacs/cider@ceb2d7d#diff-e39c33031dc8d3e78b32ebee83293cd6L809-R846

In #9792 `spacemacs/clj-find-var`
was added to be used as the jump handler for clojure modes. It uses
`cider-find-var` which doesn't push jump positions onto the evil jump stack so
the no longer current defadvice was more apparent.
Trapez pushed a commit to Trapez/spacemacs that referenced this pull request Sep 3, 2019
`cider-jump-to-var` was renamed to `cider-find-var` here:
clojure-emacs/cider@ceb2d7d#diff-e39c33031dc8d3e78b32ebee83293cd6L809-R846

In syl20bnr#9792 `spacemacs/clj-find-var`
was added to be used as the jump handler for clojure modes. It uses
`cider-find-var` which doesn't push jump positions onto the evil jump stack so
the no longer current defadvice was more apparent.
stephanschubert pushed a commit to stephanschubert/spacemacs that referenced this pull request Oct 23, 2019
Update the existing `SPC m g g` keybinding to use the command
`spacemacs/clj-find-var`.  This makes finding a function definition a much
better experience as you dont have to have the REPL running to find a
definition, but when it is you can use a CIDER specific function.

`spacemacs/clj-find-var` is a wrapper that calls `cider-find-var` if the REPL is
running, otherwise it uses `dump-jump-go`.

Wrapper added in syl20bnr#9792
stephanschubert pushed a commit to stephanschubert/spacemacs that referenced this pull request Oct 23, 2019
`cider-jump-to-var` was renamed to `cider-find-var` here:
clojure-emacs/cider@ceb2d7d#diff-e39c33031dc8d3e78b32ebee83293cd6L809-R846

In syl20bnr#9792 `spacemacs/clj-find-var`
was added to be used as the jump handler for clojure modes. It uses
`cider-find-var` which doesn't push jump positions onto the evil jump stack so
the no longer current defadvice was more apparent.
sei40kr pushed a commit to sei40kr/spacemacs that referenced this pull request Nov 11, 2019
Update the existing `SPC m g g` keybinding to use the command
`spacemacs/clj-find-var`.  This makes finding a function definition a much
better experience as you dont have to have the REPL running to find a
definition, but when it is you can use a CIDER specific function.

`spacemacs/clj-find-var` is a wrapper that calls `cider-find-var` if the REPL is
running, otherwise it uses `dump-jump-go`.

Wrapper added in syl20bnr#9792
sei40kr pushed a commit to sei40kr/spacemacs that referenced this pull request Nov 11, 2019
`cider-jump-to-var` was renamed to `cider-find-var` here:
clojure-emacs/cider@ceb2d7d#diff-e39c33031dc8d3e78b32ebee83293cd6L809-R846

In syl20bnr#9792 `spacemacs/clj-find-var`
was added to be used as the jump handler for clojure modes. It uses
`cider-find-var` which doesn't push jump positions onto the evil jump stack so
the no longer current defadvice was more apparent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants