-
Notifications
You must be signed in to change notification settings - Fork 110
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
Expose a little bit more functionality in the library API #138
Comments
Awesome! I've been wanting to try this myself for a while. How do you run your code to try it? I use VS Code normally - do you know what extension you would use? Regarding loading, sure, that can get its own entry point. One word of warning, it's nasty heuristics, but that is a good reason for no one else to have to try to do it. Have you seen the Session file? That's a higher level API which might answer questions like parsing load messages. If so, I can expose all of it. If not we can figure out something else. |
I think the functions in Language.Haskell.Ghcid.Parser would be more useful than those in the Session file. Unfortunately what's in |
Are you invoking Concretely, what's your plan of attack? As far as I can see, there are a few options:
I am very interested in helping, since it's on my todo list to do this anyway. |
I'm running Ideally, I'd love to be able to fork an IO action that runs But just being able to read a line from ghcid's stdout & decode it with aeson would be a great benefit. For now, I think I can just use |
If the overhead of watching a .json file (either CPU wise or complexity wise) is too large I'm not averse to |
I wouldn't say file watching is prohibitively expensive. I'm forking ghcid from a Haskell script(not an editor) so I can use the |
Seems reasonable enough simplification that I'd happily take a patch, although not hard enough work that I'm likely to write such a patch in the near future :) |
I was amusing myself with trying to make a language-server-protocol server on top of ghcid (over at https://github.com/danr/sixserver/blob/master/app/Main.hs). I find the library API very pleasant to use but it is missing two features which would be helpful:
Figure out how to launch
ghci
(via stack, cabal repl etc), which is done inautoOptions
right now: https://github.com/ndmitchell/ghcid/blob/master/src/Ghcid.hs#L102Expose parsing error messages from ghci on other occasions than on a load. Namely, if I get a list of strings from
exec
orexecStream
I would like to try to parse them into a list ofLoad
.If this functionality was available it would be easier to make a language server on top of ghcid.
Thanks!
The text was updated successfully, but these errors were encountered: