@exercism/codemirror-lang-perl 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/README.md +34 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
# CodeMirror 6 Perl language package
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This code is released under an [MIT license](https://github.com/drgrice1/lang-perl/tree/main/LICENSE).
|
|
6
|
-
|
|
7
|
-
## Exercism's branch
|
|
3
|
+
## Exercism's fork
|
|
8
4
|
|
|
9
5
|
This is Exercism's fork of [drgrice1/codemirror-lang-perl](https://github.com/drgrice1/codemirror-lang-perl), by Glenn Rice.
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
Exercism uses it in the Perl editor on [exercism.org](https://exercism.org).
|
|
7
|
+
It is published on npm as `@exercism/codemirror-lang-perl`.
|
|
8
|
+
Our changes are on the `exercism` branch, and the `main` branch follows upstream.
|
|
9
|
+
Below this section, the README is upstream's.
|
|
12
10
|
|
|
13
|
-
The
|
|
11
|
+
The fork adds:
|
|
14
12
|
|
|
15
13
|
- Autocomplete for keywords, builtin functions, snippets, and the variables, subs, packages and constants declared in the file.
|
|
16
14
|
A `my` variable is offered after its declaration, inside the block that declares it.
|
|
17
|
-
After a `$`, the elements of declared arrays and hashes
|
|
15
|
+
After a `$`, it also offers the elements of declared arrays and hashes, so a declared `@items` gives `$items`.
|
|
18
16
|
- Postfix dereference, such as `$list->@*`, `$hash->%*`, `$list->$#*` and the slices `$list->@[0, 1]` and `$hash->@{...}`.
|
|
19
17
|
- The class feature of Perl 5.38: `class`, `field`, `method` and `ADJUST`.
|
|
20
18
|
- `given`, `when` and `default` blocks.
|
|
21
19
|
- Smaller parsing improvements, such as `s"a"b"`, `y///c`, `grep /x/, @list` and `/^$word$/`.
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
As well as `perl()` and `perlLanguage`, the package exports:
|
|
22
|
+
|
|
23
|
+
- `perlCompletion`, which holds the two completion sources below as language data.
|
|
24
|
+
- `localCompletionSource`, which completes the names declared in the file.
|
|
25
|
+
- `keywordCompletionSource`, which completes keywords, builtin functions and snippets.
|
|
26
|
+
- `snippets`, which holds the snippets offered by `keywordCompletionSource`.
|
|
27
|
+
|
|
28
|
+
### Install and use
|
|
29
|
+
|
|
30
|
+
To install it, run:
|
|
24
31
|
|
|
25
32
|
```sh
|
|
26
33
|
npm install @exercism/codemirror-lang-perl
|
|
27
34
|
```
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
Then add `perl()` to the editor's extensions:
|
|
30
37
|
|
|
31
38
|
```js
|
|
32
39
|
import { EditorView, basicSetup } from 'codemirror';
|
|
@@ -39,16 +46,23 @@ new EditorView({
|
|
|
39
46
|
});
|
|
40
47
|
```
|
|
41
48
|
|
|
49
|
+
### Building and testing
|
|
50
|
+
|
|
51
|
+
Run `npm install` to install the dependencies and build the package into `dist/`.
|
|
52
|
+
Run `npm run build` to rebuild it, and `npm test` to run the tests.
|
|
53
|
+
|
|
54
|
+
### Contributing
|
|
55
|
+
|
|
56
|
+
Contributions to this fork follow the Exercism [Code of Conduct](https://exercism.org/docs/using/legal/code-of-conduct).
|
|
57
|
+
Please read about how to [contribute to Exercism](https://exercism.org/docs/building).
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
This package implements Perl language support for the [CodeMirror](https://codemirror.net/6/) code editor.
|
|
62
|
+
|
|
63
|
+
This code is released under an [MIT license](https://github.com/drgrice1/lang-perl/tree/main/LICENSE).
|
|
64
|
+
|
|
42
65
|
## API Reference
|
|
43
66
|
|
|
44
67
|
- perl() → [LanguageSupport](https://codemirror.net/docs/ref#language.LanguageSupport)
|
|
45
68
|
- perlLanguage: [LRLanguage](https://codemirror.net/docs/ref#language.LRLanguage)
|
|
46
|
-
- perlCompletion: the two completion sources below, as language data
|
|
47
|
-
- localCompletionSource: completes names declared in the file
|
|
48
|
-
- keywordCompletionSource: completes keywords, builtin functions and snippets
|
|
49
|
-
- snippets: the snippets offered by keywordCompletionSource
|
|
50
|
-
|
|
51
|
-
## Development
|
|
52
|
-
|
|
53
|
-
Run `npm install` to install the dependencies and build the package into `dist/`.
|
|
54
|
-
Run `npm run build` to rebuild it, and `npm test` to run the tests.
|
package/package.json
CHANGED