feat(gs/emacs): Update hie invocation for depot
Update the invocation of the hie.sh script as part of +grfn/haskell-mode-setup to be compatible with the new depot-integrated xanthous. Change-Id: Ia3ef50fb08464a533efdfed4da66e2be00446ea6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/891 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: BuildkiteCI
This commit is contained in:
parent
f980f0f6bd
commit
2ec3254f85
1 changed files with 15 additions and 12 deletions
|
@ -702,16 +702,18 @@
|
||||||
(flymake-mode -1)
|
(flymake-mode -1)
|
||||||
;; If there’s a 'hie.sh' defined locally by a project
|
;; If there’s a 'hie.sh' defined locally by a project
|
||||||
;; (e.g. to run HIE in a nix-shell), use it…
|
;; (e.g. to run HIE in a nix-shell), use it…
|
||||||
(let ((hie-directory (locate-dominating-file default-directory "hie.sh")))
|
(when-let ((project-dir (locate-dominating-file default-directory "hie.sh")))
|
||||||
(when hie-directory
|
(cl-flet
|
||||||
(setq-local lsp-haskell-process-path-hie (expand-file-name "hie.sh" hie-directory))
|
((which (cmd)
|
||||||
|
(s-trim
|
||||||
|
(shell-command-to-string
|
||||||
|
(concat
|
||||||
|
"nix-shell "
|
||||||
|
(expand-file-name "shell.nix" project-dir)
|
||||||
|
" --run \"which " cmd "\" 2>/dev/null")))))
|
||||||
(setq-local
|
(setq-local
|
||||||
haskell-hoogle-command
|
lsp-haskell-process-path-hie (expand-file-name "hie.sh" project-dir)
|
||||||
(s-trim
|
haskell-hoogle-command (which "hoogle"))))
|
||||||
(shell-command-to-string
|
|
||||||
(concat
|
|
||||||
"nix-shell " (expand-file-name "shell.nix" hie-directory)
|
|
||||||
" --run \"which hoogle\" 2>/dev/null"))))))
|
|
||||||
;; … and only then setup the LSP.
|
;; … and only then setup the LSP.
|
||||||
(lsp))
|
(lsp))
|
||||||
|
|
||||||
|
@ -727,9 +729,10 @@
|
||||||
;; (haskell-mode . lsp-haskell-enable)
|
;; (haskell-mode . lsp-haskell-enable)
|
||||||
:config
|
:config
|
||||||
(add-hook 'haskell-mode-hook #'+grfn/haskell-mode-setup 't)
|
(add-hook 'haskell-mode-hook #'+grfn/haskell-mode-setup 't)
|
||||||
(setq lsp-haskell-process-path-hie "/home/griffin/.nix-profile/bin/hie-8.6.5"
|
(setq
|
||||||
lsp-haskell-process-args-hie
|
;; lsp-haskell-process-path-hie "/home/griffin/.nix-profile/bin/hie-8.6.5"
|
||||||
'("-d" "-l" "/tmp/hie.log" "+RTS" "-M4G" "-H1G" "-K4G" "-A16M" "-RTS")))
|
lsp-haskell-process-args-hie
|
||||||
|
'("-d" "-l" "/tmp/hie.log" "+RTS" "-M4G" "-H1G" "-K4G" "-A16M" "-RTS")))
|
||||||
|
|
||||||
(use-package! lsp-imenu
|
(use-package! lsp-imenu
|
||||||
:after (lsp-mode lsp-ui)
|
:after (lsp-mode lsp-ui)
|
||||||
|
|
Loading…
Reference in a new issue