On Jan 16, 9:32 am, Peter Wolf <opus...@gmail.com> wrote:
> Hello, and thanks for all the help with the IntelliJ plugin.
>
> The next feature I want to implement is "references". That is, one
> selects a symbol, and then can go to the location where that symbol was
> defined (e.g. def, defn, let, etc.). One can also get a list of all the
> locations where that symbol is referenced. This feature is very nice
> for navigating code, and is also the core of many automatic refactorings
> (e.g. "rename").
>
> Implementing references are pretty straightforward in a static language
> like Java, were all the references are resolved at compile time.
> However, in a language like Clojure some references get resolved at run
> time.
>
> How do other IDEs handle this? Is there a recommended set of rules for
> what references can and can not be resolved by the editor? How does one
> detect a possible non-static reference, or how does one ensure that a
> reference will always refer to the same location?
>
> Note that I need a 100% reliable solution, if I am going to implement
> automatic refactoring on top of it. No one wants refactoring that
> messes up the code 5% of the time.
>
> Thanks
> Peter
I haven't been following the IntelliJ plugin. Does it use slime? SLIME
+ Lisp has had a solution for this for years by directly asking the
running lisp process. The high level description is that the process
keeps track of all of the functions it has loaded/compiled, and the
list of functions each of those functions calls. Then to find out who
calls foo, you just ask the process. The answer is pretty reliable and
doesn't require writing your own parser. Of course, it too can't deal
with eval'ing and identifiers in XML, but I'm not sure that anything
can.
I've been toying with the idea of implementing this in clojure.
Allen
It would be fairly straightforward to modify the running clojure
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---