Skip to content

Commit 31e1624

Browse files
authored
Update editor and tooling support (documentationjs#347)
1 parent 84c9e70 commit 31e1624

File tree

1 file changed

+93
-33
lines changed

1 file changed

+93
-33
lines changed

ecosystem/Editor-and-tool-support.md

+93-33
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,111 @@
1+
# Editor and tool support
12

2-
## Editors
3+
The PureScript ecosystem contains a number of editor plugins and tools to help you build libraries and applications. The set of available tools is growing continuously, but this documentation contains popular, stable tools that you can use today.
34

4-
#### Atom
5+
At minimum, almost all projects will use:
56

6-
- [purescript-contrib/atom-language-purescript](https://github.com/purescript-contrib/atom-language-purescript) provides syntax highlighting
7-
- [nwolverson/atom-ide-purescript](https://github.com/nwolverson/atom-ide-purescript) provides build support, REPL, and autocomplete etc. via [psc-ide](https://github.com/purescript/purescript/tree/master/psc-ide)
7+
- The [PureScript compiler](https://github.com/purescript/purescript)
8+
- The [Spago](https://github.com/purescript/spago) build tool and package manager
89

9-
#### Emacs
10-
Install these two packages and follow the instructions in the `psc-ide-emacs` README.
11-
- [purescript-mode](https://github.com/purescript-emacs/purescript-mode) Syntax Highlighting and indentation (adapted from haskell-mode)
12-
- [psc-ide-emacs](https://github.com/purescript-emacs/psc-ide-emacs) Emacs plugin exposing the compilers IDE support
10+
These tools can be installed via [NPM](https://www.npmjs.com), among other installation methods.
1311

14-
PSCI support via comint:
12+
## Editor support
1513

16-
- [psci-mode](https://github.com/purescript-emacs/emacs-psci) is a REPL minor mode
14+
The PureScript compiler includes an IDE server, [`purs ide`](https://github.com/purescript/purescript/tree/master/psc-ide), to supply tooling for editors. This server has been used to implement a [PureScript language server](https://github.com/nwolverson/purescript-language-server), which implements the [Language Server Protocol](https://langserver.org) for PureScript. Major editor tooling either uses `purs ide server` directly or via the language server.
1715

18-
Spacemacs users can just use the [`purescript` layer](https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/purescript).
16+
Most editor plugins which rely on PureScript's IDE tooling have at least these features:
1917

20-
#### Sublime Text 2
18+
- Autocomplete (including auto-imports)
19+
- Definitions and error reporting on hover
20+
- Go-to-definition and local search
21+
- REPL support
22+
- Automatic builds
23+
- Error suggestions and quick-fix actions for missing type signatures, imports, and more
24+
- Case split for type-driven development
2125

22-
- [PureScript package](https://sublime.wbond.net/search/PureScript) by joneshf
26+
### General
2327

24-
#### Vim
28+
Some tools are commonly used with several editors, as they are implemented to be editor-agnostic:
2529

26-
- [purescript-vim](https://github.com/raichoo/purescript-vim) syntax highlighting and indentation
27-
- [FrigoEU/psc-ide-vim](https://github.com/FrigoEU/psc-ide-vim/)
28-
- [w0rp/ale](https://github.com/w0rp/ale) supports the [purescript-language-server](https://github.com/nwolverson/purescript-language-server)
30+
- [psa](https://github.com/natefaubion/purescript-psa) is a pretty, flexible error/warning reporting frontend for the compiler featuring colours, original source spans in errors, warning filtering and persistence.
31+
- [pscid](https://github.com/kRITZCREEK/pscid) is a lightweight file-watcher and test runner which provides instant-rebuilds in an editor agnostic way.
2932

30-
#### VS Code
33+
To generate `TAGS` files, use `purs docs --format etags` (or `--format ctags`).
3134

32-
- [nwolverson/vscode-ide-purescript](https://github.com/nwolverson/vscode-ide-purescript)
35+
### Atom
3336

34-
#### General
37+
- [atom-language-purescript](https://github.com/purescript-contrib/atom-language-purescript) provides syntax highlighting for `.purs` files.
38+
- [atom-ide-purescript](https://github.com/nwolverson/atom-ide-purescript) provides editor support via `purs ide`.
3539

36-
- To generate `TAGS` files, use `purs docs --format etags` (or `--format ctags`)
40+
### Emacs
3741

38-
## Build tools and package managers
42+
- [psc-ide-emacs](https://github.com/purescript-emacs/psc-ide-emacs) provides editor support via `purs ide`.
43+
- [purescript-mode](https://github.com/purescript-emacs/purescript-mode) provides syntax highlighting and indentation rules for `.purs` files.
44+
- [psci-mode](https://github.com/purescript-emacs/emacs-psci) provides a minor mode for a PureScript REPL.
3945

40-
Maintained:
41-
- [spago](https://github.com/purescript/spago) - PureScript package manager and build tool powered by [Dhall](https://github.com/dhall-lang/dhall-lang) and [package-sets](https://github.com/purescript/package-sets)
42-
- [psc-package](https://github.com/purescript/psc-package) - A package manager for PureScript based on the concept of package sets
43-
- [purs-loader](https://github.com/ethul/purs-loader/) - PureScript loader for WebPack
44-
- [pscid](https://github.com/kRITZCREEK/pscid) is a lightweight file-watcher/testrunner for PS projects providing instant-rebuilds in an editor agnostic way
45-
- [purescript-psa](https://github.com/natefaubion/purescript-psa) - A pretty, flexible error/warning reporting frontend for `psc` featuring colours, original source spans in errors, warning filtering and persistence.
46-
- [Pulp](https://github.com/purescript-contrib/pulp) - a standalone build system for PureScript ([pulp](https://www.npmjs.com/package/pulp) in `npm`). *Spago is recommended over Pulp.*
47-
- [Gulp task](https://github.com/purescript-contrib/gulp-purescript) (`gulp-purescript` in `npm`). *Spago is recommended over the PureScript Gulp task.*
46+
Spacemacs users can use the [PureScript layer](https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/purescript).
4847

49-
Unmaintained:
50-
- [psvm-js](https://github.com/ThomasCrvsr/psvm-js) - PureScript Version Manager
51-
- [psc-pane](https://github.com/anttih/psc-pane) - Auto reloading compiler which formats a single error to fit the window
48+
### Sublime Text 3
49+
50+
- [purescript-ide-sublime](https://packagecontrol.io/packages/PureScript) provides editor support via `purs ide` and syntax highlighting for `.purs` files.
51+
52+
### Vim
53+
54+
- [psc-ide-vim](https://github.com/FrigoEU/psc-ide-vim) provides editor support via `purs ide`.
55+
- [ale](https://github.com/dense-analysis/ale) provides editor support via the PureScript language server.
56+
- [coc.nvim](https://github.com/neoclide/coc.nvim) provides editor support via the PureScript language server.
57+
- [purescript-vim](https://github.com/raichoo/purescript-vim) provides syntax highlighting and indentation rules for `.purs` files.
58+
59+
### VSCode
60+
61+
- [ide-purescript](https://marketplace.visualstudio.com/items?itemName=nwolverson.ide-purescript) provides editor support via the PureScript language server.
62+
- [language-purescript](https://marketplace.visualstudio.com/items?itemName=nwolverson.language-purescript) provides syntax highlighting for `.purs` files.
63+
64+
## Tooling support
65+
66+
There are many tools available to help you develop libraries and applications in PureScript. These include build tools, package managers, code formatters, dead code elimination tools, GitHub Actions, Nix tools, and more.
67+
68+
### Build tools and package managers
69+
70+
There are several build tools and package managers available for PureScript.
71+
72+
- [spago](https://github.com/purescript/spago) is the standard package manager and build tool for Purescript, powered by [Dhall](https://github.com/dhall-lang/dhall-lang) and [package-sets](https://github.com/purescript/package-sets).
73+
74+
These build tools are maintained, but are no longer recommended for most projects (use Spago instead):
75+
76+
- [psc-package](https://github.com/purescript/psc-package) is a package manager for PureScript based on [package-sets](https://github.com/purescript/package-sets) and a precursor to Spago.
77+
- [pulp](https://github.com/purescript-contrib/pulp) is a standalone build system for PureScript which relies on [Bower](https://github.com/bower/bower) for package management and a precursor to Spago.
78+
79+
### Development tools
80+
81+
- [setup-purescript](https://github.com/purescript-contrib/setup-purescript) is a GitHub Action which sets up a PureScript toolchain with common tools including the compiler and Spago for continuous integration.
82+
- [purty](https://gitlab.com/joneshf/purty) is a formatter / pretty-printer for PureScript source code.
83+
- [zephyr](https://github.com/coot/zephyr) is a dead code elimination tool for PureScript applications which can be used to reduce bundle sizes.
84+
85+
#### For Nix users
86+
87+
There are some tools meant specifically for Nix users, who may not be able to use installation methods like NPM.
88+
89+
- [easy-purescript-nix](https://github.com/justinwoo/easy-purescript-nix) provides many common tools in the PureScript community like the compiler (`purs`), `spago`, `pscid`, `zephyr`, and more for Nix environments.
90+
- [spago2nix](https://github.com/justinwoo/spago2nix) helps you generate Nix expressions for your Spago dependencies.
91+
- [yarn2nix](https://github.com/nix-community/yarn2nix) helps you generate Nix expressions for your JavaScript dependencies.
92+
93+
### Backend-specific tooling
94+
95+
PureScript projects which use alternate backends may use tools from the ecosystem of the target language. This documentation is a non-exhaustive starting point for some tools you may find useful when working with particular backends for PureScript.
96+
97+
#### JavaScript
98+
99+
PureScript projects which target JavaScript may find some tools from the JavaScript ecosystem. PureScript code which imports libraries from JavaScript will at least require a JavaScript package manager (to install dependencies) and a JavaScript bundling tool (to resolve JavaScript imports, among other things). You may also want to use a linter for any JavaScript code you are writing via the FFI.
100+
101+
- Some popular package managers in JavaScript include [npm](https://www.npmjs.com) (recommended), [yarn](https://yarnpkg.com), and [pnpm](https://pnpm.js.org).
102+
- Some popular bundlers in JavaScript include [webpack](https://webpack.js.org) (recommended) with the [purs-loader](https://github.com/ethul/purs-loader) PureScript loader, and [parcel](https://parceljs.org). Other JavaScript bundlers like [rollup](https://github.com/rollup/rollup) rely on ES Modules, which PureScript does not yet support.
103+
- Some popular linters include [eslint](https://eslint.org) and [jsconfig](https://code.visualstudio.com/docs/languages/jsconfig).
104+
105+
### Deprecated and unmaintained tools
106+
107+
These tools were previously mentioned in this documentation, but are no longer maintained or recommended:
108+
109+
- [gulp-purescript](https://github.com/purescript-deprecated/gulp-purescript) was a Gulp task for Purescript`npm`).
110+
- [psvm-js](https://github.com/ThomasCrvsr/psvm-js) was a version manager (like `nvm` for Node) for PureScript compiler versions.
111+
- [psc-pane](https://github.com/anttih/psc-pane) provided auto-reloading builds which formatted a single error to fit the window.

0 commit comments

Comments
 (0)