Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Stuart Sierra
On Jan 17, 10:25 am, Peter Wolf wrote: > How is the Clojure compiler tested?  Is there a set Clojure code that > serves as Unit tests?  I need something with all the corner cases both > for syntax and references. The early beginnings of a test suite are in clojure.contrib.test- clojure -Stuart

Re: Common backend project? (was: Re: How to implement "go to definition" and "find all references")

2009-01-17 Thread Meikel Brandmeyer
Hi, Am 17.01.2009 um 18:12 schrieb Meikel Brandmeyer: things, like the Parser mentioned above. Or Chouser's or I'm sorry. I meant Chouser's show. Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Common backend project? (was: Re: How to implement "go to definition" and "find all references")

2009-01-17 Thread Meikel Brandmeyer
Hi, Am 17.01.2009 um 16:22 schrieb Peter Wolf: I think much of the parser, such as the JFlex lexer is certainly reusable. The recursive descent parser outputs Intellij objects, but with pretty minor changes could be made reuseable. Please feel free to take anything you want. http://code.goog

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Peter Wolf
Excellent! How is the Clojure compiler tested? Is there a set Clojure code that serves as Unit tests? I need something with all the corner cases both for syntax and references. Thanks P Stephen C. Gilardi wrote: > > On Jan 17, 2009, at 8:40 AM, Peter Wolf wrote: > >> Actually, the observati

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Peter Wolf
Hi Laurent I think much of the parser, such as the JFlex lexer is certainly reusable. The recursive descent parser outputs Intellij objects, but with pretty minor changes could be made reuseable. Please feel free to take anything you want. http://code.google.com/p/clojure-intellij-plugin/so

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread lpetit
Hello Peter, As I understand, you've made what I also began to make for clojuredev (clojure dev environment for eclipse me and other folks are working on on our spare time) : a static source code parser. Mine is currently not very tested (and maybe not very usefull as is, because it has not yet b

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Stephen C. Gilardi
On Jan 17, 2009, at 8:40 AM, Peter Wolf wrote: Actually, the observation below might be really good news. Does it means that all references are resolved at compile time? Do I ever have to run the code to figure out the context of a reference? Or, does the lexical context give me all the

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Peter Wolf
Actually, the observation below might be really good news. Does it means that all references are resolved at compile time? Do I ever have to run the code to figure out the context of a reference? Or, does the lexical context give me all the information I need? I have already reimplemented t

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Stuart Sierra
Hi Peter, On Jan 16, 5:37 pm, Peter Wolf wrote: > Hi and thanks for all the feedback > > How does SLIME handle this case? > > user=> (def foo 1) > #'user/foo > user=> (defn bah [] (let [foo 2] foo)) > #'user/bah > user=> (bah) > 2 SLIME doesn't handle it at all; it just sends strings to the Lis

Re: How to implement "go to definition" and "find all references"

2009-01-16 Thread Peter Wolf
Hi and thanks for all the feedback How does SLIME handle this case? user=> (def foo 1) #'user/foo user=> (defn bah [] (let [foo 2] foo)) #'user/bah user=> (bah) 2 If I select the "foo" inside the let, I want the local one How does the running image figure that out? What does the API to the L

Re: How to implement "go to definition" and "find all references"

2009-01-16 Thread lpetit
Hello, While I understand this solution has been long in place for Lips, I don't think it looks like the ideal solution, e.g. in a world where the "source code" is still in files, and not managed by the "lisp image". I'm aware of just smalltalk that does this cleanly (it is even managing versions

Re: How to implement "go to definition" and "find all references"

2009-01-16 Thread Stuart Sierra
On Jan 16, 10:32 am, Peter Wolf wrote: > 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.).   Try looking at clojure.contrib.repl-utils and its "source" macro. -Stua

Re: How to implement "go to definition" and "find all references"

2009-01-16 Thread Allen Rohner
On Jan 16, 9:32 am, Peter Wolf 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

Re: How to implement "go to definition" and "find all references"

2009-01-16 Thread Christophe Grand
Peter Wolf a écrit : > 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. > Even Java refactoring tools messes up the code each time something is too dynamic (reflecti