jexl-lang-cm 0.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/.github/workflows/dispatch.yml +16 -0
- package/CHANGELOG.md +198 -0
- package/LICENSE +21 -0
- package/README.md +125 -0
- package/dist/index.cjs +511 -0
- package/dist/index.d.cts +93 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +498 -0
- package/package.json +35 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Trigger CI
|
|
2
|
+
on: push
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
build:
|
|
6
|
+
name: Dispatch to main repo
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- name: Emit repository_dispatch
|
|
10
|
+
uses: mvasigh/dispatch-action@main
|
|
11
|
+
with:
|
|
12
|
+
# You should create a personal access token and store it in your repository
|
|
13
|
+
token: ${{ secrets.DISPATCH_AUTH }}
|
|
14
|
+
repo: dev
|
|
15
|
+
owner: codemirror
|
|
16
|
+
event_type: push
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
## 6.2.4 (2025-05-14)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix a crash in the `esLint` helper when a rule's `meta.docs` isn't defined.
|
|
6
|
+
|
|
7
|
+
Properly dedent lines starting with an opening curly brace below composite statements like `for`/`while`.
|
|
8
|
+
|
|
9
|
+
## 6.2.3 (2025-02-12)
|
|
10
|
+
|
|
11
|
+
### Bug fixes
|
|
12
|
+
|
|
13
|
+
Disable JavaScript completions in JSX context.
|
|
14
|
+
|
|
15
|
+
## 6.2.2 (2024-02-20)
|
|
16
|
+
|
|
17
|
+
### Bug fixes
|
|
18
|
+
|
|
19
|
+
Fix a bug that would cause self-closing JSX tags to have another closing tag inserted when typing the final '>'.
|
|
20
|
+
|
|
21
|
+
## 6.2.1 (2023-08-28)
|
|
22
|
+
|
|
23
|
+
### Bug fixes
|
|
24
|
+
|
|
25
|
+
`autoCloseTags` now generates two separate transactions, so that the completion can be undone separately.
|
|
26
|
+
|
|
27
|
+
## 6.2.0 (2023-08-26)
|
|
28
|
+
|
|
29
|
+
### New features
|
|
30
|
+
|
|
31
|
+
Export a `typescriptSnippets` array and include TypeScript keyword completions in the default support extension when in TypeScript mode.
|
|
32
|
+
|
|
33
|
+
## 6.1.9 (2023-06-02)
|
|
34
|
+
|
|
35
|
+
### Bug fixes
|
|
36
|
+
|
|
37
|
+
Make sure `scopeCompletionSource` doesn't try to complete property names that aren't simple identifier (such as numeric indices).
|
|
38
|
+
|
|
39
|
+
## 6.1.8 (2023-05-13)
|
|
40
|
+
|
|
41
|
+
### Bug fixes
|
|
42
|
+
|
|
43
|
+
Stop completing keywords after `.` tokens.
|
|
44
|
+
|
|
45
|
+
## 6.1.7 (2023-04-19)
|
|
46
|
+
|
|
47
|
+
### Bug fixes
|
|
48
|
+
|
|
49
|
+
Fix overeager JSX tag closing inside attribute values and in self-closing tags.
|
|
50
|
+
|
|
51
|
+
## 6.1.6 (2023-04-13)
|
|
52
|
+
|
|
53
|
+
### Bug fixes
|
|
54
|
+
|
|
55
|
+
Fix a bug that allowed `autoCloseTags` to close JSX tags in JavaScript context.
|
|
56
|
+
|
|
57
|
+
## 6.1.5 (2023-04-04)
|
|
58
|
+
|
|
59
|
+
### Bug fixes
|
|
60
|
+
|
|
61
|
+
Make TypeScript object type syntax foldable.
|
|
62
|
+
|
|
63
|
+
## 6.1.4 (2023-02-13)
|
|
64
|
+
|
|
65
|
+
### Bug fixes
|
|
66
|
+
|
|
67
|
+
Make sure code in JSX context can be commented correctly.
|
|
68
|
+
|
|
69
|
+
## 6.1.3 (2023-02-02)
|
|
70
|
+
|
|
71
|
+
### Bug fixes
|
|
72
|
+
|
|
73
|
+
Fix auto-closing of JSX fragments.
|
|
74
|
+
|
|
75
|
+
## 6.1.2 (2022-12-07)
|
|
76
|
+
|
|
77
|
+
### Bug fixes
|
|
78
|
+
|
|
79
|
+
Automatic tag closing in JSX now works for namespaced and member-expression tag names.
|
|
80
|
+
|
|
81
|
+
## 6.1.1 (2022-10-24)
|
|
82
|
+
|
|
83
|
+
### Bug fixes
|
|
84
|
+
|
|
85
|
+
Make `completionPath` handle `?.` syntax.
|
|
86
|
+
|
|
87
|
+
## 6.1.0 (2022-09-20)
|
|
88
|
+
|
|
89
|
+
### New features
|
|
90
|
+
|
|
91
|
+
The `completionPath` helper can now be used to find the object path to complete at a given position.
|
|
92
|
+
|
|
93
|
+
`scopeCompletionSource` provides a completion source based on a scope object.
|
|
94
|
+
|
|
95
|
+
## 6.0.2 (2022-07-21)
|
|
96
|
+
|
|
97
|
+
### Bug fixes
|
|
98
|
+
|
|
99
|
+
Fix the `source` field in ESLint diagnostics to properly hold `"eslint"`.
|
|
100
|
+
|
|
101
|
+
Fix (non-)auto indentation in template strings and comments.
|
|
102
|
+
|
|
103
|
+
## 6.0.1 (2022-06-29)
|
|
104
|
+
|
|
105
|
+
### Bug fixes
|
|
106
|
+
|
|
107
|
+
Avoid completing variables/keywords in property or definition positions.
|
|
108
|
+
|
|
109
|
+
Fix a bug that broke local variable completion if JavaScript was parsed an overlay in an outer language.
|
|
110
|
+
|
|
111
|
+
## 6.0.0 (2022-06-08)
|
|
112
|
+
|
|
113
|
+
### Breaking changes
|
|
114
|
+
|
|
115
|
+
Update dependencies to 6.0.0
|
|
116
|
+
|
|
117
|
+
## 0.20.1 (2022-06-01)
|
|
118
|
+
|
|
119
|
+
### New features
|
|
120
|
+
|
|
121
|
+
`localCompletionSource` (included in the support extensions returned from `javascript`) now provides a way to complete locally-defined names.
|
|
122
|
+
|
|
123
|
+
## 0.20.0 (2022-04-20)
|
|
124
|
+
|
|
125
|
+
### New features
|
|
126
|
+
|
|
127
|
+
The new `autoCloseTags` extension (included by default in the `javascript` language extension when `jsx` is configured) finishes JSX closing tags when you type a `>` or `/` character.
|
|
128
|
+
|
|
129
|
+
## 0.19.7 (2022-01-28)
|
|
130
|
+
|
|
131
|
+
## 0.19.6 (2022-01-11)
|
|
132
|
+
|
|
133
|
+
### Bug fixes
|
|
134
|
+
|
|
135
|
+
Remove accidentally released unfinished changes.
|
|
136
|
+
|
|
137
|
+
## 0.19.5 (2022-01-11)
|
|
138
|
+
|
|
139
|
+
### Bug fixes
|
|
140
|
+
|
|
141
|
+
Add the `function` highlight modifier to variables used in tagged template expressions.
|
|
142
|
+
|
|
143
|
+
## 0.19.4 (2022-01-03)
|
|
144
|
+
|
|
145
|
+
### Bug fixes
|
|
146
|
+
|
|
147
|
+
Fix highlighting of TypeScript private/public/protected keywords.
|
|
148
|
+
|
|
149
|
+
## 0.19.3 (2021-11-12)
|
|
150
|
+
|
|
151
|
+
### Bug fixes
|
|
152
|
+
|
|
153
|
+
Add styling for private properties.
|
|
154
|
+
|
|
155
|
+
## 0.19.2 (2021-09-23)
|
|
156
|
+
|
|
157
|
+
### New features
|
|
158
|
+
|
|
159
|
+
Use more specific highlighting tags for JSX attribute names and values.
|
|
160
|
+
|
|
161
|
+
## 0.19.1 (2021-08-11)
|
|
162
|
+
|
|
163
|
+
### Bug fixes
|
|
164
|
+
|
|
165
|
+
Fix incorrect versions for @lezer dependencies.
|
|
166
|
+
|
|
167
|
+
## 0.19.0 (2021-08-11)
|
|
168
|
+
|
|
169
|
+
### Breaking changes
|
|
170
|
+
|
|
171
|
+
Update dependencies to 0.19.0
|
|
172
|
+
|
|
173
|
+
## 0.18.0 (2021-03-03)
|
|
174
|
+
|
|
175
|
+
### Bug fixes
|
|
176
|
+
|
|
177
|
+
Extend `indentOnInput` expression to cover closing JSX tags.
|
|
178
|
+
|
|
179
|
+
## 0.17.2 (2021-02-15)
|
|
180
|
+
|
|
181
|
+
### Bug fixes
|
|
182
|
+
|
|
183
|
+
Improve highlighting tag specificity of defined function and class names. Add indentation information for JSX constructs
|
|
184
|
+
|
|
185
|
+
Support smart indent for JSX syntax.
|
|
186
|
+
|
|
187
|
+
## 0.17.1 (2021-01-06)
|
|
188
|
+
|
|
189
|
+
### New features
|
|
190
|
+
|
|
191
|
+
The package now also exports a CommonJS module.
|
|
192
|
+
|
|
193
|
+
## 0.17.0 (2020-12-29)
|
|
194
|
+
|
|
195
|
+
### Breaking changes
|
|
196
|
+
|
|
197
|
+
First numbered release.
|
|
198
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<!-- NOTE: README.md is generated from src/README.md -->
|
|
2
|
+
|
|
3
|
+
# @codemirror/lang-javascript [](https://www.npmjs.org/package/@codemirror/lang-javascript)
|
|
4
|
+
|
|
5
|
+
[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-javascript/blob/main/CHANGELOG.md) ]
|
|
6
|
+
|
|
7
|
+
This package implements JavaScript language support for the
|
|
8
|
+
[CodeMirror](https://codemirror.net/) code editor.
|
|
9
|
+
|
|
10
|
+
The [project page](https://codemirror.net/) has more information, a
|
|
11
|
+
number of [examples](https://codemirror.net/examples/) and the
|
|
12
|
+
[documentation](https://codemirror.net/docs/).
|
|
13
|
+
|
|
14
|
+
This code is released under an
|
|
15
|
+
[MIT license](https://github.com/codemirror/lang-javascript/tree/main/LICENSE).
|
|
16
|
+
|
|
17
|
+
We aim to be an inclusive, welcoming community. To make that explicit,
|
|
18
|
+
we have a [code of
|
|
19
|
+
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
|
|
20
|
+
to communication around the project.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
import {EditorView, basicSetup} from "codemirror"
|
|
26
|
+
import {javascript} from "@codemirror/lang-javascript"
|
|
27
|
+
|
|
28
|
+
const view = new EditorView({
|
|
29
|
+
parent: document.body,
|
|
30
|
+
doc: `console.log("Hello world")`,
|
|
31
|
+
extensions: [basicSetup, javascript()]
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## API Reference
|
|
36
|
+
|
|
37
|
+
<dl>
|
|
38
|
+
<dt id="user-content-javascript">
|
|
39
|
+
<code><strong><a href="#user-content-javascript">javascript</a></strong>(<a id="user-content-javascript^config" href="#user-content-javascript^config">config</a>⁠?: {jsx⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>, typescript⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>} = {}) → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>
|
|
40
|
+
|
|
41
|
+
<dd><p>JavaScript support. Includes <a href="#user-content-snippets">snippet</a>
|
|
42
|
+
and local variable completion.</p>
|
|
43
|
+
</dd>
|
|
44
|
+
<dt id="user-content-javascriptlanguage">
|
|
45
|
+
<code><strong><a href="#user-content-javascriptlanguage">javascriptLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
|
|
46
|
+
|
|
47
|
+
<dd><p>A language provider based on the <a href="https://github.com/lezer-parser/javascript">Lezer JavaScript
|
|
48
|
+
parser</a>, extended with
|
|
49
|
+
highlighting and indentation information.</p>
|
|
50
|
+
</dd>
|
|
51
|
+
<dt id="user-content-typescriptlanguage">
|
|
52
|
+
<code><strong><a href="#user-content-typescriptlanguage">typescriptLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
|
|
53
|
+
|
|
54
|
+
<dd><p>A language provider for TypeScript.</p>
|
|
55
|
+
</dd>
|
|
56
|
+
<dt id="user-content-jsxlanguage">
|
|
57
|
+
<code><strong><a href="#user-content-jsxlanguage">jsxLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
|
|
58
|
+
|
|
59
|
+
<dd><p>Language provider for JSX.</p>
|
|
60
|
+
</dd>
|
|
61
|
+
<dt id="user-content-tsxlanguage">
|
|
62
|
+
<code><strong><a href="#user-content-tsxlanguage">tsxLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
|
|
63
|
+
|
|
64
|
+
<dd><p>Language provider for JSX + TypeScript.</p>
|
|
65
|
+
</dd>
|
|
66
|
+
<dt id="user-content-autoclosetags">
|
|
67
|
+
<code><strong><a href="#user-content-autoclosetags">autoCloseTags</a></strong>: <a href="https://codemirror.net/docs/ref#state.Extension">Extension</a></code></dt>
|
|
68
|
+
|
|
69
|
+
<dd><p>Extension that will automatically insert JSX close tags when a <code>></code> or
|
|
70
|
+
<code>/</code> is typed.</p>
|
|
71
|
+
</dd>
|
|
72
|
+
<dt id="user-content-snippets">
|
|
73
|
+
<code><strong><a href="#user-content-snippets">snippets</a></strong>: readonly <a href="https://codemirror.net/docs/ref#autocomplete.Completion">Completion</a>[]</code></dt>
|
|
74
|
+
|
|
75
|
+
<dd><p>A collection of JavaScript-related
|
|
76
|
+
<a href="https://codemirror.net/docs/ref/#autocomplete.snippet">snippets</a>.</p>
|
|
77
|
+
</dd>
|
|
78
|
+
<dt id="user-content-typescriptsnippets">
|
|
79
|
+
<code><strong><a href="#user-content-typescriptsnippets">typescriptSnippets</a></strong>: <a href="https://codemirror.net/docs/ref#autocomplete.Completion">Completion</a>[]</code></dt>
|
|
80
|
+
|
|
81
|
+
<dd><p>A collection of snippet completions for TypeScript. Includes the
|
|
82
|
+
JavaScript <a href="#user-content-snippets">snippets</a>.</p>
|
|
83
|
+
</dd>
|
|
84
|
+
<dt id="user-content-localcompletionsource">
|
|
85
|
+
<code><strong><a href="#user-content-localcompletionsource">localCompletionSource</a></strong>(<a id="user-content-localcompletionsource^context" href="#user-content-localcompletionsource^context">context</a>: <a href="https://codemirror.net/docs/ref#autocomplete.CompletionContext">CompletionContext</a>) → <a href="https://codemirror.net/docs/ref#autocomplete.CompletionResult">CompletionResult</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a></code></dt>
|
|
86
|
+
|
|
87
|
+
<dd><p>Completion source that looks up locally defined names in
|
|
88
|
+
JavaScript code.</p>
|
|
89
|
+
</dd>
|
|
90
|
+
<dt id="user-content-completionpath">
|
|
91
|
+
<code><strong><a href="#user-content-completionpath">completionPath</a></strong>(<a id="user-content-completionpath^context" href="#user-content-completionpath^context">context</a>: <a href="https://codemirror.net/docs/ref#autocomplete.CompletionContext">CompletionContext</a>) → {path: readonly <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>[], name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>} | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a></code></dt>
|
|
92
|
+
|
|
93
|
+
<dd><p>Helper function for defining JavaScript completion sources. It
|
|
94
|
+
returns the completable name and object path for a completion
|
|
95
|
+
context, or null if no name/property completion should happen at
|
|
96
|
+
that position. For example, when completing after <code>a.b.c</code> it will
|
|
97
|
+
return <code>{path: ["a", "b"], name: "c"}</code>. When completing after <code>x</code>
|
|
98
|
+
it will return <code>{path: [], name: "x"}</code>. When not in a property or
|
|
99
|
+
name, it will return null if <code>context.explicit</code> is false, and
|
|
100
|
+
<code>{path: [], name: ""}</code> otherwise.</p>
|
|
101
|
+
</dd>
|
|
102
|
+
<dt id="user-content-scopecompletionsource">
|
|
103
|
+
<code><strong><a href="#user-content-scopecompletionsource">scopeCompletionSource</a></strong>(<a id="user-content-scopecompletionsource^scope" href="#user-content-scopecompletionsource^scope">scope</a>: any) → <a href="https://codemirror.net/docs/ref#autocomplete.CompletionSource">CompletionSource</a></code></dt>
|
|
104
|
+
|
|
105
|
+
<dd><p>Defines a <a href="https://codemirror.net/docs/ref/#autocomplete.CompletionSource">completion source</a> that
|
|
106
|
+
completes from the given scope object (for example <code>globalThis</code>).
|
|
107
|
+
Will enter properties of the object when completing properties on
|
|
108
|
+
a directly-named path.</p>
|
|
109
|
+
</dd>
|
|
110
|
+
<dt id="user-content-eslint">
|
|
111
|
+
<code><strong><a href="#user-content-eslint">esLint</a></strong>(<a id="user-content-eslint^eslint" href="#user-content-eslint^eslint">eslint</a>: any, <a id="user-content-eslint^config" href="#user-content-eslint^config">config</a>⁠?: any) → fn(<a id="user-content-eslint^returns^view" href="#user-content-eslint^returns^view">view</a>: <a href="https://codemirror.net/docs/ref#view.EditorView">EditorView</a>) → <a href="https://codemirror.net/docs/ref#lint.Diagnostic">Diagnostic</a>[]</code></dt>
|
|
112
|
+
|
|
113
|
+
<dd><p>Connects an <a href="https://eslint.org/">ESLint</a> linter to CodeMirror's
|
|
114
|
+
<a href="https://codemirror.net/docs/ref/#lint">lint</a> integration. <code>eslint</code> should be an instance of the
|
|
115
|
+
<a href="https://eslint.org/docs/developer-guide/nodejs-api#linter"><code>Linter</code></a>
|
|
116
|
+
class, and <code>config</code> an optional ESLint configuration. The return
|
|
117
|
+
value of this function can be passed to <a href="https://codemirror.net/docs/ref/#lint.linter"><code>linter</code></a>
|
|
118
|
+
to create a JavaScript linting extension.</p>
|
|
119
|
+
<p>Note that ESLint targets node, and is tricky to run in the
|
|
120
|
+
browser. The
|
|
121
|
+
<a href="https://github.com/UziTech/eslint-linter-browserify">eslint-linter-browserify</a>
|
|
122
|
+
package may help with that (see
|
|
123
|
+
<a href="https://github.com/UziTech/eslint-linter-browserify/blob/master/example/script.js">example</a>).</p>
|
|
124
|
+
</dd>
|
|
125
|
+
</dl>
|