[Haskell-cafe] Useful IDE features - What abaut automaticallyadding import statements?

Marc Weber marco-oweber at gmx.de
Sun Jun 17 11:46:07 EDT 2007


On Sun, Jun 17, 2007 at 03:39:25PM +0100, Claus Reinke wrote:
> in my vim setup, i can hit '_i' (import) or '_im' (import module) on an 
Great. To late ;(
I've now implemented this as well. My setup is getting the information
directly from the installed packages (thus ghc-pkg describe package and
then ghc -show-iface eachmodule.hi) Because I use caching it
should be reasonable fast ? (I hope so, I still have to do some testing)
The used packages are taken from the cabal file (and / or buffer
setting)

> identifier to get a menu of modules from which it could be imported;
> selecting an entry adds an import to the current module, either for the
> identifier only, 

  import Foo (a)

add identifier b
results in
  import Foo (a,b) 

? 

or for the whole module it comes from (this feature 
> gets its information from haddock's indices 
I'm using tags and the plain source file most of the time.
So I don't have trouble generating haddock documentation.
I think its easy but I haven't spent much time on this.
It contains all, the documentation and the implementation.

> combined with quickfix mode, which will jump to the identifier not
> in scope, this seems to be quite close to what you ask for?
I'll let you know when having finished the quickfix integration.
Perhaps this can be done all automatically?
> http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/
> there's also '_.' which will use the same data to suggest possible
> fully qualified identifiers for the id under cursor.
This might be useful, too

> HaRe also had some transformations for manipulating imports/exports.
> http://www.cs.kent.ac.uk/projects/refactor-fp/hare.html
I don't know HaRe at all. Would this even work when working with #ifdef
etc?

I'd like to have some features, such as _T ..
But this only works if the file can be parsed by ghc, right?

Thanks for your suggestion.
Marc Weber


More information about the Haskell-Cafe mailing list