Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Run ghcide under a nix shell #3

Closed
moodmosaic opened this issue Apr 7, 2020 · 11 comments · Fixed by #4
Closed

Run ghcide under a nix shell #3

moodmosaic opened this issue Apr 7, 2020 · 11 comments · Fixed by #4
Labels
enhancement New feature or request

Comments

@moodmosaic
Copy link
Owner

As per @novadiscovery fork (@regnat novainsilico@908bfa2)

@@ -22,7 +22,7 @@ class GhcideAutoLanguageClient
  startServerProcess(projectPath) {	  startServerProcess(projectPath) {
    let proc =	    let proc =
      (require("child_process")).spawn(	      (require("child_process")).spawn(
-        "ghcide", ["--lsp"],  { "cwd" : projectPath });
+        "nix-shell", ["--run", "ghcide --lsp"],  { "cwd" : projectPath });

    return proc;	    return proc;
  }

we could probably add a setting which allows to override how ghcide is invoked.

@moodmosaic moodmosaic added the enhancement New feature or request label Apr 7, 2020
@thufschmitt
Copy link

Thanks for the notice :)

The fork was just a dirty experiment to try ghcide on an internal project, but the experiment seems successful, so it would be really nice to directly have this configurable rather than maintaining a fork

@moodmosaic
Copy link
Owner Author

It could be also as an option (checkbox) e.g. Use nix-shell or something(?)

@thufschmitt
Copy link

I think a text field to allow for an arbitrary command-line would be nicer as I there are other setups that might require a different command − for example the convention for running ghcide with bazel seems to be to have a .ghcide script in the directory (see tweag/rules_haskell#1262).

@moodmosaic
Copy link
Owner Author

Perhaps two text fields, one for the actual command, and one for the comma separated args.

e.g.

 cmd: ghcide
args: --lsp
 cmd: nix-shell
args: --run, ghcide --lsp

What do you think? 😃

@fredericcogny
Copy link

Yes that would be lovely

@moodmosaic
Copy link
Owner Author

Agreed 🚀

@moodmosaic
Copy link
Owner Author

moodmosaic commented Jun 8, 2020

@regnat, @fredericcogny, here's what we need, looks good to you? 🤓

image

@thufschmitt
Copy link

Looks awesome 👍 :)

@moodmosaic
Copy link
Owner Author

@regnat, if you can, it'd be nice if you can test #4 or if you can show me an easy way to test it myself. I haven't used Nix yet (perhaps now's the right time) 😃

@moodmosaic
Copy link
Owner Author

Released as [email protected] 🌮 https://atom.io/packages/ide-haskell-ghcide

@moodmosaic
Copy link
Owner Author

FYI, I'm going to archive this project as per @ndmitchell's announcement and the haskell-language-server direction in general. I just released haskell for Atom with

  • haskell-language-server-wrapper as the default
  • options to run under a nix-shell, ghcide (backwards compatible with this package)

🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants