psc-ide-vim icon indicating copy to clipboard operation
psc-ide-vim copied to clipboard

Import module as qualified when importing a qualified function

Open chexxor opened this issue 8 years ago • 2 comments

I haven't tested this in latest version of this plugin, but I want to ensure it's documented as existing or not in this plugin.

Would like to select Array.filter, execute PSCIDEimportIdentifier, and have import Data.Array as Array added to the imports list, rather than import Data.Array (filter).

@kRITZCREEK added this in the 0.11.5 release of PureScript. Demo here: https://github.com/epost/psc-ide-emacs/pull/103

chexxor avatar Jul 04 '17 16:07 chexxor

To be clear, I added a new subcommand to the addImport command here: https://github.com/purescript/purescript/blob/b3e470deb302f8f400bbe140e600eba5c9e2c2b5/psc-ide/PROTOCOL.md#subcommand-addqualifiedimport

They way I implemented it in the Emacs plugin is:

  1. Split qualifier and identifier
  2. Run a completion/type command for the identifier without filters
  3. a) 0 results -> display not found error b) 1 result -> add qualified import for module and qualifier c) n results -> ask the user which module is supposed to be imported

kritzcreek avatar Jul 05 '17 09:07 kritzcreek

in vim you can

PSCIDEimportModule Data.Array Array

But there is no support for that for PSCIDEimportIdentifier. I'd like to integrate PSCIDEimportModule and PSCIDEimportIdentifier into a single command.

coot avatar Jul 05 '17 10:07 coot