@codemirror/lint 0.18.0 → 0.18.4
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 +30 -0
- package/dist/index.cjs +97 -75
- package/dist/index.d.ts +69 -1
- package/dist/index.js +108 -86
- package/package.json +6 -8
- package/dist/index.js.map +0 -1
- package/tsconfig.local.json +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
## 0.18.4 (2021-06-07)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Multiple `linter` extensions can now be added to an editor without disrupting each other.
|
|
6
|
+
|
|
7
|
+
Fix poor layout on lint tooltips due to changes in @codemirror/tooltip.
|
|
8
|
+
|
|
9
|
+
## 0.18.3 (2021-05-10)
|
|
10
|
+
|
|
11
|
+
### Bug fixes
|
|
12
|
+
|
|
13
|
+
Fix a regression where using `setDiagnostics` when linting hadn't been abled yet ignored the first set of diagnostics.
|
|
14
|
+
|
|
15
|
+
## 0.18.2 (2021-04-16)
|
|
16
|
+
|
|
17
|
+
### Bug fixes
|
|
18
|
+
|
|
19
|
+
Newlines in line messages are now shown as line breaks to the user.
|
|
20
|
+
|
|
21
|
+
### New features
|
|
22
|
+
|
|
23
|
+
You can now pass a delay option to `linter` to configure how long it waits before calling the linter.
|
|
24
|
+
|
|
25
|
+
## 0.18.1 (2021-03-15)
|
|
26
|
+
|
|
27
|
+
### Bug fixes
|
|
28
|
+
|
|
29
|
+
Adjust to current @codemirror/panel and @codemirror/tooltip interfaces.
|
|
30
|
+
|
|
1
31
|
## 0.18.0 (2021-03-03)
|
|
2
32
|
|
|
3
33
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,20 @@ class LintState {
|
|
|
25
25
|
this.panel = panel;
|
|
26
26
|
this.selected = selected;
|
|
27
27
|
}
|
|
28
|
+
static init(diagnostics, panel) {
|
|
29
|
+
let ranges = view.Decoration.set(diagnostics.map((d) => {
|
|
30
|
+
return d.from < d.to
|
|
31
|
+
? view.Decoration.mark({
|
|
32
|
+
attributes: { class: "cm-lintRange cm-lintRange-" + d.severity },
|
|
33
|
+
diagnostic: d
|
|
34
|
+
}).range(d.from, d.to)
|
|
35
|
+
: view.Decoration.widget({
|
|
36
|
+
widget: new DiagnosticWidget(d),
|
|
37
|
+
diagnostic: d
|
|
38
|
+
}).range(d.from);
|
|
39
|
+
}), true);
|
|
40
|
+
return new LintState(ranges, panel, findDiagnostic(ranges));
|
|
41
|
+
}
|
|
28
42
|
}
|
|
29
43
|
function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
|
|
30
44
|
let found = null;
|
|
@@ -36,25 +50,26 @@ function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
|
|
|
36
50
|
});
|
|
37
51
|
return found;
|
|
38
52
|
}
|
|
39
|
-
function maybeEnableLint(state$1, effects) {
|
|
53
|
+
function maybeEnableLint(state$1, effects, diagnostics) {
|
|
40
54
|
return state$1.field(lintState, false) ? effects : effects.concat(state.StateEffect.appendConfig.of([
|
|
41
|
-
lintState,
|
|
55
|
+
diagnostics ? lintState.init(() => LintState.init(diagnostics, null)) : lintState,
|
|
42
56
|
view.EditorView.decorations.compute([lintState], state => {
|
|
43
57
|
let { selected, panel } = state.field(lintState);
|
|
44
58
|
return !selected || !panel || selected.from == selected.to ? view.Decoration.none : view.Decoration.set([
|
|
45
59
|
activeMark.range(selected.from, selected.to)
|
|
46
60
|
]);
|
|
47
61
|
}),
|
|
48
|
-
panel.panels(),
|
|
49
62
|
tooltip.hoverTooltip(lintTooltip),
|
|
50
63
|
baseTheme
|
|
51
64
|
]));
|
|
52
65
|
}
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
/**
|
|
67
|
+
Returns a transaction spec which updates the current set of
|
|
68
|
+
diagnostics.
|
|
69
|
+
*/
|
|
55
70
|
function setDiagnostics(state, diagnostics) {
|
|
56
71
|
return {
|
|
57
|
-
effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)])
|
|
72
|
+
effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)], diagnostics)
|
|
58
73
|
};
|
|
59
74
|
}
|
|
60
75
|
const setDiagnosticsEffect = state.StateEffect.define();
|
|
@@ -75,18 +90,7 @@ const lintState = state.StateField.define({
|
|
|
75
90
|
}
|
|
76
91
|
for (let effect of tr.effects) {
|
|
77
92
|
if (effect.is(setDiagnosticsEffect)) {
|
|
78
|
-
|
|
79
|
-
return d.from < d.to
|
|
80
|
-
? view.Decoration.mark({
|
|
81
|
-
attributes: { class: "cm-lintRange cm-lintRange-" + d.severity },
|
|
82
|
-
diagnostic: d
|
|
83
|
-
}).range(d.from, d.to)
|
|
84
|
-
: view.Decoration.widget({
|
|
85
|
-
widget: new DiagnosticWidget(d),
|
|
86
|
-
diagnostic: d
|
|
87
|
-
}).range(d.from);
|
|
88
|
-
}));
|
|
89
|
-
value = new LintState(ranges, value.panel, findDiagnostic(ranges));
|
|
93
|
+
value = LintState.init(effect.value, value.panel);
|
|
90
94
|
}
|
|
91
95
|
else if (effect.is(togglePanel)) {
|
|
92
96
|
value = new LintState(value.diagnostics, effect.value ? LintPanel.open : null, value.selected);
|
|
@@ -97,7 +101,7 @@ const lintState = state.StateField.define({
|
|
|
97
101
|
}
|
|
98
102
|
return value;
|
|
99
103
|
},
|
|
100
|
-
provide: f => [panel.showPanel.
|
|
104
|
+
provide: f => [panel.showPanel.from(f, val => val.panel),
|
|
101
105
|
view.EditorView.decorations.from(f, s => s.diagnostics)]
|
|
102
106
|
});
|
|
103
107
|
const activeMark = view.Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
@@ -118,13 +122,14 @@ function lintTooltip(view, pos, side) {
|
|
|
118
122
|
pos: stackStart,
|
|
119
123
|
end: stackEnd,
|
|
120
124
|
above: view.state.doc.lineAt(stackStart).to < stackEnd,
|
|
121
|
-
class: "cm-tooltip-lint",
|
|
122
125
|
create() {
|
|
123
|
-
return { dom: elt__default['default']("ul", found.map(d => renderDiagnostic(view, d, false))) };
|
|
126
|
+
return { dom: elt__default['default']("ul", { class: "cm-tooltip-lint" }, found.map(d => renderDiagnostic(view, d, false))) };
|
|
124
127
|
}
|
|
125
128
|
};
|
|
126
129
|
}
|
|
127
|
-
|
|
130
|
+
/**
|
|
131
|
+
Command to open and focus the lint panel.
|
|
132
|
+
*/
|
|
128
133
|
const openLintPanel = (view) => {
|
|
129
134
|
let field = view.state.field(lintState, false);
|
|
130
135
|
if (!field || !field.panel)
|
|
@@ -134,7 +139,9 @@ const openLintPanel = (view) => {
|
|
|
134
139
|
panel$1.dom.querySelector(".cm-panel-lint ul").focus();
|
|
135
140
|
return true;
|
|
136
141
|
};
|
|
137
|
-
|
|
142
|
+
/**
|
|
143
|
+
Command to close the lint panel, when open.
|
|
144
|
+
*/
|
|
138
145
|
const closeLintPanel = (view) => {
|
|
139
146
|
let field = view.state.field(lintState, false);
|
|
140
147
|
if (!field || !field.panel)
|
|
@@ -142,7 +149,9 @@ const closeLintPanel = (view) => {
|
|
|
142
149
|
view.dispatch({ effects: togglePanel.of(false) });
|
|
143
150
|
return true;
|
|
144
151
|
};
|
|
145
|
-
|
|
152
|
+
/**
|
|
153
|
+
Move the selection to the next diagnostic.
|
|
154
|
+
*/
|
|
146
155
|
const nextDiagnostic = (view) => {
|
|
147
156
|
let field = view.state.field(lintState, false);
|
|
148
157
|
if (!field)
|
|
@@ -156,53 +165,71 @@ const nextDiagnostic = (view) => {
|
|
|
156
165
|
view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });
|
|
157
166
|
return true;
|
|
158
167
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
168
|
+
/**
|
|
169
|
+
A set of default key bindings for the lint functionality.
|
|
170
|
+
|
|
171
|
+
- Ctrl-Shift-m (Cmd-Shift-m on macOS): [`openLintPanel`](https://codemirror.net/6/docs/ref/#lint.openLintPanel)
|
|
172
|
+
- F8: [`nextDiagnostic`](https://codemirror.net/6/docs/ref/#lint.nextDiagnostic)
|
|
173
|
+
*/
|
|
163
174
|
const lintKeymap = [
|
|
164
175
|
{ key: "Mod-Shift-m", run: openLintPanel },
|
|
165
176
|
{ key: "F8", run: nextDiagnostic }
|
|
166
177
|
];
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
const lintPlugin = view.ViewPlugin.fromClass(class {
|
|
179
|
+
constructor(view) {
|
|
180
|
+
this.view = view;
|
|
181
|
+
this.timeout = -1;
|
|
182
|
+
this.set = true;
|
|
183
|
+
let { delay } = view.state.facet(lintSource);
|
|
184
|
+
this.lintTime = Date.now() + delay;
|
|
185
|
+
this.run = this.run.bind(this);
|
|
186
|
+
this.timeout = setTimeout(this.run, delay);
|
|
187
|
+
}
|
|
188
|
+
run() {
|
|
189
|
+
let now = Date.now();
|
|
190
|
+
if (now < this.lintTime - 10) {
|
|
191
|
+
setTimeout(this.run, this.lintTime - now);
|
|
179
192
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
this.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (this.view.state.doc == state.doc &&
|
|
191
|
-
(annotations.length || ((_b = (_a = this.view.state.field(lintState, false)) === null || _a === void 0 ? void 0 : _a.diagnostics) === null || _b === void 0 ? void 0 : _b.size)))
|
|
192
|
-
this.view.dispatch(setDiagnostics(this.view.state, annotations));
|
|
193
|
-
}, error => { view.logException(this.view.state, error); });
|
|
194
|
-
}
|
|
193
|
+
else {
|
|
194
|
+
this.set = false;
|
|
195
|
+
let { state } = this.view, { sources } = state.facet(lintSource);
|
|
196
|
+
Promise.all(sources.map(source => Promise.resolve(source(this.view)))).then(annotations => {
|
|
197
|
+
var _a, _b;
|
|
198
|
+
let all = annotations.reduce((a, b) => a.concat(b));
|
|
199
|
+
if (this.view.state.doc == state.doc &&
|
|
200
|
+
(all.length || ((_b = (_a = this.view.state.field(lintState, false)) === null || _a === void 0 ? void 0 : _a.diagnostics) === null || _b === void 0 ? void 0 : _b.size)))
|
|
201
|
+
this.view.dispatch(setDiagnostics(this.view.state, all));
|
|
202
|
+
}, error => { view.logException(this.view.state, error); });
|
|
195
203
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
}
|
|
205
|
+
update(update) {
|
|
206
|
+
if (update.docChanged) {
|
|
207
|
+
let { delay } = update.state.facet(lintSource);
|
|
208
|
+
this.lintTime = Date.now() + delay;
|
|
209
|
+
if (!this.set) {
|
|
210
|
+
this.set = true;
|
|
211
|
+
this.timeout = setTimeout(this.run, delay);
|
|
203
212
|
}
|
|
204
213
|
}
|
|
205
|
-
}
|
|
214
|
+
}
|
|
215
|
+
destroy() {
|
|
216
|
+
clearTimeout(this.timeout);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
const lintSource = state.Facet.define({
|
|
220
|
+
combine(input) {
|
|
221
|
+
return { sources: input.map(i => i.source), delay: input.length ? Math.max(...input.map(i => i.delay)) : 750 };
|
|
222
|
+
},
|
|
223
|
+
enables: lintPlugin
|
|
224
|
+
});
|
|
225
|
+
/**
|
|
226
|
+
Given a diagnostic source, this function returns an extension that
|
|
227
|
+
enables linting with that source. It will be called whenever the
|
|
228
|
+
editor is idle (after its content changed).
|
|
229
|
+
*/
|
|
230
|
+
function linter(source, config = {}) {
|
|
231
|
+
var _a;
|
|
232
|
+
return lintSource.of({ source, delay: (_a = config.delay) !== null && _a !== void 0 ? _a : 750 });
|
|
206
233
|
}
|
|
207
234
|
function assignKeys(actions) {
|
|
208
235
|
let assigned = [];
|
|
@@ -311,7 +338,7 @@ class LintPanel {
|
|
|
311
338
|
onkeydown,
|
|
312
339
|
onclick
|
|
313
340
|
});
|
|
314
|
-
this.dom = elt__default['default']("div", this.list, elt__default['default']("button", {
|
|
341
|
+
this.dom = elt__default['default']("div", { class: "cm-panel-lint" }, this.list, elt__default['default']("button", {
|
|
315
342
|
name: "close",
|
|
316
343
|
"aria-label": this.view.state.phrase("close"),
|
|
317
344
|
onclick: () => closeLintPanel(this.view)
|
|
@@ -410,11 +437,6 @@ class LintPanel {
|
|
|
410
437
|
}
|
|
411
438
|
while (domPos)
|
|
412
439
|
rm();
|
|
413
|
-
if (!this.list.firstChild)
|
|
414
|
-
this.list.appendChild(renderDiagnostic(this.view, {
|
|
415
|
-
severity: "info",
|
|
416
|
-
message: this.view.state.phrase("No diagnostics")
|
|
417
|
-
}, true));
|
|
418
440
|
}
|
|
419
441
|
moveSelection(selectedIndex) {
|
|
420
442
|
if (this.items.length == 0)
|
|
@@ -429,7 +451,6 @@ class LintPanel {
|
|
|
429
451
|
effects: movePanelSelection.of(selection)
|
|
430
452
|
});
|
|
431
453
|
}
|
|
432
|
-
get class() { return "cm-panel-lint"; }
|
|
433
454
|
static open(view) { return new LintPanel(view); }
|
|
434
455
|
}
|
|
435
456
|
function underline(color) {
|
|
@@ -444,7 +465,8 @@ const baseTheme = view.EditorView.baseTheme({
|
|
|
444
465
|
".cm-diagnostic": {
|
|
445
466
|
padding: "3px 6px 3px 8px",
|
|
446
467
|
marginLeft: "-1px",
|
|
447
|
-
display: "block"
|
|
468
|
+
display: "block",
|
|
469
|
+
whiteSpace: "pre-wrap"
|
|
448
470
|
},
|
|
449
471
|
".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
|
|
450
472
|
".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
|
|
@@ -470,6 +492,10 @@ const baseTheme = view.EditorView.baseTheme({
|
|
|
470
492
|
".cm-lintRange-warning": { backgroundImage: underline("orange") },
|
|
471
493
|
".cm-lintRange-info": { backgroundImage: underline("#999") },
|
|
472
494
|
".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
|
|
495
|
+
".cm-tooltip-lint": {
|
|
496
|
+
padding: 0,
|
|
497
|
+
margin: 0
|
|
498
|
+
},
|
|
473
499
|
".cm-lintPoint": {
|
|
474
500
|
position: "relative",
|
|
475
501
|
"&:after": {
|
|
@@ -517,10 +543,6 @@ const baseTheme = view.EditorView.baseTheme({
|
|
|
517
543
|
padding: 0,
|
|
518
544
|
margin: 0
|
|
519
545
|
}
|
|
520
|
-
},
|
|
521
|
-
".cm-tooltip.cm-tooltip-lint": {
|
|
522
|
-
padding: 0,
|
|
523
|
-
margin: 0
|
|
524
546
|
}
|
|
525
547
|
});
|
|
526
548
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,91 @@
|
|
|
1
1
|
import { EditorView, Command, KeyBinding } from '@codemirror/view';
|
|
2
2
|
import { EditorState, TransactionSpec, Extension } from '@codemirror/state';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
Describes a problem or hint for a piece of code.
|
|
6
|
+
*/
|
|
4
7
|
interface Diagnostic {
|
|
8
|
+
/**
|
|
9
|
+
The start position of the relevant text.
|
|
10
|
+
*/
|
|
5
11
|
from: number;
|
|
12
|
+
/**
|
|
13
|
+
The end position. May be equal to `from`, though actually
|
|
14
|
+
covering text is preferable.
|
|
15
|
+
*/
|
|
6
16
|
to: number;
|
|
17
|
+
/**
|
|
18
|
+
The severity of the problem. This will influence how it is
|
|
19
|
+
displayed.
|
|
20
|
+
*/
|
|
7
21
|
severity: "info" | "warning" | "error";
|
|
22
|
+
/**
|
|
23
|
+
An optional source string indicating where the diagnostic is
|
|
24
|
+
coming from. You can put the name of your linter here, if
|
|
25
|
+
applicable.
|
|
26
|
+
*/
|
|
8
27
|
source?: string;
|
|
28
|
+
/**
|
|
29
|
+
The message associated with this diagnostic.
|
|
30
|
+
*/
|
|
9
31
|
message: string;
|
|
32
|
+
/**
|
|
33
|
+
An optional array of actions that can be taken on this
|
|
34
|
+
diagnostic.
|
|
35
|
+
*/
|
|
10
36
|
actions?: readonly Action[];
|
|
11
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
An action associated with a diagnostic.
|
|
40
|
+
*/
|
|
12
41
|
interface Action {
|
|
42
|
+
/**
|
|
43
|
+
The label to show to the user. Should be relatively short.
|
|
44
|
+
*/
|
|
13
45
|
name: string;
|
|
46
|
+
/**
|
|
47
|
+
The function to call when the user activates this action. Is
|
|
48
|
+
given the diagnostic's _current_ position, which may have
|
|
49
|
+
changed since the creation of the diagnostic due to editing.
|
|
50
|
+
*/
|
|
14
51
|
apply: (view: EditorView, from: number, to: number) => void;
|
|
15
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
Returns a transaction spec which updates the current set of
|
|
55
|
+
diagnostics.
|
|
56
|
+
*/
|
|
16
57
|
declare function setDiagnostics(state: EditorState, diagnostics: readonly Diagnostic[]): TransactionSpec;
|
|
58
|
+
/**
|
|
59
|
+
Command to open and focus the lint panel.
|
|
60
|
+
*/
|
|
17
61
|
declare const openLintPanel: Command;
|
|
62
|
+
/**
|
|
63
|
+
Command to close the lint panel, when open.
|
|
64
|
+
*/
|
|
18
65
|
declare const closeLintPanel: Command;
|
|
66
|
+
/**
|
|
67
|
+
Move the selection to the next diagnostic.
|
|
68
|
+
*/
|
|
19
69
|
declare const nextDiagnostic: Command;
|
|
70
|
+
/**
|
|
71
|
+
A set of default key bindings for the lint functionality.
|
|
72
|
+
|
|
73
|
+
- Ctrl-Shift-m (Cmd-Shift-m on macOS): [`openLintPanel`](https://codemirror.net/6/docs/ref/#lint.openLintPanel)
|
|
74
|
+
- F8: [`nextDiagnostic`](https://codemirror.net/6/docs/ref/#lint.nextDiagnostic)
|
|
75
|
+
*/
|
|
20
76
|
declare const lintKeymap: readonly KeyBinding[];
|
|
21
|
-
declare
|
|
77
|
+
declare type LintSource = (view: EditorView) => readonly Diagnostic[] | Promise<readonly Diagnostic[]>;
|
|
78
|
+
/**
|
|
79
|
+
Given a diagnostic source, this function returns an extension that
|
|
80
|
+
enables linting with that source. It will be called whenever the
|
|
81
|
+
editor is idle (after its content changed).
|
|
82
|
+
*/
|
|
83
|
+
declare function linter(source: LintSource, config?: {
|
|
84
|
+
/**
|
|
85
|
+
Time to wait (in milliseconds) after a change before running
|
|
86
|
+
the linter. Defaults to 750ms.
|
|
87
|
+
*/
|
|
88
|
+
delay?: number;
|
|
89
|
+
}): Extension;
|
|
22
90
|
|
|
23
91
|
export { Action, Diagnostic, closeLintPanel, lintKeymap, linter, nextDiagnostic, openLintPanel, setDiagnostics };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditorView, Decoration, ViewPlugin, logException, WidgetType } from '@codemirror/view';
|
|
2
|
-
import { StateEffect, StateField } from '@codemirror/state';
|
|
2
|
+
import { StateEffect, StateField, Facet } from '@codemirror/state';
|
|
3
3
|
import { hoverTooltip } from '@codemirror/tooltip';
|
|
4
|
-
import {
|
|
4
|
+
import { showPanel, getPanel } from '@codemirror/panel';
|
|
5
5
|
import elt from 'crelt';
|
|
6
6
|
|
|
7
7
|
class SelectedDiagnostic {
|
|
@@ -17,6 +17,20 @@ class LintState {
|
|
|
17
17
|
this.panel = panel;
|
|
18
18
|
this.selected = selected;
|
|
19
19
|
}
|
|
20
|
+
static init(diagnostics, panel) {
|
|
21
|
+
let ranges = Decoration.set(diagnostics.map((d) => {
|
|
22
|
+
return d.from < d.to
|
|
23
|
+
? Decoration.mark({
|
|
24
|
+
attributes: { class: "cm-lintRange cm-lintRange-" + d.severity },
|
|
25
|
+
diagnostic: d
|
|
26
|
+
}).range(d.from, d.to)
|
|
27
|
+
: Decoration.widget({
|
|
28
|
+
widget: new DiagnosticWidget(d),
|
|
29
|
+
diagnostic: d
|
|
30
|
+
}).range(d.from);
|
|
31
|
+
}), true);
|
|
32
|
+
return new LintState(ranges, panel, findDiagnostic(ranges));
|
|
33
|
+
}
|
|
20
34
|
}
|
|
21
35
|
function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
|
|
22
36
|
let found = null;
|
|
@@ -28,31 +42,32 @@ function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
|
|
|
28
42
|
});
|
|
29
43
|
return found;
|
|
30
44
|
}
|
|
31
|
-
function maybeEnableLint(state, effects) {
|
|
45
|
+
function maybeEnableLint(state, effects, diagnostics) {
|
|
32
46
|
return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of([
|
|
33
|
-
lintState,
|
|
47
|
+
diagnostics ? lintState.init(() => LintState.init(diagnostics, null)) : lintState,
|
|
34
48
|
EditorView.decorations.compute([lintState], state => {
|
|
35
49
|
let { selected, panel } = state.field(lintState);
|
|
36
50
|
return !selected || !panel || selected.from == selected.to ? Decoration.none : Decoration.set([
|
|
37
51
|
activeMark.range(selected.from, selected.to)
|
|
38
52
|
]);
|
|
39
53
|
}),
|
|
40
|
-
panels(),
|
|
41
54
|
hoverTooltip(lintTooltip),
|
|
42
55
|
baseTheme
|
|
43
56
|
]));
|
|
44
57
|
}
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
/**
|
|
59
|
+
Returns a transaction spec which updates the current set of
|
|
60
|
+
diagnostics.
|
|
61
|
+
*/
|
|
47
62
|
function setDiagnostics(state, diagnostics) {
|
|
48
63
|
return {
|
|
49
|
-
effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)])
|
|
64
|
+
effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)], diagnostics)
|
|
50
65
|
};
|
|
51
66
|
}
|
|
52
|
-
const setDiagnosticsEffect = StateEffect.define();
|
|
53
|
-
const togglePanel = StateEffect.define();
|
|
54
|
-
const movePanelSelection = StateEffect.define();
|
|
55
|
-
const lintState = StateField.define({
|
|
67
|
+
const setDiagnosticsEffect = /*@__PURE__*/StateEffect.define();
|
|
68
|
+
const togglePanel = /*@__PURE__*/StateEffect.define();
|
|
69
|
+
const movePanelSelection = /*@__PURE__*/StateEffect.define();
|
|
70
|
+
const lintState = /*@__PURE__*/StateField.define({
|
|
56
71
|
create() {
|
|
57
72
|
return new LintState(Decoration.none, null, null);
|
|
58
73
|
},
|
|
@@ -67,18 +82,7 @@ const lintState = StateField.define({
|
|
|
67
82
|
}
|
|
68
83
|
for (let effect of tr.effects) {
|
|
69
84
|
if (effect.is(setDiagnosticsEffect)) {
|
|
70
|
-
|
|
71
|
-
return d.from < d.to
|
|
72
|
-
? Decoration.mark({
|
|
73
|
-
attributes: { class: "cm-lintRange cm-lintRange-" + d.severity },
|
|
74
|
-
diagnostic: d
|
|
75
|
-
}).range(d.from, d.to)
|
|
76
|
-
: Decoration.widget({
|
|
77
|
-
widget: new DiagnosticWidget(d),
|
|
78
|
-
diagnostic: d
|
|
79
|
-
}).range(d.from);
|
|
80
|
-
}));
|
|
81
|
-
value = new LintState(ranges, value.panel, findDiagnostic(ranges));
|
|
85
|
+
value = LintState.init(effect.value, value.panel);
|
|
82
86
|
}
|
|
83
87
|
else if (effect.is(togglePanel)) {
|
|
84
88
|
value = new LintState(value.diagnostics, effect.value ? LintPanel.open : null, value.selected);
|
|
@@ -89,10 +93,10 @@ const lintState = StateField.define({
|
|
|
89
93
|
}
|
|
90
94
|
return value;
|
|
91
95
|
},
|
|
92
|
-
provide: f => [showPanel.
|
|
96
|
+
provide: f => [showPanel.from(f, val => val.panel),
|
|
93
97
|
EditorView.decorations.from(f, s => s.diagnostics)]
|
|
94
98
|
});
|
|
95
|
-
const activeMark = Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
99
|
+
const activeMark = /*@__PURE__*/Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
96
100
|
function lintTooltip(view, pos, side) {
|
|
97
101
|
let { diagnostics } = view.state.field(lintState);
|
|
98
102
|
let found = [], stackStart = 2e8, stackEnd = 0;
|
|
@@ -110,13 +114,14 @@ function lintTooltip(view, pos, side) {
|
|
|
110
114
|
pos: stackStart,
|
|
111
115
|
end: stackEnd,
|
|
112
116
|
above: view.state.doc.lineAt(stackStart).to < stackEnd,
|
|
113
|
-
class: "cm-tooltip-lint",
|
|
114
117
|
create() {
|
|
115
|
-
return { dom: elt("ul", found.map(d => renderDiagnostic(view, d, false))) };
|
|
118
|
+
return { dom: elt("ul", { class: "cm-tooltip-lint" }, found.map(d => renderDiagnostic(view, d, false))) };
|
|
116
119
|
}
|
|
117
120
|
};
|
|
118
121
|
}
|
|
119
|
-
|
|
122
|
+
/**
|
|
123
|
+
Command to open and focus the lint panel.
|
|
124
|
+
*/
|
|
120
125
|
const openLintPanel = (view) => {
|
|
121
126
|
let field = view.state.field(lintState, false);
|
|
122
127
|
if (!field || !field.panel)
|
|
@@ -126,7 +131,9 @@ const openLintPanel = (view) => {
|
|
|
126
131
|
panel.dom.querySelector(".cm-panel-lint ul").focus();
|
|
127
132
|
return true;
|
|
128
133
|
};
|
|
129
|
-
|
|
134
|
+
/**
|
|
135
|
+
Command to close the lint panel, when open.
|
|
136
|
+
*/
|
|
130
137
|
const closeLintPanel = (view) => {
|
|
131
138
|
let field = view.state.field(lintState, false);
|
|
132
139
|
if (!field || !field.panel)
|
|
@@ -134,7 +141,9 @@ const closeLintPanel = (view) => {
|
|
|
134
141
|
view.dispatch({ effects: togglePanel.of(false) });
|
|
135
142
|
return true;
|
|
136
143
|
};
|
|
137
|
-
|
|
144
|
+
/**
|
|
145
|
+
Move the selection to the next diagnostic.
|
|
146
|
+
*/
|
|
138
147
|
const nextDiagnostic = (view) => {
|
|
139
148
|
let field = view.state.field(lintState, false);
|
|
140
149
|
if (!field)
|
|
@@ -148,53 +157,71 @@ const nextDiagnostic = (view) => {
|
|
|
148
157
|
view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });
|
|
149
158
|
return true;
|
|
150
159
|
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
160
|
+
/**
|
|
161
|
+
A set of default key bindings for the lint functionality.
|
|
162
|
+
|
|
163
|
+
- Ctrl-Shift-m (Cmd-Shift-m on macOS): [`openLintPanel`](https://codemirror.net/6/docs/ref/#lint.openLintPanel)
|
|
164
|
+
- F8: [`nextDiagnostic`](https://codemirror.net/6/docs/ref/#lint.nextDiagnostic)
|
|
165
|
+
*/
|
|
155
166
|
const lintKeymap = [
|
|
156
167
|
{ key: "Mod-Shift-m", run: openLintPanel },
|
|
157
168
|
{ key: "F8", run: nextDiagnostic }
|
|
158
169
|
];
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
const lintPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
|
|
171
|
+
constructor(view) {
|
|
172
|
+
this.view = view;
|
|
173
|
+
this.timeout = -1;
|
|
174
|
+
this.set = true;
|
|
175
|
+
let { delay } = view.state.facet(lintSource);
|
|
176
|
+
this.lintTime = Date.now() + delay;
|
|
177
|
+
this.run = this.run.bind(this);
|
|
178
|
+
this.timeout = setTimeout(this.run, delay);
|
|
179
|
+
}
|
|
180
|
+
run() {
|
|
181
|
+
let now = Date.now();
|
|
182
|
+
if (now < this.lintTime - 10) {
|
|
183
|
+
setTimeout(this.run, this.lintTime - now);
|
|
171
184
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
this.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (this.view.state.doc == state.doc &&
|
|
183
|
-
(annotations.length || ((_b = (_a = this.view.state.field(lintState, false)) === null || _a === void 0 ? void 0 : _a.diagnostics) === null || _b === void 0 ? void 0 : _b.size)))
|
|
184
|
-
this.view.dispatch(setDiagnostics(this.view.state, annotations));
|
|
185
|
-
}, error => { logException(this.view.state, error); });
|
|
186
|
-
}
|
|
185
|
+
else {
|
|
186
|
+
this.set = false;
|
|
187
|
+
let { state } = this.view, { sources } = state.facet(lintSource);
|
|
188
|
+
Promise.all(sources.map(source => Promise.resolve(source(this.view)))).then(annotations => {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
let all = annotations.reduce((a, b) => a.concat(b));
|
|
191
|
+
if (this.view.state.doc == state.doc &&
|
|
192
|
+
(all.length || ((_b = (_a = this.view.state.field(lintState, false)) === null || _a === void 0 ? void 0 : _a.diagnostics) === null || _b === void 0 ? void 0 : _b.size)))
|
|
193
|
+
this.view.dispatch(setDiagnostics(this.view.state, all));
|
|
194
|
+
}, error => { logException(this.view.state, error); });
|
|
187
195
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
}
|
|
197
|
+
update(update) {
|
|
198
|
+
if (update.docChanged) {
|
|
199
|
+
let { delay } = update.state.facet(lintSource);
|
|
200
|
+
this.lintTime = Date.now() + delay;
|
|
201
|
+
if (!this.set) {
|
|
202
|
+
this.set = true;
|
|
203
|
+
this.timeout = setTimeout(this.run, delay);
|
|
195
204
|
}
|
|
196
205
|
}
|
|
197
|
-
}
|
|
206
|
+
}
|
|
207
|
+
destroy() {
|
|
208
|
+
clearTimeout(this.timeout);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
const lintSource = /*@__PURE__*/Facet.define({
|
|
212
|
+
combine(input) {
|
|
213
|
+
return { sources: input.map(i => i.source), delay: input.length ? Math.max(...input.map(i => i.delay)) : 750 };
|
|
214
|
+
},
|
|
215
|
+
enables: lintPlugin
|
|
216
|
+
});
|
|
217
|
+
/**
|
|
218
|
+
Given a diagnostic source, this function returns an extension that
|
|
219
|
+
enables linting with that source. It will be called whenever the
|
|
220
|
+
editor is idle (after its content changed).
|
|
221
|
+
*/
|
|
222
|
+
function linter(source, config = {}) {
|
|
223
|
+
var _a;
|
|
224
|
+
return lintSource.of({ source, delay: (_a = config.delay) !== null && _a !== void 0 ? _a : 750 });
|
|
198
225
|
}
|
|
199
226
|
function assignKeys(actions) {
|
|
200
227
|
let assigned = [];
|
|
@@ -303,7 +330,7 @@ class LintPanel {
|
|
|
303
330
|
onkeydown,
|
|
304
331
|
onclick
|
|
305
332
|
});
|
|
306
|
-
this.dom = elt("div", this.list, elt("button", {
|
|
333
|
+
this.dom = elt("div", { class: "cm-panel-lint" }, this.list, elt("button", {
|
|
307
334
|
name: "close",
|
|
308
335
|
"aria-label": this.view.state.phrase("close"),
|
|
309
336
|
onclick: () => closeLintPanel(this.view)
|
|
@@ -402,11 +429,6 @@ class LintPanel {
|
|
|
402
429
|
}
|
|
403
430
|
while (domPos)
|
|
404
431
|
rm();
|
|
405
|
-
if (!this.list.firstChild)
|
|
406
|
-
this.list.appendChild(renderDiagnostic(this.view, {
|
|
407
|
-
severity: "info",
|
|
408
|
-
message: this.view.state.phrase("No diagnostics")
|
|
409
|
-
}, true));
|
|
410
432
|
}
|
|
411
433
|
moveSelection(selectedIndex) {
|
|
412
434
|
if (this.items.length == 0)
|
|
@@ -421,7 +443,6 @@ class LintPanel {
|
|
|
421
443
|
effects: movePanelSelection.of(selection)
|
|
422
444
|
});
|
|
423
445
|
}
|
|
424
|
-
get class() { return "cm-panel-lint"; }
|
|
425
446
|
static open(view) { return new LintPanel(view); }
|
|
426
447
|
}
|
|
427
448
|
function underline(color) {
|
|
@@ -432,11 +453,12 @@ function underline(color) {
|
|
|
432
453
|
</svg>`;
|
|
433
454
|
return `url('data:image/svg+xml;base64,${btoa(svg)}')`;
|
|
434
455
|
}
|
|
435
|
-
const baseTheme = EditorView.baseTheme({
|
|
456
|
+
const baseTheme = /*@__PURE__*/EditorView.baseTheme({
|
|
436
457
|
".cm-diagnostic": {
|
|
437
458
|
padding: "3px 6px 3px 8px",
|
|
438
459
|
marginLeft: "-1px",
|
|
439
|
-
display: "block"
|
|
460
|
+
display: "block",
|
|
461
|
+
whiteSpace: "pre-wrap"
|
|
440
462
|
},
|
|
441
463
|
".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
|
|
442
464
|
".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
|
|
@@ -458,10 +480,14 @@ const baseTheme = EditorView.baseTheme({
|
|
|
458
480
|
backgroundPosition: "left bottom",
|
|
459
481
|
backgroundRepeat: "repeat-x"
|
|
460
482
|
},
|
|
461
|
-
".cm-lintRange-error": { backgroundImage: underline("#d11") },
|
|
462
|
-
".cm-lintRange-warning": { backgroundImage: underline("orange") },
|
|
463
|
-
".cm-lintRange-info": { backgroundImage: underline("#999") },
|
|
483
|
+
".cm-lintRange-error": { backgroundImage: /*@__PURE__*/underline("#d11") },
|
|
484
|
+
".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/underline("orange") },
|
|
485
|
+
".cm-lintRange-info": { backgroundImage: /*@__PURE__*/underline("#999") },
|
|
464
486
|
".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
|
|
487
|
+
".cm-tooltip-lint": {
|
|
488
|
+
padding: 0,
|
|
489
|
+
margin: 0
|
|
490
|
+
},
|
|
465
491
|
".cm-lintPoint": {
|
|
466
492
|
position: "relative",
|
|
467
493
|
"&:after": {
|
|
@@ -509,10 +535,6 @@ const baseTheme = EditorView.baseTheme({
|
|
|
509
535
|
padding: 0,
|
|
510
536
|
margin: 0
|
|
511
537
|
}
|
|
512
|
-
},
|
|
513
|
-
".cm-tooltip.cm-tooltip-lint": {
|
|
514
|
-
padding: 0,
|
|
515
|
-
margin: 0
|
|
516
538
|
}
|
|
517
539
|
});
|
|
518
540
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemirror/lint",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "Linting support for the CodeMirror code editor",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"test": "
|
|
7
|
-
"prepare": "
|
|
6
|
+
"test": "cm-runtests",
|
|
7
|
+
"prepare": "cm-buildhelper src/lint.ts"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
10
|
"editor",
|
|
@@ -26,16 +26,14 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@codemirror/panel": "^0.18.
|
|
29
|
+
"@codemirror/panel": "^0.18.1",
|
|
30
30
|
"@codemirror/state": "^0.18.0",
|
|
31
|
-
"@codemirror/tooltip": "^0.18.
|
|
31
|
+
"@codemirror/tooltip": "^0.18.4",
|
|
32
32
|
"@codemirror/view": "^0.18.0",
|
|
33
33
|
"crelt": "^1.0.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"rollup-plugin-dts": "^2.0.1",
|
|
38
|
-
"typescript": "^4.1.3"
|
|
36
|
+
"@codemirror/buildhelper": "^0.1.0"
|
|
39
37
|
},
|
|
40
38
|
"repository": {
|
|
41
39
|
"type": "git",
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/lint.js"],"sourcesContent":["import { EditorView, ViewPlugin, Decoration, WidgetType, logException } from \"@codemirror/view\";\nimport { StateEffect, StateField } from \"@codemirror/state\";\nimport { hoverTooltip } from \"@codemirror/tooltip\";\nimport { panels, showPanel, getPanel } from \"@codemirror/panel\";\nimport elt from \"crelt\";\nclass SelectedDiagnostic {\n constructor(from, to, diagnostic) {\n this.from = from;\n this.to = to;\n this.diagnostic = diagnostic;\n }\n}\nclass LintState {\n constructor(diagnostics, panel, selected) {\n this.diagnostics = diagnostics;\n this.panel = panel;\n this.selected = selected;\n }\n}\nfunction findDiagnostic(diagnostics, diagnostic = null, after = 0) {\n let found = null;\n diagnostics.between(after, 1e9, (from, to, { spec }) => {\n if (diagnostic && spec.diagnostic != diagnostic)\n return;\n found = new SelectedDiagnostic(from, to, spec.diagnostic);\n return false;\n });\n return found;\n}\nfunction maybeEnableLint(state, effects) {\n return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of([\n lintState,\n EditorView.decorations.compute([lintState], state => {\n let { selected, panel } = state.field(lintState);\n return !selected || !panel || selected.from == selected.to ? Decoration.none : Decoration.set([\n activeMark.range(selected.from, selected.to)\n ]);\n }),\n panels(),\n hoverTooltip(lintTooltip),\n baseTheme\n ]));\n}\n/// State effect that is used to update the current set of\n/// diagnostics.\nexport function setDiagnostics(state, diagnostics) {\n return {\n effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)])\n };\n}\nconst setDiagnosticsEffect = StateEffect.define();\nconst togglePanel = StateEffect.define();\nconst movePanelSelection = StateEffect.define();\nconst lintState = StateField.define({\n create() {\n return new LintState(Decoration.none, null, null);\n },\n update(value, tr) {\n if (tr.docChanged) {\n let mapped = value.diagnostics.map(tr.changes), selected = null;\n if (value.selected) {\n let selPos = tr.changes.mapPos(value.selected.from, 1);\n selected = findDiagnostic(mapped, value.selected.diagnostic, selPos) || findDiagnostic(mapped, null, selPos);\n }\n value = new LintState(mapped, value.panel, selected);\n }\n for (let effect of tr.effects) {\n if (effect.is(setDiagnosticsEffect)) {\n let ranges = Decoration.set(effect.value.map((d) => {\n return d.from < d.to\n ? Decoration.mark({\n attributes: { class: \"cm-lintRange cm-lintRange-\" + d.severity },\n diagnostic: d\n }).range(d.from, d.to)\n : Decoration.widget({\n widget: new DiagnosticWidget(d),\n diagnostic: d\n }).range(d.from);\n }));\n value = new LintState(ranges, value.panel, findDiagnostic(ranges));\n }\n else if (effect.is(togglePanel)) {\n value = new LintState(value.diagnostics, effect.value ? LintPanel.open : null, value.selected);\n }\n else if (effect.is(movePanelSelection)) {\n value = new LintState(value.diagnostics, value.panel, effect.value);\n }\n }\n return value;\n },\n provide: f => [showPanel.computeN([f], s => { let { panel } = s.field(f); return panel ? [panel] : []; }),\n EditorView.decorations.from(f, s => s.diagnostics)]\n});\nconst activeMark = Decoration.mark({ class: \"cm-lintRange cm-lintRange-active\" });\nfunction lintTooltip(view, pos, side) {\n let { diagnostics } = view.state.field(lintState);\n let found = [], stackStart = 2e8, stackEnd = 0;\n diagnostics.between(pos - (side < 0 ? 1 : 0), pos + (side > 0 ? 1 : 0), (from, to, { spec }) => {\n if (pos >= from && pos <= to &&\n (from == to || ((pos > from || side > 0) && (pos < to || side < 0)))) {\n found.push(spec.diagnostic);\n stackStart = Math.min(from, stackStart);\n stackEnd = Math.max(to, stackEnd);\n }\n });\n if (!found.length)\n return null;\n return {\n pos: stackStart,\n end: stackEnd,\n above: view.state.doc.lineAt(stackStart).to < stackEnd,\n class: \"cm-tooltip-lint\",\n create() {\n return { dom: elt(\"ul\", found.map(d => renderDiagnostic(view, d, false))) };\n }\n };\n}\n/// Command to open and focus the lint panel.\nexport const openLintPanel = (view) => {\n let field = view.state.field(lintState, false);\n if (!field || !field.panel)\n view.dispatch({ effects: maybeEnableLint(view.state, [togglePanel.of(true)]) });\n let panel = getPanel(view, LintPanel.open);\n if (panel)\n panel.dom.querySelector(\".cm-panel-lint ul\").focus();\n return true;\n};\n/// Command to close the lint panel, when open.\nexport const closeLintPanel = (view) => {\n let field = view.state.field(lintState, false);\n if (!field || !field.panel)\n return false;\n view.dispatch({ effects: togglePanel.of(false) });\n return true;\n};\n/// Move the selection to the next diagnostic.\nexport const nextDiagnostic = (view) => {\n let field = view.state.field(lintState, false);\n if (!field)\n return false;\n let sel = view.state.selection.main, next = field.diagnostics.iter(sel.to + 1);\n if (!next.value) {\n next = field.diagnostics.iter(0);\n if (!next.value || next.from == sel.from && next.to == sel.to)\n return false;\n }\n view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });\n return true;\n};\n/// A set of default key bindings for the lint functionality.\n///\n/// - Ctrl-Shift-m (Cmd-Shift-m on macOS): [`openLintPanel`](#lint.openLintPanel)\n/// - F8: [`nextDiagnostic`](#lint.nextDiagnostic)\nexport const lintKeymap = [\n { key: \"Mod-Shift-m\", run: openLintPanel },\n { key: \"F8\", run: nextDiagnostic }\n];\nconst LintDelay = 500;\n/// Given a diagnostic source, this function returns an extension that\n/// enables linting with that source. It will be called whenever the\n/// editor is idle (after its content changed).\nexport function linter(source) {\n return ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.lintTime = Date.now() + LintDelay;\n this.set = true;\n this.run = this.run.bind(this);\n setTimeout(this.run, LintDelay);\n }\n run() {\n let now = Date.now();\n if (now < this.lintTime - 10) {\n setTimeout(this.run, this.lintTime - now);\n }\n else {\n this.set = false;\n let { state } = this.view;\n Promise.resolve(source(this.view)).then(annotations => {\n var _a, _b;\n if (this.view.state.doc == state.doc &&\n (annotations.length || ((_b = (_a = this.view.state.field(lintState, false)) === null || _a === void 0 ? void 0 : _a.diagnostics) === null || _b === void 0 ? void 0 : _b.size)))\n this.view.dispatch(setDiagnostics(this.view.state, annotations));\n }, error => { logException(this.view.state, error); });\n }\n }\n update(update) {\n if (update.docChanged) {\n this.lintTime = Date.now() + LintDelay;\n if (!this.set) {\n this.set = true;\n setTimeout(this.run, LintDelay);\n }\n }\n }\n });\n}\nfunction assignKeys(actions) {\n let assigned = [];\n if (actions)\n actions: for (let { name } of actions) {\n for (let i = 0; i < name.length; i++) {\n let ch = name[i];\n if (/[a-zA-Z]/.test(ch) && !assigned.some(c => c.toLowerCase() == ch.toLowerCase())) {\n assigned.push(ch);\n continue actions;\n }\n }\n assigned.push(\"\");\n }\n return assigned;\n}\nfunction renderDiagnostic(view, diagnostic, inPanel) {\n var _a;\n let keys = inPanel ? assignKeys(diagnostic.actions) : [];\n return elt(\"li\", { class: \"cm-diagnostic cm-diagnostic-\" + diagnostic.severity }, elt(\"span\", { class: \"cm-diagnosticText\" }, diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {\n let click = (e) => {\n e.preventDefault();\n let found = findDiagnostic(view.state.field(lintState).diagnostics, diagnostic);\n if (found)\n action.apply(view, found.from, found.to);\n };\n let { name } = action, keyIndex = keys[i] ? name.indexOf(keys[i]) : -1;\n let nameElt = keyIndex < 0 ? name : [name.slice(0, keyIndex),\n elt(\"u\", name.slice(keyIndex, keyIndex + 1)),\n name.slice(keyIndex + 1)];\n return elt(\"button\", {\n class: \"cm-diagnosticAction\",\n onclick: click,\n onmousedown: click,\n \"aria-label\": ` Action: ${name}${keyIndex < 0 ? \"\" : ` (access key \"${keys[i]})\"`}.`\n }, nameElt);\n }), diagnostic.source && elt(\"div\", { class: \"cm-diagnosticSource\" }, diagnostic.source));\n}\nclass DiagnosticWidget extends WidgetType {\n constructor(diagnostic) {\n super();\n this.diagnostic = diagnostic;\n }\n eq(other) { return other.diagnostic == this.diagnostic; }\n toDOM() {\n return elt(\"span\", { class: \"cm-lintPoint cm-lintPoint-\" + this.diagnostic.severity });\n }\n}\nclass PanelItem {\n constructor(view, diagnostic) {\n this.diagnostic = diagnostic;\n this.id = \"item_\" + Math.floor(Math.random() * 0xffffffff).toString(16);\n this.dom = renderDiagnostic(view, diagnostic, true);\n this.dom.id = this.id;\n this.dom.setAttribute(\"role\", \"option\");\n }\n}\nclass LintPanel {\n constructor(view) {\n this.view = view;\n this.items = [];\n let onkeydown = (event) => {\n if (event.keyCode == 27) { // Escape\n closeLintPanel(this.view);\n this.view.focus();\n }\n else if (event.keyCode == 38 || event.keyCode == 33) { // ArrowUp, PageUp\n this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);\n }\n else if (event.keyCode == 40 || event.keyCode == 34) { // ArrowDown, PageDown\n this.moveSelection((this.selectedIndex + 1) % this.items.length);\n }\n else if (event.keyCode == 36) { // Home\n this.moveSelection(0);\n }\n else if (event.keyCode == 35) { // End\n this.moveSelection(this.items.length - 1);\n }\n else if (event.keyCode == 13) { // Enter\n this.view.focus();\n }\n else if (event.keyCode >= 65 && event.keyCode <= 90 && this.items.length) { // A-Z\n let { diagnostic } = this.items[this.selectedIndex], keys = assignKeys(diagnostic.actions);\n for (let i = 0; i < keys.length; i++)\n if (keys[i].toUpperCase().charCodeAt(0) == event.keyCode) {\n let found = findDiagnostic(this.view.state.field(lintState).diagnostics, diagnostic);\n if (found)\n diagnostic.actions[i].apply(view, found.from, found.to);\n }\n }\n else {\n return;\n }\n event.preventDefault();\n };\n let onclick = (event) => {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].dom.contains(event.target))\n this.moveSelection(i);\n }\n };\n this.list = elt(\"ul\", {\n tabIndex: 0,\n role: \"listbox\",\n \"aria-label\": this.view.state.phrase(\"Diagnostics\"),\n onkeydown,\n onclick\n });\n this.dom = elt(\"div\", this.list, elt(\"button\", {\n name: \"close\",\n \"aria-label\": this.view.state.phrase(\"close\"),\n onclick: () => closeLintPanel(this.view)\n }, \"×\"));\n this.update();\n }\n get selectedIndex() {\n let selected = this.view.state.field(lintState).selected;\n if (!selected)\n return -1;\n for (let i = 0; i < this.items.length; i++)\n if (this.items[i].diagnostic == selected.diagnostic)\n return i;\n return -1;\n }\n update() {\n let { diagnostics, selected } = this.view.state.field(lintState);\n let i = 0, needsSync = false, newSelectedItem = null;\n diagnostics.between(0, this.view.state.doc.length, (_start, _end, { spec }) => {\n let found = -1, item;\n for (let j = i; j < this.items.length; j++)\n if (this.items[j].diagnostic == spec.diagnostic) {\n found = j;\n break;\n }\n if (found < 0) {\n item = new PanelItem(this.view, spec.diagnostic);\n this.items.splice(i, 0, item);\n needsSync = true;\n }\n else {\n item = this.items[found];\n if (found > i) {\n this.items.splice(i, found - i);\n needsSync = true;\n }\n }\n if (selected && item.diagnostic == selected.diagnostic) {\n if (!item.dom.hasAttribute(\"aria-selected\")) {\n item.dom.setAttribute(\"aria-selected\", \"true\");\n newSelectedItem = item;\n }\n }\n else if (item.dom.hasAttribute(\"aria-selected\")) {\n item.dom.removeAttribute(\"aria-selected\");\n }\n i++;\n });\n while (i < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0)) {\n needsSync = true;\n this.items.pop();\n }\n if (this.items.length == 0) {\n this.items.push(new PanelItem(this.view, {\n from: -1, to: -1,\n severity: \"info\",\n message: this.view.state.phrase(\"No diagnostics\")\n }));\n needsSync = true;\n }\n if (newSelectedItem) {\n this.list.setAttribute(\"aria-activedescendant\", newSelectedItem.id);\n this.view.requestMeasure({\n key: this,\n read: () => ({ sel: newSelectedItem.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),\n write: ({ sel, panel }) => {\n if (sel.top < panel.top)\n this.list.scrollTop -= panel.top - sel.top;\n else if (sel.bottom > panel.bottom)\n this.list.scrollTop += sel.bottom - panel.bottom;\n }\n });\n }\n else if (!this.items.length) {\n this.list.removeAttribute(\"aria-activedescendant\");\n }\n if (needsSync)\n this.sync();\n }\n sync() {\n let domPos = this.list.firstChild;\n function rm() {\n let prev = domPos;\n domPos = prev.nextSibling;\n prev.remove();\n }\n for (let item of this.items) {\n if (item.dom.parentNode == this.list) {\n while (domPos != item.dom)\n rm();\n domPos = item.dom.nextSibling;\n }\n else {\n this.list.insertBefore(item.dom, domPos);\n }\n }\n while (domPos)\n rm();\n if (!this.list.firstChild)\n this.list.appendChild(renderDiagnostic(this.view, {\n severity: \"info\",\n message: this.view.state.phrase(\"No diagnostics\")\n }, true));\n }\n moveSelection(selectedIndex) {\n if (this.items.length == 0)\n return;\n let field = this.view.state.field(lintState);\n let selection = findDiagnostic(field.diagnostics, this.items[selectedIndex].diagnostic);\n if (!selection)\n return;\n this.view.dispatch({\n selection: { anchor: selection.from, head: selection.to },\n scrollIntoView: true,\n effects: movePanelSelection.of(selection)\n });\n }\n get class() { return \"cm-panel-lint\"; }\n static open(view) { return new LintPanel(view); }\n}\nfunction underline(color) {\n if (typeof btoa != \"function\")\n return \"none\";\n let svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6\" height=\"3\">\n <path d=\"m0 3 l2 -2 l1 0 l2 2 l1 0\" stroke=\"${color}\" fill=\"none\" stroke-width=\".7\"/>\n </svg>`;\n return `url('data:image/svg+xml;base64,${btoa(svg)}')`;\n}\nconst baseTheme = EditorView.baseTheme({\n \".cm-diagnostic\": {\n padding: \"3px 6px 3px 8px\",\n marginLeft: \"-1px\",\n display: \"block\"\n },\n \".cm-diagnostic-error\": { borderLeft: \"5px solid #d11\" },\n \".cm-diagnostic-warning\": { borderLeft: \"5px solid orange\" },\n \".cm-diagnostic-info\": { borderLeft: \"5px solid #999\" },\n \".cm-diagnosticAction\": {\n font: \"inherit\",\n border: \"none\",\n padding: \"2px 4px\",\n backgroundColor: \"#444\",\n color: \"white\",\n borderRadius: \"3px\",\n marginLeft: \"8px\"\n },\n \".cm-diagnosticSource\": {\n fontSize: \"70%\",\n opacity: .7\n },\n \".cm-lintRange\": {\n backgroundPosition: \"left bottom\",\n backgroundRepeat: \"repeat-x\"\n },\n \".cm-lintRange-error\": { backgroundImage: underline(\"#d11\") },\n \".cm-lintRange-warning\": { backgroundImage: underline(\"orange\") },\n \".cm-lintRange-info\": { backgroundImage: underline(\"#999\") },\n \".cm-lintRange-active\": { backgroundColor: \"#ffdd9980\" },\n \".cm-lintPoint\": {\n position: \"relative\",\n \"&:after\": {\n content: '\"\"',\n position: \"absolute\",\n bottom: 0,\n left: \"-2px\",\n borderLeft: \"3px solid transparent\",\n borderRight: \"3px solid transparent\",\n borderBottom: \"4px solid #d11\"\n }\n },\n \".cm-lintPoint-warning\": {\n \"&:after\": { borderBottomColor: \"orange\" }\n },\n \".cm-lintPoint-info\": {\n \"&:after\": { borderBottomColor: \"#999\" }\n },\n \".cm-panel.cm-panel-lint\": {\n position: \"relative\",\n \"& ul\": {\n maxHeight: \"100px\",\n overflowY: \"auto\",\n \"& [aria-selected]\": {\n backgroundColor: \"#ddd\",\n \"& u\": { textDecoration: \"underline\" }\n },\n \"&:focus [aria-selected]\": {\n background_fallback: \"#bdf\",\n backgroundColor: \"Highlight\",\n color_fallback: \"white\",\n color: \"HighlightText\"\n },\n \"& u\": { textDecoration: \"none\" },\n padding: 0,\n margin: 0\n },\n \"& [name=close]\": {\n position: \"absolute\",\n top: \"0\",\n right: \"2px\",\n background: \"inherit\",\n border: \"none\",\n font: \"inherit\",\n padding: 0,\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AAC3C,gBAAgB,eAAe,EAAE,WAAW;AAC5C,gBAAgB,cAAc,EAAE,OAAO;AACvC,gBAAgB,KAAK,EAAE,eAAe;AACtC,aAAa;AACb,YAAY,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE;AAC7C,YAAY,OAAO,EAAE,CAAC;AACtB,YAAY,MAAM,EAAE,CAAC;AACrB,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,QAAQ,EAAE,UAAU;AAChC,YAAY,GAAG,EAAE,GAAG;AACpB,YAAY,KAAK,EAAE,KAAK;AACxB,YAAY,UAAU,EAAE,SAAS;AACjC,YAAY,MAAM,EAAE,MAAM;AAC1B,YAAY,IAAI,EAAE,SAAS;AAC3B,YAAY,OAAO,EAAE,CAAC;AACtB,YAAY,MAAM,EAAE,CAAC;AACrB,SAAS;AACT,KAAK;AACL,IAAI,6BAA6B,EAAE;AACnC,QAAQ,OAAO,EAAE,CAAC;AAClB,QAAQ,MAAM,EAAE,CAAC;AACjB,KAAK;AACL,CAAC,CAAC;;;;"}
|
package/tsconfig.local.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": ["es6", "dom", "scripthost"],
|
|
4
|
-
"types": ["mocha"],
|
|
5
|
-
"stripInternal": true,
|
|
6
|
-
"noUnusedLocals": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"target": "es6",
|
|
9
|
-
"module": "es2020",
|
|
10
|
-
"newLine": "lf",
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationMap": true,
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"paths": {
|
|
15
|
-
"@codemirror/lint": ["./src/lint.ts"]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/*.ts", "test/*.ts"]
|
|
19
|
-
}
|