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

Fix hoogle lookup from local servers #834

Merged
merged 2 commits into from
Sep 16, 2015
Merged

Fix hoogle lookup from local servers #834

merged 2 commits into from
Sep 16, 2015

Conversation

sheyll
Copy link
Contributor

@sheyll sheyll commented Aug 25, 2015

Use a better way to check if the hoogle process is alive: Instead of
checking if the corresponding buffer-name is an alive process, store the
process handle in a global variable and check that.

The problem is that when using 'hoogle-lookup-from-local' without any
hoogle server running, a new local hoogle server is started, but the
code fails to recognize that server is running and instead repeatedly
reports that the server is not running offering to start it.

Use a better way to check if the hoogle process is alive: Instead of
checking if the corresponding buffer-name is an alive process, store the
process handle in a global variable and check that.

The problem is that when using 'hoogle-lookup-from-local' without any
hoogle server running, a new local hoogle server is started, but the
code fails to recognize that server is running and instead repeatedly
reports that the server is not running offering to start it.
@gracjan
Copy link
Contributor

gracjan commented Sep 10, 2015

@sheyll: Have you had time to look into this?

Start "hoogle" directly instead of going through "/bin/sh -c ..."
as suggested by 'gracjan' here:
[951e1bc#commitcomment-13024225]
@sheyll
Copy link
Contributor Author

sheyll commented Sep 15, 2015

@gracjan is this ok now? I could only test on linux

gracjan added a commit that referenced this pull request Sep 16, 2015
Fix hoogle lookup from local servers
@gracjan gracjan merged commit 7d1e643 into haskell:master Sep 16, 2015
@gracjan
Copy link
Contributor

gracjan commented Sep 16, 2015

Great, thanks.

The functionality around hoogle and hayoo could use refactoring and be merged. Can you look into improving code there?

@jb55
Copy link

jb55 commented Sep 18, 2015

I think you need to pass --local to hoogle otherwise it uses file:// links and browsers refuse to open those. Should I PR this?

@jb55
Copy link

jb55 commented Sep 18, 2015

Not strictly related to this PR but I'm curious to why it's not there already because local hoogle links are broken for me otherwise...

@gracjan
Copy link
Contributor

gracjan commented Sep 18, 2015

I do not understand... What file links?

@jb55
Copy link

jb55 commented Sep 18, 2015

Sorry, when running hoogle with -d /path/to/docs, which is the case for auto-generated nix environments:

hoogle "$COMMAND" -d /nix/store/smcqcq332zwb9g6xqvdz4zsxgk3bm253-hoogle-local-0.1/share/doc/hoogle "$@"

Without the --local flag, links to docs on the search results page are file:///path/to/docs instead of http://localhost/file/path/to/docs which prevents them from working due to security mechanisms in browsers.

I was just wondering if it makes to add --local while we're at it, or at least an option to customize the hoogle server arguments.

@gracjan
Copy link
Contributor

gracjan commented Sep 19, 2015 via email

@jb55
Copy link

jb55 commented Sep 20, 2015

All I need is the ability to pass --local to hoogle server. I'll start a new issue.

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.

3 participants