Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bindings for the command 'findsymbol' #17

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

dan-t
Copy link

@dan-t dan-t commented Dec 26, 2013

Hi Bit,

the hsimport command and the Vim plugin vim-hsimport are now using the 'findsymbol' command.

https://github.com/dan-t/hsimport
https://github.com/dan-t/vim-hsimport

Is there any chance to get my additions of hdevtools and vim-hdevtools merged?

Greetings,
Daniel

@bitc
Copy link
Owner

bitc commented Dec 27, 2013

I'll look over this hopefully soon when I get some time.

dan-t added 3 commits January 1, 2014 18:24
To be able to extend the import list also by modules of the current
project, 'findsymbol' needs to get the source files, where it should
search for the desired symbol.

A project might contain a lot of source files, so we can't just
take every source file, because the loading of each file with
GHC might take some time.

Currently a quite simple heuristic is used to find the source files,
by using 'grep' and having a regex, which should match if the
symbol is explicitely exported from the module.

Currently the regex matches only export lists of the form:

module Blub
   ( symbol1
   , symbol2
   ) where
@dan-t
Copy link
Author

dan-t commented Jan 4, 2014

Hi Bit,

the additional changes here are to call the 'findsymbol' command with source
files that might contain the desired symbol, to be able to extend the import list
by modules of the current project.

Currently there's a quite simple heuristic to find the potenial source
files by just grepping through the export list of the module.

So there's certainly room for improvement, but the worst thing that might
happen is, that you just can't select some modules of your current project
for the import.

Greetings,
Daniel

@dan-t
Copy link
Author

dan-t commented Jan 4, 2014

Perhaps it makes more sense to remove the "grepping" code from vim-hdevtools
and let the caller of 'findsymbol' determine the source files.

So that 'findsymbol' would look like:

function! hdevtools#findsymbol(identifier, srcFiles)
   ...

Greetings,
Daniel

Remove the mostly application specific part of retrieving the
source files for the 'findsymbol' command.
@dan-t
Copy link
Author

dan-t commented Jan 5, 2014

I've now changed 'hdevtools#findsymbol' to:

function! hdevtools#findsymbol(identifier, srcFiles)
...

The mostly application specific part of retrieving of
the source files is now removed.

Greetings,
Daniel

dan-t added 3 commits January 7, 2014 18:28
This makes it possible to have multiple haskell projects
loaded inside one vim instance and a working hdevtools
for each project.
This reverts commit 4d2acd3.

Buffer local options don't harmonize very well with other
vim plugins like syntastic, which looks only after the
global options.
This reverts commit e4b9178.

vim plugins like Syntastic don't use the hdevtools vim functions,
they just call the hdevtools binary and use the g:hdevtools_options
variable, so the separate option g:hdevtools_src_dir isn't considered.

So it's better to add the source dir to the g:hdevtools_options, that
it's also considered by Syntastic.
@bitc
Copy link
Owner

bitc commented Nov 17, 2018

Is there still interesting in this pull request?

@dan-t
Copy link
Author

dan-t commented Nov 17, 2018

Personally I do not need it anymore. ˋvim-hsimportˋ contains pretty much the code of
this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants