@exercism/codemirror-lang-haskell 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +23 -26
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
# @exercism/codemirror-lang-haskell
|
|
2
2
|
|
|
3
|
-
This is Exercism's fork of
|
|
4
|
-
[@codincod/codemirror-lang-haskell](https://codeberg.org/reeven/codemirror-lang-haskell),
|
|
5
|
-
written by CodinCod. Exercism uses it in the Haskell editor on
|
|
6
|
-
[exercism.org](https://exercism.org). Our changes are on the `main` branch.
|
|
7
|
-
|
|
8
|
-
The fork adds three things:
|
|
9
|
-
|
|
10
|
-
- The parser puts the name of the function being called into a `Callee` node,
|
|
11
|
-
so `map` in `map show xs` is highlighted as a function.
|
|
12
|
-
- Completion offers the names declared in the file that are in scope at the
|
|
13
|
-
cursor. That covers top-level functions, types, constructors, record fields,
|
|
14
|
-
class methods and import aliases, and also parameters, pattern variables, and
|
|
15
|
-
the bindings of `where`, `let`, `do`, `case`, lambdas, guards and list
|
|
16
|
-
comprehensions.
|
|
17
|
-
- Completion offers snippets for functions, guards, `case`, `if`, `let`,
|
|
18
|
-
`where`, `do`, lambdas, list comprehensions, `data`, `newtype`, `type`,
|
|
19
|
-
`class`, `instance`, imports and the module header. It offers nothing inside
|
|
20
|
-
strings and comments.
|
|
21
|
-
|
|
22
|
-
The rest of this README is upstream's.
|
|
23
|
-
|
|
24
3
|
This package implements Haskell language support for the
|
|
25
4
|
[CodeMirror](https://codemirror.net/) code editor, using a
|
|
26
5
|
[Lezer](https://lezer.codemirror.net/) grammar written for this package.
|
|
6
|
+
Exercism uses it in the Haskell editor on [exercism.org](https://exercism.org).
|
|
27
7
|
|
|
28
8
|
CodeMirror has never shipped Haskell. What a CodeMirror 6 editor can fall back
|
|
29
9
|
on is the stream mode from CodeMirror 5, which colours keywords and literals a
|
|
30
10
|
token at a time and knows nothing about the shape of what it is reading. No
|
|
31
11
|
Lezer grammar for Haskell existed anywhere before this one.
|
|
32
12
|
|
|
33
|
-
|
|
34
|
-
platform, where it colours the editor people solve puzzles in.
|
|
35
|
-
|
|
36
|
-
This code is released under an
|
|
37
|
-
[MIT license](https://codeberg.org/reeven/codemirror-lang-haskell/src/branch/master/LICENSE).
|
|
13
|
+
This code is released under an [MIT license](LICENSE).
|
|
38
14
|
|
|
39
15
|
## Install
|
|
40
16
|
|
|
@@ -63,6 +39,19 @@ main = do
|
|
|
63
39
|
})
|
|
64
40
|
```
|
|
65
41
|
|
|
42
|
+
## Completion
|
|
43
|
+
|
|
44
|
+
Completion offers the names declared in the file that are in scope at the
|
|
45
|
+
cursor. That covers top-level functions, types, constructors, record fields,
|
|
46
|
+
class methods and import aliases, and also parameters, pattern variables, and
|
|
47
|
+
the bindings of `where`, `let`, `do`, `case`, lambdas, guards and list
|
|
48
|
+
comprehensions.
|
|
49
|
+
|
|
50
|
+
Completion also offers snippets for functions, guards, `case`, `if`, `let`,
|
|
51
|
+
`where`, `do`, lambdas, list comprehensions, `data`, `newtype`, `type`,
|
|
52
|
+
`class`, `instance`, imports and the module header. It offers nothing inside
|
|
53
|
+
strings and comments.
|
|
54
|
+
|
|
66
55
|
## Coverage
|
|
67
56
|
|
|
68
57
|
Haskell 2010, and the extensions GHC 9 turns on for ordinary code: bang
|
|
@@ -73,6 +62,9 @@ sections, `BlockArguments`, `ImportQualifiedPost`, `MagicHash`, `PackageImports`
|
|
|
73
62
|
the Template Haskell quotations and splices written `[| |]`, `[e| |]`, `[p| |]`,
|
|
74
63
|
`[t| |]`, `[d| |]`, `[|| ||]`, `''Name` and `$( )`.
|
|
75
64
|
|
|
65
|
+
The parser puts the name of the function being called into a `Callee` node,
|
|
66
|
+
so `map` in `map show xs` is highlighted as a function.
|
|
67
|
+
|
|
76
68
|
Measured against 51365 files of Haskell that somebody else wrote, drawn from
|
|
77
69
|
297 projects and from Hackage, 97.49% parse with no error node. The largest
|
|
78
70
|
groups in it:
|
|
@@ -198,3 +190,8 @@ npm install # installs the dependencies and builds dist/
|
|
|
198
190
|
npm run build # regenerates the parser and rebuilds dist/
|
|
199
191
|
npm test # builds, then runs the tests
|
|
200
192
|
```
|
|
193
|
+
|
|
194
|
+
## Contributing
|
|
195
|
+
|
|
196
|
+
Please read about how to [contribute to Exercism](https://exercism.org/docs/building).
|
|
197
|
+
Be sure to read the Exercism [Code of Conduct](https://exercism.org/docs/using/legal/code-of-conduct).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exercism/codemirror-lang-haskell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Haskell language support for the CodeMirror code editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editor",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"homepage": "https://github.com/exercism/codemirror-lang-haskell",
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
|
48
|
-
"url": "https://github.com/exercism/codemirror-lang-haskell"
|
|
48
|
+
"url": "git+https://github.com/exercism/codemirror-lang-haskell.git"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|