LoginSignup
18
17

More than 5 years have passed since last update.

Atomのhaskell-ghc-modをstack使用時にも動くようにする

Last updated at Posted at 2015-07-03

stackでghc-modを使う試行錯誤のメモを参考にまずはstackを使っていてもghc-modが動くように準備します(hirataraさんありがとうございます!)。
cabal configureは下の様に各種パスをstack pathから引っ張ってきた方が楽かもしれません。

PATH=$(stack path --bin-path):$PATH cabal configure \
    --package-db=clear \
    --package-db=global \
    --package-db=$(stack path --snapshot-pkg-db) \
    --package-db=$(stack path --local-pkg-db)

stackとghc-modが一緒に動くように出来たら、次にAtomのhaskell-ghc-modパッケージのghc-modを呼んでいる箇所をstack経由で呼ぶように書き換えます。
haskell-ghc-modの設定画面から『View Code』ボタンでソースを開き、下記の様に書き換えます。

ghc-modi-process.coffeeの33・34行目

command: 'stack'
args: ['exec', '--', 'ghc-mod', '--map-file', 'test', 'version']

ghc-modi-process-base.coffeeの30行目

proc = CP.spawn('stack', ['exec', '--', 'ghc-modi'], options)

ghc-modi-process-base.coffeeの55・56行目

command: 'stack'
args: ['exec', '--', 'ghc-mod'].concat(cmd)
18
17
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
17