Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ide-haskell for atom editor isn't working

I'm trying to use the Ide-Haskell package for atom, but for some reason, it's not working.

First, I have ghc-mod and stylish haskell installed in sandboxes under ~/lib/. Here is what my config.cson file looks like:

athan@THETA ~> cat ~/.atom/config.cson
'global':
  'exception-reporting':
    'userId': '3b5a8a6c-7778-b310-6a5f-d8ecc314b30f'
  'welcome':
    'showOnStartup': false
  'core':
    'themes': [
      'atom-dark-ui'
      'seti-syntax'
    ]
  'ide-haskell':
    'ghcModPath': '/home/athan/lib/ghc-mod-5.2.1.1/.cabal-sandbox/bin/ghc-mod'
    'stylishHaskellPath': '/home/athan/lib/stylish-haskell-0.5.11.0/.cabal-sandbox/bin/stylish-haskell'
  'editor':
    'fontSize': 14
    'showIndentGuide': true
    'showInvisibles': true
    'softWrapAtPreferredLineLength': true
    'invisibles': {}

I've tested those paths, and they're correct - I can call command --help, etc.

I'm also currently running linux, not Mac, so I had to add some keymappings:

athan@THETA ~> cat ~/.atom/keymap.cson
'.workspace':
  'ctrl-alt-o': 'ide-haskell:toggle-output'
'.editor':
  'ctrl-alt-s': 'ide-haskell:prettify-file'

These register just fine, and are visible in the ide-haskell's package settings. However, issuing the keystroke doesn't do anything (It used to open a file and save-as, respectively).

Where am I most likely to have screwed up? I installed ide-haskell before finishing the ghc-mod installation, but that shouldn't really matter... the links are correct. If anyone could help with this, I would be ecstatic :)

like image 891
Athan Clark Avatar asked Dec 25 '22 00:12

Athan Clark


2 Answers

You need to create a cabal project in the directory you're working in. Just run cabal init and answer the questions. Then open atom in the current directory. The Haskell IDE menu should appear.

like image 195
machunter Avatar answered Dec 27 '22 20:12

machunter


I know this is old but I want to mention that if you are using stack then you can run stack exec atom to run atom within your configured Haskell environment. That works great for me on Windows.

like image 23
jrk Avatar answered Dec 27 '22 20:12

jrk