@exercism/codemirror-lang-r 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,30 +1,11 @@
|
|
|
1
1
|
# @exercism/codemirror-lang-r
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[@codincod/codemirror-lang-r](https://codeberg.org/reeven/codemirror-lang-r),
|
|
5
|
-
which CodinCod wrote. Exercism uses it in the R editor on
|
|
6
|
-
[exercism.org](https://exercism.org). Our changes live on the `main` branch.
|
|
7
|
-
Upstream's own branch is `master`.
|
|
8
|
-
|
|
9
|
-
The fork adds to the completion:
|
|
10
|
-
|
|
11
|
-
- It offers the names assigned in the file with `<-`, `=`, `->` and `<<-`, the
|
|
12
|
-
parameters of the functions around the cursor, and loop variables. A name
|
|
13
|
-
assigned inside a function is offered inside that function and nowhere else. A name
|
|
14
|
-
assigned at the top of the file is offered everywhere.
|
|
15
|
-
- It offers snippets for a function, a lambda, `if`, `if` with `else`, `for`,
|
|
16
|
-
`while`, `repeat`, `switch` and `tryCatch`.
|
|
17
|
-
- It offers more of base R, such as `return`, `utf8ToInt` and `bitwAnd`, and the
|
|
18
|
-
constants `T`, `F`, `pi`, `letters` and `LETTERS`.
|
|
19
|
-
- It offers nothing inside strings and comments, or after `$`, `@` and `::`.
|
|
20
|
-
|
|
21
|
-
The rest of this README is upstream's.
|
|
22
|
-
|
|
23
|
-
[ [**CHANGELOG**](https://codeberg.org/reeven/codemirror-lang-r/src/branch/master/CHANGELOG.md) ]
|
|
3
|
+
[ [**CHANGELOG**](CHANGELOG.md) ]
|
|
24
4
|
|
|
25
5
|
This package implements R language support for the
|
|
26
6
|
[CodeMirror](https://codemirror.net/) code editor, using a
|
|
27
7
|
[Lezer](https://lezer.codemirror.net/) grammar ported from R's own.
|
|
8
|
+
Exercism uses it in the R editor on [exercism.org](https://exercism.org).
|
|
28
9
|
|
|
29
10
|
CodeMirror 6 has never shipped R. What stands in for it is the stream mode
|
|
30
11
|
carried over from CodeMirror 5, which colours a keyword list and builds no
|
|
@@ -33,11 +14,7 @@ what the name under the cursor is. There is one other Lezer grammar for R on
|
|
|
33
14
|
npm, and it reads under a third of real R: no unary minus, no `<` or `>`, no
|
|
34
15
|
`:`, no `|>`, no `%in%`, no braceless body, no `\(x)`, no raw string.
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
platform, where it colours the editor people solve puzzles in.
|
|
38
|
-
|
|
39
|
-
This code is released under an
|
|
40
|
-
[MIT license](https://codeberg.org/reeven/codemirror-lang-r/src/branch/master/LICENSE).
|
|
17
|
+
This code is released under an [MIT license](LICENSE).
|
|
41
18
|
|
|
42
19
|
## Install
|
|
43
20
|
|
|
@@ -61,6 +38,21 @@ const view = new EditorView({
|
|
|
61
38
|
})
|
|
62
39
|
```
|
|
63
40
|
|
|
41
|
+
## Completion
|
|
42
|
+
|
|
43
|
+
`r()` includes completion for:
|
|
44
|
+
|
|
45
|
+
- The names assigned in the file with `<-`, `=`, `->` and `<<-`, the
|
|
46
|
+
parameters of the functions around the cursor, and loop variables. A name
|
|
47
|
+
assigned inside a function is offered inside that function and nowhere else.
|
|
48
|
+
A name assigned at the top of the file is offered everywhere.
|
|
49
|
+
- Snippets for a function, a lambda, `if`, `if` with `else`, `for`, `while`,
|
|
50
|
+
`repeat`, `switch` and `tryCatch`.
|
|
51
|
+
- Base R, including `return`, `utf8ToInt` and `bitwAnd`, and the constants
|
|
52
|
+
`T`, `F`, `pi`, `letters` and `LETTERS`.
|
|
53
|
+
|
|
54
|
+
Nothing is offered inside strings and comments, or after `$`, `@` and `::`.
|
|
55
|
+
|
|
64
56
|
## Coverage
|
|
65
57
|
|
|
66
58
|
R 4.5. Every assignment R has, including `:=`; functions written with
|
|
@@ -112,3 +104,8 @@ npm install # installs the dependencies and builds dist/
|
|
|
112
104
|
npm run build # regenerates the parser and rebuilds dist/
|
|
113
105
|
npm test # builds, then runs the tests
|
|
114
106
|
```
|
|
107
|
+
|
|
108
|
+
## Contributing
|
|
109
|
+
|
|
110
|
+
Please read about how to [contribute to Exercism](https://exercism.org/docs/building).
|
|
111
|
+
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-r",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "R language support for the CodeMirror code editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editor",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"homepage": "https://github.com/exercism/codemirror-lang-r",
|
|
47
47
|
"repository": {
|
|
48
48
|
"type": "git",
|
|
49
|
-
"url": "https://github.com/exercism/codemirror-lang-r"
|
|
49
|
+
"url": "git+https://github.com/exercism/codemirror-lang-r.git"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|