|
|
|
|
|
by lemming
3382 days ago
|
|
I develop Cursive, an IDE for Clojure code. I handle this for Java interop in a couple of ways. Cursive does type inference (or propagation, really) in the editor, so if you have enough type hints it knows what the type of a symbol is. This allows a few tricks (| is the caret): If you've already typed the form and are just changing the head symbol, you're golden: (.myMeth| my-object)
If Cursive can accurately determine the type of my-object, you'll only see the relevant completions, i.e. methods from that type.If you're using Clojure's threading forms, Cursive understands that: (-> my-object .myMeth|)
also works.Otherwise, if you're typing out a new form you can do: (my-object .myMeth|)
and when you auto-complete the forms will be switched around to: (.myMethod my-object |).
|
|