Emacs integration for psc-ide
The package is available on MELPA. Please read the MELPA’s Getting Started guide
for more information. Once you have MELPA configured install psc-ide-emacs
via package.el
:
M-x package-install RET psc-ide RET
Add the following to your ~/.emacs
:
;; specify path to the 'psc-ide' executable
(require 'psc-ide)
(add-hook 'purescript-mode-hook
(lambda ()
(psc-ide-mode)
(company-mode)))
This was bound to C-SPC
in earlier versions but was too intrusive for
usual emacs users so you’ll have to bind it to a key of choice.
eg. (global-set-key (kbd "C-SPC") 'company-complete)
If the import is ambiguous you will get a selection of modules, from which you can choose the identifier you want.
Can be turned of with:
(customize-set-variable 'psc-ide-add-import-on-completion nil)
If you set (custom-set-variables 'psc-ide-rebuild-on-save t)
psc-ide will
try to rebuild your module on every save.
This is determined by the variable psc-ide-flycheck-ignored-error-codes
. It can be configured
with customize-option
or similar methods.
When the cursor is placed over an error that includes suggestion information, use C-c M-s
to
apply the suggestion.
Key | Function |
---|---|
C-c C-s | psc-ide-server-start |
C-c C-q | psc-ide-server-quit |
C-c C-l | psc-ide-load-all |
C-c C-a | psc-ide-add-clause |
C-c C-c | psc-ide-case-split |
C-c C-i | psc-ide-add-import |
C-c C-t | psc-ide-show-type |
C-c C-b | psc-ide-rebuild |
C-c C-S-l | psc-ide-load-module |
C-c M-s | psc-ide-flycheck-insert-suggestion |