hdevtools icon indicating copy to clipboard operation
hdevtools copied to clipboard

Add command 'findsymbol'

Open dan-t opened this issue 12 years ago • 3 comments

Hi Bit,

I've added the command 'findsymbol', to be able find the modules where a given symbol is defined.

Greetings, Daniel

dan-t avatar Oct 21 '13 20:10 dan-t

Interesting. Could you please explain a bit more what this does, maybe with an example? And the difference between the "info" command? Thanks!

bitc avatar Nov 10 '13 23:11 bitc

Hi Bit,

On Sun, Nov 10, 2013 at 03:32:19PM -0800, Bit Connor wrote:

Interesting. Could you please explain a bit more what this does, maybe with an example? And the difference between the "info" command? Thanks!

The 'info' command shows the type information of a given symbol and in which module the symbol is defined. The basis for this command are the already imported moduls.

The 'findsymbol' command should be the basis for extending the import list. The idea is, that 'findsymbol' finds all occurences of the given symbol, if it's defined in multiple modules, than the user can choose which one the wants and than the import list gets extended, if necessary.

Until now I didn't have put that much time into the whole thing, but I have started a simple command line program which should be extending the import list.

Would you have something against a 'hdevtools import' command: hdevtools import 'Control.Applicative' '<$>' ?

From a user perspective it would be easier if he just needs to install 'hdevtools' and 'vim-hdevtools' to get the whole thing working.

Greetings, Daniel

dan-t avatar Nov 11 '13 09:11 dan-t

Hi Bit,

I have done some further changes which I try to summarize.

The first few commits are about better error handling for the 'findsymbol' command and about catching GHC exceptions when reading module informations.

The bigger change is about allowing the 'findsymbol' command to take any number of source files.

This is the basis to be able to extend the import list by modules of the current project.

Greetings, Daniel

dan-t avatar Jan 04 '14 14:01 dan-t