Fork me on GitHub
#lsp
<
2021-11-30
>
Drew Verlee16:11:30

Is there a way to find the "last reference" for a var? That would be amazing im so tired of looking through repackaging code.

ericdallo17:11:02

why can't you find-references and select the last from the list?

ericdallo17:11:25

or you meant find the last definition of a var if it has multiple?

Drew Verlee17:11:41

I mean, i want to see where a var finaly bottoms out (defn zoo [x] x**) (defn bar [x] (zoo x) (defn foo [x*] (bar x) With my cursor on '**'* *`i want to go to "*" or see a list of those places.`

ericdallo17:11:53

where is your cursor 😅 ?

Drew Verlee17:11:10

it got formatted

ericdallo17:11:22

I don't understand why on you want to go to * if they are not related

ericdallo17:11:54

(defn zoo [x] x)
(defn bar [x] (zoo x))
(defn foo [x|] (bar x))
on | , that x is not related with the x on zoo right?

Drew Verlee17:11:41

foo just passes the var to zoo

ericdallo17:11:07

is not easy though, we would need to check every reference to x that is passed to a function

Drew Verlee17:11:59

Yea. I haven't given this any thought 🙂 . I'm just tired of walking a tree of code just to find out where it ends up being realized.

Drew Verlee17:11:11

usually as part of a side effect

Drew Verlee17:11:20

showing on the dom, being sent to another API, etc...

Drew Verlee17:11:47

The best way to solve this is to not keep pulling vars out of maps and repackaging them. and have unique keys for information.

ericdallo17:11:56

yes, makes sense

ericdallo17:11:20

it'd be a really hard feature to implement I think, and probably with a not good performance