paulyoung / psc-ide-emacs

Emacs integration for PureScript's psc-ide tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

http://melpa.org/packages/psc-ide-badge.svg

psc-ide-emacs

Emacs integration for psc-ide

Installation

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

Configuration

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)))

Usage

Start the Server C-c C-s

Load all the modules C-c C-l

Get completions from the modules you imported while you type (through company-mode)

http://i.imgur.com/8WnRh0s.gif

Get completions from all modules in your project with company-complete

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)

http://i.imgur.com/LR69MdN.gif

Show type for identifier under cursor C-c C-t

http://i.imgur.com/A8cXe9t.gif

Add a clause for the function definition under cursor C-c C-a

http://i.imgur.com/VNeC3z8.gif

Case Split the given type under cursor C-c C-c

http://i.imgur.com/hTnHxhK.gif

Add an import for the identifier under cursor C-c C-i

If the import is ambiguous you will get a selection of modules, from which you can choose the identifier you want.

http://i.imgur.com/VBXDvPg.gif

Add an import on completion (turned on by default)

Can be turned of with:

(customize-set-variable 'psc-ide-add-import-on-completion nil)

http://i.imgur.com/r6rl2lT.gif

Rebuild the current module and get quick error reporting C-c C-b

If you set (custom-set-variables 'psc-ide-rebuild-on-save t) psc-ide will try to rebuild your module on every save.

http://i.imgur.com/c0L6C4B.gif

Flycheck Support

Ignore certain errors or warnings

This is determined by the variable psc-ide-flycheck-ignored-error-codes. It can be configured with customize-option or similar methods.

Insert suggestion from error C-c M-s

When the cursor is placed over an error that includes suggestion information, use C-c M-s to apply the suggestion.

Keybindings

KeyFunction
C-c C-spsc-ide-server-start
C-c C-qpsc-ide-server-quit
C-c C-lpsc-ide-load-all
C-c C-apsc-ide-add-clause
C-c C-cpsc-ide-case-split
C-c C-ipsc-ide-add-import
C-c C-tpsc-ide-show-type
C-c C-bpsc-ide-rebuild
C-c C-S-lpsc-ide-load-module
C-c M-spsc-ide-flycheck-insert-suggestion

About

Emacs integration for PureScript's psc-ide tool.


Languages

Language:Emacs Lisp 100.0%