Skip to content

Commit 924643e

Browse files
author
ndr
committed
Update README for 0.1.0 release
1 parent 0a9a7b5 commit 924643e

File tree

1 file changed

+52
-26
lines changed

1 file changed

+52
-26
lines changed

README.md

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,64 @@
1-
light-typedclojure
2-
==================
3-
Official Typed Clojure plugin for Light Table
1+
# Typed Clojure for Light Table
2+
<a href="http://typedclojure.org"><img src="https://raw.githubusercontent.com/typedclojure/vim-typedclojure/master/images/part-of-typed-clojure-project.png"></a>
43

5-
## Installation
6-
Typed Clojure is available in the plugin manager.
4+
The official Typed Clojure plugin for Light Table.
75

8-
Alternatively, you can manually clone this repository into your plugin folder.
6+
## Installation
7+
Typed Clojure is available in the Plugin Manager, which is the preferred installation method.
98

109
### Dependencies
11-
Light Table 0.6.4+
12-
Clojure plugin 0.0.10+
13-
Paredit plugin 0.0.4+
10+
- Light Table 0.6.4
11+
- Clojure plugin 0.0.10
12+
- Paredit plugin 0.0.4
1413

15-
Your project should include `[org.clojure/core.typed "0.2.30"]` or above.
14+
### Manual Installation
15+
Download the latest version from [GitHub Releases](https://github.com/typedclojure/light-typedclojure/releases) and extract it to your plugin folder. Alternatively, you can clone this repository; however, this is not advisable, as the code in the master branch is not guaranteed to be stable.
1616

1717
## Usage
18-
The following commands are currently available:
18+
Typed Clojure ships functionality in the form of Light Table commands.
19+
20+
Available commands are prefixed with `Typed Clojure` in the command bar, and can be bound to keyboard shortcuts via your `user.keymap`. For example:
21+
```clojure
22+
{:+ {:editor.clj {"pmeta-shift-n" [:typedclojure.check.ns]
23+
"pmeta-shift-f" [:typedclojure.check.form]
24+
"ctrl-alt-v" [:typedclojure.ann.var]
25+
"ctrl-alt-f" [:typedclojure.ann.form]}}}
26+
```
1927

20-
`Typed Clojure: check namespace`
21-
to typecheck the namespace defined in your current file (as saved on disk).
28+
### Typechecking
29+
Typecheck commands report type mismatches, errors, and missing annotations. They rely on `core.typed` functions, invoking them as you would in the REPL.
2230

23-
`Typed Clojure: check var or form`
24-
to typecheck the variable or form under the cursor, or in the selection.
31+
#### `Typed Clojure: check namespace`
32+
`:typedclojure.check.ns`
33+
`clojure.core.typed/check-ns-info`
2534

26-
`Typed Clojure: annotate var`
27-
to annotate a var with a type through `clojure.core.typed/ann`, fully qualifying it if necessary.
35+
Typecheck the namespace declared in your current file (as saved on disk). Results are logged in the console.
2836

29-
`Typed Clojure: annotate form`
30-
to annotate a form or symbol with a type through `clojure.core.typed/ann-form`.
37+
#### `Typed Clojure: check var or form`
38+
`:typedclojure.check.form`
39+
`clojure.core.typed/check-form-info`
3140

32-
To bind keys to any of these functions, add any of the following commands to your user.keymap:
33-
```clojure
34-
{:+ {:editor.clj {"keybinding" [:typedclojure.check.ns]
35-
"keybinding" [:typedclojure.check.form]
36-
"keybinding" [:typedclojure.ann.var]
37-
"keybinding" [:typedclojure.ann.form]}}}
38-
```
41+
Typecheck the variable or form under the cursor, or in the selection. Results are displayed inline.
42+
43+
### Annotating
44+
Annotation commands produce snippets which call a `core.typed` function, aliasing it if possible.
45+
46+
Annotations default to the `Any` type. They will wrap symbols and forms under your cursor, or active selections, if any.
47+
48+
#### `Typed Clojure: annotate var`
49+
`:typedclojure.ann.var`
50+
`clojure.core.typed/ann`
51+
52+
Annotate a var with a type. The annotation will be inserted at the top level, above the current form.
53+
54+
#### `Typed Clojure: annotate form`
55+
`:typedclojure.ann.form`
56+
`clojure.core.typed/ann-form`
57+
58+
Annotate a form or symbol with a type.
59+
60+
#### `Typed Clojure: add predicate`
61+
`:typedclojure.pred`
62+
`clojure.core.typed/pred`
63+
64+
Add a type predicate to a form or symbol.

0 commit comments

Comments
 (0)