Hello,

This is certainly possible, I think.
The "fix import" action could try to resolve an unknown symbol by
first searching the symbol in one of the classpath available
namespaces, and then search for java classes in the classpath.
It could then add an import/require command for each found resolution
(and if several resolutions found, ad all, letting the user solve
manually the conflict).

This could be provided as an IDE action, and also, I think, as a
clojure function that could work directly on files.

I've added this to the wishlist of clojure-dev.

--
Laurent

On Nov 28, 9:03 am, "Paul Drummond" <[EMAIL PROTECTED]> wrote:
> Hi Martin,
>
> Well, this is the sort of feature provided by IDEs rather than editors as
> you say, so it's not a "clojure" specific issue.  It's whether your chosen
> IDE supports the feature you require.
>
> FYI, there is a NetBeans plugin (http://enclojure.org/) and a Eclipse plugin
> (http://code.google.com/p/clojure-dev/) in development.  I'm sure this kind
> of feature is either supported now or on the todo-list.  I can't say for
> sure however as I haven't tried them.
>
> Paul.
>
> 2008/11/28 Martin DeMello <[EMAIL PROTECTED]>
>
>
>
> > I've done a bit of Java programming, and one of the reasons I use an
> > IDE (netbeans) rather than plain vim is that I can write code without
> > having to bother about where every class I use comes from, then click
> > 'fix imports' and have netbeans statically examine the code and add
> > import statements. I've missed this in clojure - is it possible in
> > theory to examine a clojure program and a classpath, and generate the
> > import statements needed to make it compile? It needn't do a perfect
> > job, of course, but just handling the common case would be very useful
> > - as it is, I have to constantly go looking up the java docs to find
> > out what package provides every class I use.
>
> > martin
>
> --
> Iode Software Ltd, registered in England No. 6299803.
>
> Registered Office Address: 12 Sancroft Drive, Houghton-le-Spring, Tyne &
> Wear, DH5 8NE.
>
> This message is intended only for the use of the person(s) ("the intended
> recipient(s)") to whom it is addressed. It may contain information which is
> privileged and confidential within the meaning of applicable law. If you are
> not the intended recipient, please contact the sender as soon as possible.
> The views expressed in this communication may not necessarily be the views
> held by The Company.
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to