@adecore/editor-react 0.31.12 → 0.33.0
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/dist/AnchoredPopup.js +73 -19
- package/dist/AttributionCard.js +162 -4
- package/dist/BaselineStatus.js +62 -8
- package/dist/CallHierarchyPanel.js +977 -60
- package/dist/ChangeReview.js +76 -25
- package/dist/CodeAuthorsCard.js +314 -14
- package/dist/CompletionPopup.js +490 -83
- package/dist/DiffView.js +548 -181
- package/dist/EditorContextMenu.js +352 -34
- package/dist/EditorView.js +276 -99
- package/dist/FindReplace.js +525 -67
- package/dist/HoverCard.js +378 -38
- package/dist/HoverSections.js +367 -56
- package/dist/LanguagePopups.js +95 -34
- package/dist/Markdown.js +41 -6
- package/dist/PanelResizeHandle.js +199 -66
- package/dist/PathText.js +49 -7
- package/dist/PeekPanel.js +675 -72
- package/dist/PickPopup.js +304 -34
- package/dist/RenameCard.js +679 -85
- package/dist/RenderedDocs.js +329 -58
- package/dist/SignatureCard.js +91 -7
- package/dist/SplitDiffView.js +344 -254
- package/dist/SymbolPicker.js +440 -85
- package/dist/call-hierarchy-model.js +102 -68
- package/dist/call-hierarchy.js +458 -359
- package/dist/code-actions-model.js +88 -76
- package/dist/code-actions.js +372 -283
- package/dist/code-authors.js +64 -55
- package/dist/code-vision-model.js +134 -127
- package/dist/code-vision.js +224 -206
- package/dist/completion-call.js +94 -67
- package/dist/completion-model.js +334 -244
- package/dist/completion.js +840 -649
- package/dist/conflict-model.js +35 -29
- package/dist/context-menu-rows.js +42 -17
- package/dist/context-menu.js +64 -46
- package/dist/definition-link.js +88 -85
- package/dist/diagnostics-model.js +74 -55
- package/dist/diagnostics.js +121 -100
- package/dist/diff-expansion.js +38 -35
- package/dist/diff-overlays.js +144 -22
- package/dist/diff-syntax.js +65 -42
- package/dist/diff-wordmarks.js +26 -23
- package/dist/doc-comment-model.js +265 -216
- package/dist/editor-language.js +177 -152
- package/dist/error-message.js +2 -2
- package/dist/find-query.js +49 -36
- package/dist/folding.js +81 -62
- package/dist/format-on-type.js +86 -67
- package/dist/highlight-layers.js +19 -20
- package/dist/highlights.js +105 -83
- package/dist/history.js +44 -38
- package/dist/holder.js +18 -18
- package/dist/host-types.js +1 -1
- package/dist/hover-content.js +167 -129
- package/dist/hover.js +285 -245
- package/dist/index.js +10 -10
- package/dist/inlay-hints.js +369 -324
- package/dist/key-priority.js +34 -31
- package/dist/language-ids.js +45 -42
- package/dist/line-edits.js +74 -28
- package/dist/line-text.js +18 -3
- package/dist/locales/en.json +38 -38
- package/dist/locales/nl.json +41 -41
- package/dist/models.js +1 -1
- package/dist/navigation-history.js +40 -41
- package/dist/navigation.js +141 -123
- package/dist/panel-size.js +8 -8
- package/dist/patch-decorations.js +236 -160
- package/dist/patch-layout.js +331 -262
- package/dist/paths.js +3 -3
- package/dist/peek-model.js +86 -69
- package/dist/peek.js +254 -192
- package/dist/pick.js +164 -157
- package/dist/popup-focus.js +5 -5
- package/dist/popup-placement.js +36 -21
- package/dist/popups.js +13 -13
- package/dist/project-language.js +228 -211
- package/dist/project-problems.js +81 -69
- package/dist/proposal-model.js +163 -126
- package/dist/recent-choices.js +25 -25
- package/dist/refresher.js +44 -49
- package/dist/rename-model.js +113 -113
- package/dist/rename.js +321 -233
- package/dist/rendered-docs.d.ts +4 -2
- package/dist/rendered-docs.js +384 -318
- package/dist/rendering-context.js +5 -3
- package/dist/rendering.js +22 -4
- package/dist/review-group.js +42 -39
- package/dist/row-host.d.ts +4 -2
- package/dist/row-host.js +90 -78
- package/dist/selection-ranges.js +21 -17
- package/dist/semantic-delta.js +22 -19
- package/dist/semantic-model.js +86 -73
- package/dist/semantic-tokens.js +201 -162
- package/dist/shortcut-keys.js +16 -10
- package/dist/signature-model.js +34 -28
- package/dist/signature.js +177 -129
- package/dist/snippet-field-transforms.js +118 -106
- package/dist/snippet-indent.js +48 -43
- package/dist/snippet-range-order.js +11 -11
- package/dist/snippet-session.js +703 -667
- package/dist/snippet-transform-client.js +59 -59
- package/dist/snippet-transform-format.js +285 -263
- package/dist/snippet-transform-protocol.js +1 -1
- package/dist/snippet-transform-queue.js +163 -153
- package/dist/snippet-transform-worker.js +42 -35
- package/dist/snippet-variable-names.js +1 -36
- package/dist/snippet-variables.js +53 -63
- package/dist/snippet.js +477 -405
- package/dist/split-alignment.js +47 -35
- package/dist/split-scroll.js +42 -40
- package/dist/symbol-links.js +33 -25
- package/dist/symbol-picker-model.js +126 -116
- package/dist/symbol-picker.js +98 -59
- package/dist/symbols.js +117 -88
- package/dist/testing.js +248 -165
- package/dist/timers.js +35 -30
- package/dist/use-panel-body.js +49 -8
- package/dist/use-problem-counts.js +29 -15
- package/dist/view-state.js +54 -33
- package/dist/word-diff.js +18 -18
- package/dist/workspace-edit.js +300 -249
- package/package.json +6 -6
- package/src/CallHierarchyPanel.tsx +2 -2
- package/src/DiffView.tsx +3 -3
- package/src/FindReplace.tsx +2 -2
- package/src/LanguagePopups.tsx +2 -0
- package/src/PeekPanel.tsx +3 -3
- package/src/RenderedDocs.tsx +9 -10
- package/src/SymbolPicker.tsx +2 -2
- package/src/diff-overlays.tsx +6 -4
- package/src/locales/en.json +38 -38
- package/src/locales/nl.json +41 -41
- package/src/rendered-docs.ts +14 -3
- package/src/row-host.ts +14 -3
package/dist/testing.js
CHANGED
|
@@ -1,168 +1,251 @@
|
|
|
1
1
|
import { applyContentChanges, ErrorCodes, LspError, StaleResultError } from '@adecore/lsp';
|
|
2
2
|
export { ManualTimers } from './timers.js';
|
|
3
3
|
export class FakeLanguageService {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
4
|
+
documents = new Map();
|
|
5
|
+
calls = [];
|
|
6
|
+
providers = new Map();
|
|
7
|
+
answers = new Map();
|
|
8
|
+
diagnostics = new Set();
|
|
9
|
+
changes = new Set();
|
|
10
|
+
respond(method, answer, provider = {}) {
|
|
11
|
+
this.answers.set(method, answer);
|
|
12
|
+
this.providers.set(method, provider);
|
|
13
|
+
}
|
|
14
|
+
async openDocument(document) {
|
|
15
|
+
const held = this.documents.get(document.uri);
|
|
16
|
+
this.documents.set(document.uri, {
|
|
17
|
+
...document,
|
|
18
|
+
version: held === undefined ? 1 : held.version + (held.text === document.text ? 0 : 1)
|
|
19
|
+
});
|
|
20
|
+
this.calls.push({
|
|
21
|
+
method: 'open',
|
|
22
|
+
uri: document.uri,
|
|
23
|
+
params: document,
|
|
24
|
+
options: {}
|
|
25
|
+
});
|
|
26
|
+
await this.answers.get('open')?.(this.calls.at(-1));
|
|
27
|
+
}
|
|
28
|
+
async changeDocument(uri, changes) {
|
|
29
|
+
const held = this.documents.get(uri);
|
|
30
|
+
if (held === undefined) {
|
|
31
|
+
throw new LspError('Document is not open', ErrorCodes.ServerNotInitialized);
|
|
32
|
+
}
|
|
33
|
+
held.text = applyContentChanges(held.text, changes);
|
|
34
|
+
held.version++;
|
|
35
|
+
this.calls.push({
|
|
36
|
+
method: 'change',
|
|
37
|
+
uri,
|
|
38
|
+
params: changes,
|
|
39
|
+
options: {}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async closeDocument(uri) {
|
|
43
|
+
this.documents.delete(uri);
|
|
44
|
+
this.calls.push({
|
|
45
|
+
method: 'close',
|
|
46
|
+
uri,
|
|
47
|
+
params: null,
|
|
48
|
+
options: {}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
supports(method, _uri) {
|
|
52
|
+
return this.providers.has(method);
|
|
53
|
+
}
|
|
54
|
+
providerOptions(method, _uri) {
|
|
55
|
+
return this.providers.get(method);
|
|
56
|
+
}
|
|
57
|
+
onProvidersChanged(listener) {
|
|
58
|
+
this.changes.add(listener);
|
|
59
|
+
return {
|
|
60
|
+
dispose: () => this.changes.delete(listener)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
onDiagnostics(listener) {
|
|
64
|
+
this.diagnostics.add(listener);
|
|
65
|
+
return {
|
|
66
|
+
dispose: () => this.diagnostics.delete(listener)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
report(report) {
|
|
70
|
+
for (const listener of this.diagnostics) {
|
|
71
|
+
listener(report);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
refresh(uri) {
|
|
75
|
+
for (const listener of this.changes) {
|
|
76
|
+
listener(uri);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async request(method, uri, params, options = {}) {
|
|
80
|
+
if (!this.supports(method, uri)) {
|
|
81
|
+
throw new LspError(`${method} is unavailable`, ErrorCodes.MethodNotFound);
|
|
82
|
+
}
|
|
83
|
+
options.signal?.throwIfAborted();
|
|
84
|
+
const version = this.documents.get(uri)?.version;
|
|
85
|
+
const call = {
|
|
86
|
+
method,
|
|
87
|
+
uri,
|
|
88
|
+
params,
|
|
89
|
+
options
|
|
90
|
+
};
|
|
91
|
+
this.calls.push(call);
|
|
92
|
+
const result = await this.answers.get(method)?.(call);
|
|
93
|
+
options.signal?.throwIfAborted();
|
|
94
|
+
if (this.documents.get(uri)?.version !== version) {
|
|
95
|
+
throw new StaleResultError(uri);
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
completion(uri, position, context, options = {}) {
|
|
100
|
+
return this.request('textDocument/completion', uri, {
|
|
101
|
+
position,
|
|
102
|
+
context
|
|
103
|
+
}, options);
|
|
104
|
+
}
|
|
105
|
+
resolveCompletion(uri, item, options = {}) {
|
|
106
|
+
return this.request('completionItem/resolve', uri, item, options);
|
|
107
|
+
}
|
|
108
|
+
hover(uri, position, options = {}) {
|
|
109
|
+
return this.request('textDocument/hover', uri, {
|
|
110
|
+
position
|
|
111
|
+
}, options);
|
|
112
|
+
}
|
|
113
|
+
signatureHelp(uri, position, context, options = {}) {
|
|
114
|
+
return this.request('textDocument/signatureHelp', uri, {
|
|
115
|
+
position,
|
|
116
|
+
context
|
|
117
|
+
}, options);
|
|
118
|
+
}
|
|
119
|
+
definition(uri, position, options = {}) {
|
|
120
|
+
return this.request('textDocument/definition', uri, {
|
|
121
|
+
position
|
|
122
|
+
}, options);
|
|
123
|
+
}
|
|
124
|
+
declaration(uri, position, options = {}) {
|
|
125
|
+
return this.request('textDocument/declaration', uri, {
|
|
126
|
+
position
|
|
127
|
+
}, options);
|
|
128
|
+
}
|
|
129
|
+
typeDefinition(uri, position, options = {}) {
|
|
130
|
+
return this.request('textDocument/typeDefinition', uri, {
|
|
131
|
+
position
|
|
132
|
+
}, options);
|
|
133
|
+
}
|
|
134
|
+
implementation(uri, position, options = {}) {
|
|
135
|
+
return this.request('textDocument/implementation', uri, {
|
|
136
|
+
position
|
|
137
|
+
}, options);
|
|
138
|
+
}
|
|
139
|
+
references(uri, position, includeDeclaration, options = {}) {
|
|
140
|
+
return this.request('textDocument/references', uri, {
|
|
141
|
+
position,
|
|
142
|
+
context: {
|
|
143
|
+
includeDeclaration
|
|
144
|
+
}
|
|
145
|
+
}, options);
|
|
146
|
+
}
|
|
147
|
+
documentHighlights(uri, position, options = {}) {
|
|
148
|
+
return this.request('textDocument/documentHighlight', uri, {
|
|
149
|
+
position
|
|
150
|
+
}, options);
|
|
151
|
+
}
|
|
152
|
+
documentSymbols(uri, options = {}) {
|
|
153
|
+
return this.request('textDocument/documentSymbol', uri, {}, options);
|
|
154
|
+
}
|
|
155
|
+
prepareRename(uri, position, options = {}) {
|
|
156
|
+
return this.request('textDocument/prepareRename', uri, {
|
|
157
|
+
position
|
|
158
|
+
}, options);
|
|
159
|
+
}
|
|
160
|
+
rename(uri, position, newName, options = {}) {
|
|
161
|
+
return this.request('textDocument/rename', uri, {
|
|
162
|
+
position,
|
|
163
|
+
newName
|
|
164
|
+
}, options);
|
|
165
|
+
}
|
|
166
|
+
codeActions(uri, range, context, options = {}) {
|
|
167
|
+
return this.request('textDocument/codeAction', uri, {
|
|
168
|
+
range,
|
|
169
|
+
context
|
|
170
|
+
}, options);
|
|
171
|
+
}
|
|
172
|
+
resolveCodeAction(uri, action, options = {}) {
|
|
173
|
+
return this.request('codeAction/resolve', uri, action, options);
|
|
174
|
+
}
|
|
175
|
+
executeCommand(uri, command, options = {}) {
|
|
176
|
+
return this.request('workspace/executeCommand', uri, command, options);
|
|
177
|
+
}
|
|
178
|
+
formatting(uri, formatting, options = {}) {
|
|
179
|
+
return this.request('textDocument/formatting', uri, {
|
|
180
|
+
options: formatting
|
|
181
|
+
}, options);
|
|
182
|
+
}
|
|
183
|
+
rangeFormatting(uri, range, formatting, options = {}) {
|
|
184
|
+
return this.request('textDocument/rangeFormatting', uri, {
|
|
185
|
+
range,
|
|
186
|
+
options: formatting
|
|
187
|
+
}, options);
|
|
188
|
+
}
|
|
189
|
+
onTypeFormatting(uri, position, ch, formatting, options = {}) {
|
|
190
|
+
return this.request('textDocument/onTypeFormatting', uri, {
|
|
191
|
+
position,
|
|
192
|
+
ch,
|
|
193
|
+
options: formatting
|
|
194
|
+
}, options);
|
|
195
|
+
}
|
|
196
|
+
semanticTokens(uri, options = {}) {
|
|
197
|
+
return this.request('textDocument/semanticTokens/full', uri, {}, options);
|
|
198
|
+
}
|
|
199
|
+
semanticTokensDelta(uri, previousResultId, options = {}) {
|
|
200
|
+
return this.request('textDocument/semanticTokens/full/delta', uri, {
|
|
201
|
+
previousResultId
|
|
202
|
+
}, options);
|
|
203
|
+
}
|
|
204
|
+
semanticTokensRange(uri, range, options = {}) {
|
|
205
|
+
return this.request('textDocument/semanticTokens/range', uri, {
|
|
206
|
+
range
|
|
207
|
+
}, options);
|
|
208
|
+
}
|
|
209
|
+
inlayHints(uri, range, options = {}) {
|
|
210
|
+
return this.request('textDocument/inlayHint', uri, {
|
|
211
|
+
range
|
|
212
|
+
}, options);
|
|
213
|
+
}
|
|
214
|
+
resolveInlayHint(uri, hint, options = {}) {
|
|
215
|
+
return this.request('inlayHint/resolve', uri, hint, options);
|
|
216
|
+
}
|
|
217
|
+
workspaceSymbols(uri, query, options = {}) {
|
|
218
|
+
return this.request('workspace/symbol', uri, {
|
|
219
|
+
query
|
|
220
|
+
}, options);
|
|
221
|
+
}
|
|
222
|
+
foldingRanges(uri, options = {}) {
|
|
223
|
+
return this.request('textDocument/foldingRange', uri, {}, options);
|
|
224
|
+
}
|
|
225
|
+
selectionRanges(uri, positions, options = {}) {
|
|
226
|
+
return this.request('textDocument/selectionRange', uri, {
|
|
227
|
+
positions
|
|
228
|
+
}, options);
|
|
229
|
+
}
|
|
230
|
+
prepareCallHierarchy(uri, position, options = {}) {
|
|
231
|
+
return this.request('textDocument/prepareCallHierarchy', uri, {
|
|
232
|
+
position
|
|
233
|
+
}, options);
|
|
234
|
+
}
|
|
235
|
+
incomingCalls(uri, item, options = {}) {
|
|
236
|
+
return this.request('callHierarchy/incomingCalls', uri, {
|
|
237
|
+
item
|
|
238
|
+
}, options);
|
|
239
|
+
}
|
|
240
|
+
outgoingCalls(uri, item, options = {}) {
|
|
241
|
+
return this.request('callHierarchy/outgoingCalls', uri, {
|
|
242
|
+
item
|
|
243
|
+
}, options);
|
|
244
|
+
}
|
|
245
|
+
codeLenses(uri, options = {}) {
|
|
246
|
+
return this.request('textDocument/codeLens', uri, {}, options);
|
|
247
|
+
}
|
|
248
|
+
resolveCodeLens(uri, lens, options = {}) {
|
|
249
|
+
return this.request('codeLens/resolve', uri, lens, options);
|
|
250
|
+
}
|
|
251
|
+
}
|
package/dist/timers.js
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
export const realTimers = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
set: (callback, delay) => setTimeout(callback, delay),
|
|
3
|
+
clear: handle => clearTimeout(handle)
|
|
4
4
|
};
|
|
5
5
|
/* Runs what was scheduled when a test says how much time has passed. */
|
|
6
6
|
export class ManualTimers {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
get size() {
|
|
32
|
-
return this.pending.size;
|
|
7
|
+
now = 0;
|
|
8
|
+
next = 1;
|
|
9
|
+
pending = new Map();
|
|
10
|
+
set(callback, delay) {
|
|
11
|
+
const id = this.next++;
|
|
12
|
+
this.pending.set(id, {
|
|
13
|
+
at: this.now + delay,
|
|
14
|
+
callback
|
|
15
|
+
});
|
|
16
|
+
return id;
|
|
17
|
+
}
|
|
18
|
+
clear(handle) {
|
|
19
|
+
this.pending.delete(handle);
|
|
20
|
+
}
|
|
21
|
+
advance(milliseconds) {
|
|
22
|
+
const until = this.now + milliseconds;
|
|
23
|
+
for (;;) {
|
|
24
|
+
const due = [...this.pending].filter(([, entry]) => entry.at <= until).sort((left, right) => left[1].at - right[1].at)[0];
|
|
25
|
+
if (due === undefined) {
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
this.now = due[1].at;
|
|
29
|
+
this.pending.delete(due[0]);
|
|
30
|
+
due[1].callback();
|
|
33
31
|
}
|
|
32
|
+
this.now = until;
|
|
33
|
+
}
|
|
34
|
+
get size() {
|
|
35
|
+
return this.pending.size;
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
/* Scrolls a row the editor opened under the caret line into view, which may sit at the bottom of the view with the row below the fold. The element is in the page a turn later. */
|
|
36
39
|
export function revealRow(timers, container) {
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
timers.set(() => container.scrollIntoView?.({
|
|
41
|
+
block: 'nearest'
|
|
42
|
+
}), 0);
|
|
43
|
+
}
|
package/dist/use-panel-body.js
CHANGED
|
@@ -1,13 +1,54 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import { useEffect, useState } from 'react';
|
|
2
3
|
import { clampPanelBody } from './panel-size.js';
|
|
3
4
|
/* The body height of a panel, from the project that remembers it for the next one; `commit` hands it to the host. */
|
|
4
5
|
export function usePanelBody(language) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const $ = _c(10);
|
|
7
|
+
const {
|
|
8
|
+
project
|
|
9
|
+
} = language;
|
|
10
|
+
let t0;
|
|
11
|
+
if ($[0] !== project.panelBodyHeight) {
|
|
12
|
+
t0 = () => clampPanelBody(project.panelBodyHeight);
|
|
13
|
+
$[0] = project.panelBodyHeight;
|
|
14
|
+
$[1] = t0;
|
|
15
|
+
} else {
|
|
16
|
+
t0 = $[1];
|
|
17
|
+
}
|
|
18
|
+
const [height, set] = useState(t0);
|
|
19
|
+
let t1;
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[2] !== project) {
|
|
22
|
+
t1 = () => project.onPanelBodyChange(value => set(clampPanelBody(value)));
|
|
23
|
+
t2 = [project];
|
|
24
|
+
$[2] = project;
|
|
25
|
+
$[3] = t1;
|
|
26
|
+
$[4] = t2;
|
|
27
|
+
} else {
|
|
28
|
+
t1 = $[3];
|
|
29
|
+
t2 = $[4];
|
|
30
|
+
}
|
|
31
|
+
useEffect(t1, t2);
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[5] !== project) {
|
|
34
|
+
t3 = value_0 => project.resizePanelBody(value_0);
|
|
35
|
+
$[5] = project;
|
|
36
|
+
$[6] = t3;
|
|
37
|
+
} else {
|
|
38
|
+
t3 = $[6];
|
|
39
|
+
}
|
|
40
|
+
let t4;
|
|
41
|
+
if ($[7] !== height || $[8] !== t3) {
|
|
42
|
+
t4 = {
|
|
43
|
+
height,
|
|
44
|
+
set,
|
|
45
|
+
commit: t3
|
|
12
46
|
};
|
|
13
|
-
|
|
47
|
+
$[7] = height;
|
|
48
|
+
$[8] = t3;
|
|
49
|
+
$[9] = t4;
|
|
50
|
+
} else {
|
|
51
|
+
t4 = $[9];
|
|
52
|
+
}
|
|
53
|
+
return t4;
|
|
54
|
+
}
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import { useMemo, useSyncExternalStore } from 'react';
|
|
2
|
-
const NONE = {
|
|
3
|
+
const NONE = {
|
|
4
|
+
error: 0,
|
|
5
|
+
warning: 0,
|
|
6
|
+
info: 0
|
|
7
|
+
};
|
|
3
8
|
function countsStore(language) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
let current = language?.diagnostics.counts() ?? NONE;
|
|
10
|
+
return {
|
|
11
|
+
get: () => {
|
|
12
|
+
const next = language?.diagnostics.counts() ?? NONE;
|
|
13
|
+
if (next.error !== current.error || next.warning !== current.warning || next.info !== current.info) {
|
|
14
|
+
current = next;
|
|
15
|
+
}
|
|
16
|
+
return current;
|
|
17
|
+
},
|
|
18
|
+
subscribe: listener => language?.diagnostics.onChange(listener) ?? (() => undefined)
|
|
19
|
+
};
|
|
15
20
|
}
|
|
16
21
|
/* How many errors, warnings and infos the file has, said again when the servers report. */
|
|
17
22
|
export function useProblemCounts(language) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
const $ = _c(2);
|
|
24
|
+
let t0;
|
|
25
|
+
if ($[0] !== language) {
|
|
26
|
+
t0 = countsStore(language);
|
|
27
|
+
$[0] = language;
|
|
28
|
+
$[1] = t0;
|
|
29
|
+
} else {
|
|
30
|
+
t0 = $[1];
|
|
31
|
+
}
|
|
32
|
+
const store = t0;
|
|
33
|
+
return useSyncExternalStore(store.subscribe, store.get);
|
|
34
|
+
}
|