
I'm a little stuck trying to generate context-sensitive completions for EclipseFP. For example, if the editor point is after "::" or "->", I'd like to offer all types currently visible, including those offered via the module's imports. There doesn't seem to be a way to do this via the GHC API, unless I emulate the compiler's operation (i.e. reading interface files, etc) Am I missing something in the API? Basically, getting top-level names for a module (and it's import decls) helps, but there's no selectivity. Is there a way to interrogate a reader environment to do this? Looking at Leksah's code, I'm not looking forward to reading and processing .hi files. And adding more complexity to (and more divergence from nominolo's) scion-server. -scooter

Try GHC.getNamesInScope, which will give you all the entities in scope. Then use GHC.lookupName to see what manner of beast the Name is bound to (an Id, Class, TyCon etc) Does that help? Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell- | users-bounces@haskell.org] On Behalf Of Scott Michel | Sent: 07 January 2011 06:31 | To: glasgow-haskell-users@haskell.org | Subject: Generating IDE completions via GHC | | I'm a little stuck trying to generate context-sensitive completions for | EclipseFP. For example, if the editor point is after "::" or "->", I'd like | to offer all types currently visible, including those offered via the | module's imports. There doesn't seem to be a way to do this via the GHC API, | unless I emulate the compiler's operation (i.e. reading interface files, etc) | | Am I missing something in the API? Basically, getting top-level names for a | module (and it's import decls) helps, but there's no selectivity. Is there a | way to interrogate a reader environment to do this? | | Looking at Leksah's code, I'm not looking forward to reading and processing | .hi files. And adding more complexity to (and more divergence from | nominolo's) scion-server. | | | -scooter | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (2)
-
Scott Michel
-
Simon Peyton-Jones