@adecore/editor-react 0.22.1 → 0.23.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/dist/CallHierarchyPanel.d.ts +6 -0
- package/dist/CallHierarchyPanel.js +92 -0
- package/dist/CompletionPopup.js +11 -3
- package/dist/DiffView.d.ts +22 -0
- package/dist/DiffView.js +203 -0
- package/dist/EditorContextMenu.js +1 -0
- package/dist/EditorView.js +18 -1
- package/dist/FindReplace.d.ts +1 -1
- package/dist/FindReplace.js +41 -11
- package/dist/HoverCard.js +2 -2
- package/dist/LanguagePopups.js +4 -1
- package/dist/Markdown.d.ts +2 -1
- package/dist/Markdown.js +8 -4
- package/dist/PanelResizeHandle.d.ts +8 -0
- package/dist/PanelResizeHandle.js +71 -0
- package/dist/PeekPanel.d.ts +3 -0
- package/dist/PeekPanel.js +7 -4
- package/dist/PickPopup.js +15 -2
- package/dist/RenameCard.js +10 -5
- package/dist/RenderedDocs.d.ts +9 -0
- package/dist/RenderedDocs.js +84 -0
- package/dist/SplitDiffView.d.ts +9 -0
- package/dist/SplitDiffView.js +276 -0
- package/dist/SymbolPicker.d.ts +3 -0
- package/dist/SymbolPicker.js +4 -3
- package/dist/call-hierarchy-model.d.ts +52 -0
- package/dist/call-hierarchy-model.js +93 -0
- package/dist/call-hierarchy.d.ts +42 -0
- package/dist/call-hierarchy.js +398 -0
- package/dist/code-actions-model.d.ts +2 -0
- package/dist/code-actions-model.js +12 -10
- package/dist/code-actions.js +3 -1
- package/dist/completion-model.d.ts +14 -4
- package/dist/completion-model.js +40 -33
- package/dist/completion.d.ts +4 -0
- package/dist/completion.js +257 -42
- package/dist/diagnostics.js +8 -6
- package/dist/diff-expansion.d.ts +9 -0
- package/dist/diff-expansion.js +41 -0
- package/dist/diff-overlays.d.ts +15 -0
- package/dist/diff-overlays.js +28 -0
- package/dist/diff-syntax.d.ts +16 -0
- package/dist/diff-syntax.js +49 -0
- package/dist/diff-wordmarks.d.ts +5 -0
- package/dist/diff-wordmarks.js +26 -0
- package/dist/doc-comment-model.d.ts +23 -0
- package/dist/doc-comment-model.js +291 -0
- package/dist/editor-language.d.ts +13 -1
- package/dist/editor-language.js +15 -5
- package/dist/editor-react.css +79 -0
- package/dist/format-on-type.d.ts +14 -0
- package/dist/format-on-type.js +96 -0
- package/dist/host-types.d.ts +19 -0
- package/dist/hover.d.ts +4 -0
- package/dist/hover.js +15 -2
- package/dist/index.d.ts +19 -5
- package/dist/index.js +9 -1
- package/dist/inlay-hints.d.ts +47 -2
- package/dist/inlay-hints.js +353 -16
- package/dist/language-ids.js +4 -2
- package/dist/locales/en.json +117 -3
- package/dist/locales/nl.json +117 -3
- package/dist/models.d.ts +6 -2
- package/dist/models.js +5 -1
- package/dist/panel-size.d.ts +6 -0
- package/dist/panel-size.js +25 -0
- package/dist/patch-decorations.d.ts +27 -0
- package/dist/patch-decorations.js +182 -0
- package/dist/patch-layout.d.ts +40 -0
- package/dist/patch-layout.js +304 -0
- package/dist/peek.d.ts +3 -1
- package/dist/peek.js +6 -1
- package/dist/pick.d.ts +1 -0
- package/dist/pick.js +11 -1
- package/dist/popups.d.ts +17 -0
- package/dist/popups.js +1 -0
- package/dist/project-language.d.ts +12 -0
- package/dist/project-language.js +52 -2
- package/dist/refresher.d.ts +1 -0
- package/dist/refresher.js +5 -0
- package/dist/rename-model.d.ts +1 -1
- package/dist/rename-model.js +3 -7
- package/dist/rename.js +5 -8
- package/dist/rendered-docs.d.ts +64 -0
- package/dist/rendered-docs.js +374 -0
- package/dist/row-host.d.ts +2 -0
- package/dist/row-host.js +11 -3
- package/dist/semantic-delta.d.ts +2 -0
- package/dist/semantic-delta.js +27 -0
- package/dist/semantic-model.js +16 -0
- package/dist/semantic-tokens.d.ts +26 -1
- package/dist/semantic-tokens.js +174 -14
- package/dist/shortcut-keys.d.ts +2 -0
- package/dist/shortcut-keys.js +6 -2
- package/dist/signature.js +1 -1
- package/dist/snippet-field-transforms.d.ts +30 -0
- package/dist/snippet-field-transforms.js +116 -0
- package/dist/snippet-indent.d.ts +2 -0
- package/dist/snippet-indent.js +49 -0
- package/dist/snippet-range-order.d.ts +3 -0
- package/dist/snippet-range-order.js +19 -0
- package/dist/snippet-session.d.ts +42 -6
- package/dist/snippet-session.js +650 -53
- package/dist/snippet-transform-client.d.ts +19 -0
- package/dist/snippet-transform-client.js +66 -0
- package/dist/snippet-transform-format.d.ts +15 -0
- package/dist/snippet-transform-format.js +302 -0
- package/dist/snippet-transform-protocol.d.ts +45 -0
- package/dist/snippet-transform-protocol.js +8 -0
- package/dist/snippet-transform-queue.d.ts +32 -0
- package/dist/snippet-transform-queue.js +173 -0
- package/dist/snippet-transform-worker.d.ts +10 -0
- package/dist/snippet-transform-worker.js +41 -0
- package/dist/snippet-variable-names.d.ts +1 -0
- package/dist/snippet-variable-names.js +36 -0
- package/dist/snippet-variables.d.ts +7 -0
- package/dist/snippet-variables.js +66 -0
- package/dist/snippet.d.ts +30 -3
- package/dist/snippet.js +402 -87
- package/dist/split-alignment.d.ts +6 -0
- package/dist/split-alignment.js +38 -0
- package/dist/split-scroll.d.ts +14 -0
- package/dist/split-scroll.js +45 -0
- package/dist/symbols.d.ts +2 -1
- package/dist/symbols.js +39 -7
- package/dist/testing.d.ts +5 -1
- package/dist/testing.js +12 -0
- package/dist/timers.d.ts +1 -0
- package/dist/timers.js +4 -0
- package/dist/use-panel-body.d.ts +6 -0
- package/dist/use-panel-body.js +13 -0
- package/dist/workspace-edit.d.ts +25 -3
- package/dist/workspace-edit.js +282 -143
- package/package.json +10 -5
- package/src/CallHierarchyPanel.tsx +244 -0
- package/src/CompletionPopup.tsx +12 -1
- package/src/DiffView.tsx +262 -0
- package/src/EditorContextMenu.tsx +1 -0
- package/src/EditorView.tsx +21 -2
- package/src/FindReplace.tsx +51 -13
- package/src/HoverCard.tsx +23 -21
- package/src/LanguagePopups.tsx +5 -0
- package/src/Markdown.tsx +10 -3
- package/src/PanelResizeHandle.tsx +104 -0
- package/src/PeekPanel.tsx +11 -6
- package/src/PickPopup.tsx +18 -2
- package/src/RenameCard.tsx +18 -0
- package/src/RenderedDocs.tsx +155 -0
- package/src/SplitDiffView.tsx +337 -0
- package/src/SymbolPicker.tsx +4 -3
- package/src/call-hierarchy-model.ts +151 -0
- package/src/call-hierarchy.ts +440 -0
- package/src/code-actions-model.ts +17 -11
- package/src/code-actions.ts +3 -1
- package/src/completion-model.ts +61 -35
- package/src/completion.ts +302 -42
- package/src/diagnostics.ts +8 -6
- package/src/diff-expansion.ts +49 -0
- package/src/diff-overlays.tsx +69 -0
- package/src/diff-syntax.ts +67 -0
- package/src/diff-wordmarks.ts +31 -0
- package/src/doc-comment-model.ts +336 -0
- package/src/editor-language.ts +22 -6
- package/src/editor-react.css +79 -0
- package/src/format-on-type.ts +111 -0
- package/src/host-types.ts +23 -0
- package/src/hover.ts +18 -3
- package/src/index.ts +27 -4
- package/src/inlay-hints.ts +394 -18
- package/src/language-ids.ts +4 -2
- package/src/locales/en.json +117 -3
- package/src/locales/nl.json +117 -3
- package/src/models.ts +40 -1
- package/src/panel-size.ts +28 -0
- package/src/patch-decorations.ts +224 -0
- package/src/patch-layout.ts +388 -0
- package/src/peek.ts +6 -1
- package/src/pick.ts +12 -1
- package/src/popups.ts +24 -0
- package/src/project-language.ts +63 -2
- package/src/refresher.ts +6 -0
- package/src/rename-model.ts +4 -8
- package/src/rename.ts +5 -8
- package/src/rendered-docs.ts +430 -0
- package/src/row-host.ts +12 -3
- package/src/semantic-delta.ts +29 -0
- package/src/semantic-model.ts +17 -0
- package/src/semantic-tokens.ts +202 -19
- package/src/shortcut-keys.ts +6 -2
- package/src/signature.ts +1 -1
- package/src/snippet-field-transforms.ts +144 -0
- package/src/snippet-indent.ts +53 -0
- package/src/snippet-range-order.ts +19 -0
- package/src/snippet-session.ts +797 -56
- package/src/snippet-transform-client.ts +84 -0
- package/src/snippet-transform-format.ts +325 -0
- package/src/snippet-transform-protocol.ts +24 -0
- package/src/snippet-transform-queue.ts +199 -0
- package/src/snippet-transform-worker.ts +58 -0
- package/src/snippet-variable-names.ts +36 -0
- package/src/snippet-variables.ts +74 -0
- package/src/snippet.ts +452 -89
- package/src/split-alignment.ts +45 -0
- package/src/split-scroll.ts +54 -0
- package/src/symbols.ts +43 -7
- package/src/testing.ts +25 -0
- package/src/timers.ts +5 -0
- package/src/use-panel-body.ts +17 -0
- package/src/workspace-edit.ts +347 -169
package/dist/locales/nl.json
CHANGED
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"line": "Regel {{line}}",
|
|
10
10
|
"none": "Geen informatie voor deze plek"
|
|
11
11
|
},
|
|
12
|
+
"inlay": {
|
|
13
|
+
"failed": "De actie van de hint is mislukt: {{message}}"
|
|
14
|
+
},
|
|
12
15
|
"edit": {
|
|
13
16
|
"staged_one": "{{count}} bestand gewijzigd en nog niet opgeslagen",
|
|
14
17
|
"staged_other": "{{count}} bestanden gewijzigd en nog niet opgeslagen",
|
|
@@ -30,6 +33,10 @@
|
|
|
30
33
|
"otherFiles_other": "en nog {{count}} bestanden",
|
|
31
34
|
"moves_one": "verplaatst {{count}} bestand",
|
|
32
35
|
"moves_other": "verplaatst {{count}} bestanden",
|
|
36
|
+
"creates_one": "maakt {{count}} bestand aan",
|
|
37
|
+
"creates_other": "maakt {{count}} bestanden aan",
|
|
38
|
+
"deletes_one": "verwijdert {{count}} bestand",
|
|
39
|
+
"deletes_other": "verwijdert {{count}} bestanden",
|
|
33
40
|
"groups": {
|
|
34
41
|
"quickfix": "Quick fix",
|
|
35
42
|
"rewrite": "Herschrijven",
|
|
@@ -56,7 +63,12 @@
|
|
|
56
63
|
"cancel": "Annuleer",
|
|
57
64
|
"apply": "Hernoem",
|
|
58
65
|
"suggestions": "Voorgestelde namen",
|
|
59
|
-
"useSuggestion": "Suggestie gebruiken"
|
|
66
|
+
"useSuggestion": "Suggestie gebruiken",
|
|
67
|
+
"operations": {
|
|
68
|
+
"create": "Maakt aan",
|
|
69
|
+
"rename": "Verplaatst",
|
|
70
|
+
"delete": "Verwijdert"
|
|
71
|
+
}
|
|
60
72
|
},
|
|
61
73
|
"navigation": {
|
|
62
74
|
"unavailable": "Geen language server die dat hier beantwoordt",
|
|
@@ -70,6 +82,9 @@
|
|
|
70
82
|
"symbol": "Overeenkomsten"
|
|
71
83
|
}
|
|
72
84
|
},
|
|
85
|
+
"panel": {
|
|
86
|
+
"resize": "Paneel vergroten of verkleinen"
|
|
87
|
+
},
|
|
73
88
|
"peek": {
|
|
74
89
|
"unavailable": "Geen language server vindt referenties in dit bestand",
|
|
75
90
|
"none": "Geen referenties gevonden",
|
|
@@ -84,6 +99,33 @@
|
|
|
84
99
|
"noDefinition": "Geen definitie gevonden",
|
|
85
100
|
"unavailableDefinition": "Geen language server vindt definities in dit bestand"
|
|
86
101
|
},
|
|
102
|
+
"callHierarchy": {
|
|
103
|
+
"unavailable": "Geen language server vindt aanroepen in dit bestand",
|
|
104
|
+
"none": "Hier is geen symbool met aanroepen gevonden",
|
|
105
|
+
"failed": "Aanroepen opzoeken mislukt: {{message}}",
|
|
106
|
+
"label": "Aanroephiërarchie",
|
|
107
|
+
"direction": "Richting",
|
|
108
|
+
"incoming": "Aanroepers",
|
|
109
|
+
"outgoing": "Aangeroepen",
|
|
110
|
+
"close": "Sluit",
|
|
111
|
+
"loading": "Laden…",
|
|
112
|
+
"noIncoming": "Geen aanroepers",
|
|
113
|
+
"noOutgoing": "Roept niets aan",
|
|
114
|
+
"retry": "Aanroepen laden mislukt: {{message}}. Druk om opnieuw te proberen",
|
|
115
|
+
"more_one": "Toon nog {{formatted}} aanroep ({{hidden}} over)",
|
|
116
|
+
"more_other": "Toon nog {{formatted}} aanroepen ({{hidden}} over)",
|
|
117
|
+
"sites_one": "{{formatted}} aanroep",
|
|
118
|
+
"sites_other": "{{formatted}} aanroepen",
|
|
119
|
+
"site": "Aanroep {{current}} van {{total}}",
|
|
120
|
+
"previousSite": "Vorige aanroep",
|
|
121
|
+
"nextSite": "Volgende aanroep",
|
|
122
|
+
"announce": {
|
|
123
|
+
"incoming_one": "{{count}} aanroeper van {{name}}",
|
|
124
|
+
"incoming_other": "{{count}} aanroepers van {{name}}",
|
|
125
|
+
"outgoing_one": "{{count}} aangeroepen door {{name}}",
|
|
126
|
+
"outgoing_other": "{{count}} aangeroepen door {{name}}"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
87
129
|
"codeVision": {
|
|
88
130
|
"usagesNone": "Niet gebruikt",
|
|
89
131
|
"usages_one": "{{formatted}} keer gebruikt",
|
|
@@ -126,20 +168,65 @@
|
|
|
126
168
|
"copy": "Kopieer",
|
|
127
169
|
"paste": "Plak"
|
|
128
170
|
},
|
|
171
|
+
"snippet": {
|
|
172
|
+
"choices": "Snippetkeuze"
|
|
173
|
+
},
|
|
129
174
|
"completion": {
|
|
175
|
+
"tooLarge": "Deze aanvulling is te groot om in te voegen",
|
|
130
176
|
"insert": "Invoegen",
|
|
131
177
|
"replace": "Vervangen",
|
|
132
178
|
"details": "Details",
|
|
133
|
-
"none": "Geen suggesties"
|
|
179
|
+
"none": "Geen suggesties",
|
|
180
|
+
"transformBusy": "Snippettransformaties zijn bezig; probeer het opnieuw",
|
|
181
|
+
"transformFailed": "Snippettransformatie kon niet worden toegepast"
|
|
134
182
|
},
|
|
135
183
|
"history": {
|
|
136
184
|
"recent": "Recente plekken"
|
|
185
|
+
},
|
|
186
|
+
"announce": {
|
|
187
|
+
"problem": "{{severity}}: {{message}}",
|
|
188
|
+
"severity": {
|
|
189
|
+
"error": "Fout",
|
|
190
|
+
"warning": "Waarschuwing",
|
|
191
|
+
"info": "Informatie",
|
|
192
|
+
"hint": "Hint"
|
|
193
|
+
},
|
|
194
|
+
"field": "Veld {{current}} van {{total}}",
|
|
195
|
+
"fieldChoices_one": "Veld {{current}} van {{total}}, {{count}} keuze",
|
|
196
|
+
"fieldChoices_other": "Veld {{current}} van {{total}}, {{count}} keuzes"
|
|
197
|
+
},
|
|
198
|
+
"fold": {
|
|
199
|
+
"fold": "Regels {{start}} tot {{end}} invouwen",
|
|
200
|
+
"unfold": "Regels {{start}} tot {{end}} uitvouwen"
|
|
201
|
+
},
|
|
202
|
+
"docs": {
|
|
203
|
+
"label": "Weergegeven documentatie",
|
|
204
|
+
"labelNamed": "Weergegeven documentatie: {{- summary}}",
|
|
205
|
+
"render": "Toon weergegeven documentatie",
|
|
206
|
+
"showSource": "Toon bron van documentatie",
|
|
207
|
+
"tags": {
|
|
208
|
+
"deprecated": "Verouderd",
|
|
209
|
+
"template": "Typeparameters",
|
|
210
|
+
"param": "Parameters",
|
|
211
|
+
"property": "Eigenschappen",
|
|
212
|
+
"type": "Type",
|
|
213
|
+
"var": "Variabele",
|
|
214
|
+
"return": "Geeft terug",
|
|
215
|
+
"yield": "Levert op",
|
|
216
|
+
"throws": "Gooit",
|
|
217
|
+
"see": "Zie ook",
|
|
218
|
+
"example": "Voorbeeld",
|
|
219
|
+
"since": "Sinds",
|
|
220
|
+
"version": "Versie",
|
|
221
|
+
"author": "Auteur"
|
|
222
|
+
}
|
|
137
223
|
}
|
|
138
224
|
},
|
|
139
225
|
"commands": {
|
|
140
226
|
"goToDefinition": "Ga naar definitie",
|
|
141
227
|
"goToTypeDefinition": "Ga naar typedefinitie",
|
|
142
228
|
"goToImplementation": "Ga naar implementatie",
|
|
229
|
+
"callHierarchy": "Aanroephiërarchie",
|
|
143
230
|
"peekReferences": "Bekijk referenties",
|
|
144
231
|
"renameSymbol": "Symbool hernoemen",
|
|
145
232
|
"codeActions": "Codeacties",
|
|
@@ -148,6 +235,7 @@
|
|
|
148
235
|
"find": {
|
|
149
236
|
"label": "Zoeken",
|
|
150
237
|
"count": "{{current}} / {{total}}",
|
|
238
|
+
"countLimited": "{{current}} / {{total}}+",
|
|
151
239
|
"none": "Geen resultaten",
|
|
152
240
|
"invalid": "Ongeldige reguliere expressie",
|
|
153
241
|
"caseSensitive": "Hoofdlettergevoelig",
|
|
@@ -166,7 +254,33 @@
|
|
|
166
254
|
"allLabel": "Alles vervangen",
|
|
167
255
|
"preserveCase": "Hoofdletters behouden",
|
|
168
256
|
"toggle": "Vervangen tonen",
|
|
169
|
-
"hide": "Vervangen verbergen"
|
|
257
|
+
"hide": "Vervangen verbergen",
|
|
258
|
+
"failed": {
|
|
259
|
+
"limit": "Te veel om ineens te vervangen ({{edits}} edits of {{characters}} uitvoertekens)",
|
|
260
|
+
"timeout": "Vervangen duurde te lang; de tekst is niet gewijzigd",
|
|
261
|
+
"unavailable": "Vervangen vereist de zoekworker",
|
|
262
|
+
"error": "Vervangen is niet gelukt; de tekst is niet gewijzigd"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"countMore": "{{total}}+ resultaten",
|
|
266
|
+
"searching": "Zoeken…",
|
|
267
|
+
"large": "Groot document: druk op Enter om te zoeken",
|
|
268
|
+
"replaced": "{{count}} resultaten vervangen",
|
|
269
|
+
"failed": {
|
|
270
|
+
"timeout": "Zoeken duurde te lang; druk op Enter om opnieuw te proberen",
|
|
271
|
+
"unavailable": "Zoeken met regex is niet beschikbaar",
|
|
272
|
+
"invalid": "Ongeldige reguliere expressie",
|
|
273
|
+
"error": "Zoeken kon niet worden voltooid"
|
|
170
274
|
}
|
|
275
|
+
},
|
|
276
|
+
"diff": {
|
|
277
|
+
"hidden": "Toon {{count}} verborgen regels",
|
|
278
|
+
"contextLimit": "Limiet voor context bereikt",
|
|
279
|
+
"oldSide": "Voor de wijziging",
|
|
280
|
+
"newSide": "Na de wijziging",
|
|
281
|
+
"noNewline": "Geen afsluitende nieuwe regel",
|
|
282
|
+
"added": "Toegevoegd, nieuwe regel {{number}}",
|
|
283
|
+
"removed": "Verwijderd, oude regel {{number}}",
|
|
284
|
+
"unchanged": "Oude regel {{old}}, nieuwe regel {{new}}"
|
|
171
285
|
}
|
|
172
286
|
}
|
package/dist/models.d.ts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
export { isIdentifierCharacter, identifierPrefix, type MatchDetail, matchDetail, matchScore, editRangeOf, itemsOf, prefixFor, type Ranked, rankCompletions, matchedCharacters, qualifierOf, qualifiersOf, snippetToText, METHOD_KIND, FUNCTION_KIND, CONSTRUCTOR_KIND, CLASS_KIND, SNIPPET_FORMAT, type Insertion, insertionOf, mirroredInsertions, documentationText, completionDocsOf, type KindTone, kindLetterOf, kindToneOf, type RowWindow, rowWindow } from './completion-model.ts';
|
|
1
|
+
export { isIdentifierCharacter, identifierPrefix, type MatchDetail, matchDetail, matchScore, editRangeOf, itemsOf, prefixFor, type Ranked, rankCompletions, matchedCharacters, qualifierOf, qualifiersOf, snippetToText, METHOD_KIND, FUNCTION_KIND, CONSTRUCTOR_KIND, CLASS_KIND, SNIPPET_FORMAT, type Insertion, type SnippetInsertionOptions, insertionOf, mirroredInsertions, documentationText, completionDocsOf, type KindTone, kindLetterOf, kindToneOf, type RowWindow, rowWindow } from './completion-model.ts';
|
|
2
2
|
export { PARAMETER_HINTS_COMMAND, type CallPlan, type CallSite, isCallItem, hasParameters, planCall, withParentheses } from './completion-call.ts';
|
|
3
3
|
export { type Problem, severityOf, markerOf, comparePositions, shiftPosition, shiftRange, rangeHolds, problemsAt, neighborProblem, codeLabelOf } from './diagnostics-model.ts';
|
|
4
4
|
export { type SignatureBlock, type HoverText, splitSignatures, hoverTextOf, isEmptyHover, locationsOf, sameRange, type DocTag, splitDocTags, type HoverSection, type BaselineLevel, type Baseline, docblockMarkdown, type MarkdownPart, markdownParts, hoverSectionsOf } from './hover-content.ts';
|
|
5
5
|
export { type SignatureViewModel, parameterSpan, signatureViewOf } from './signature-model.ts';
|
|
6
6
|
export { wordRangeAt, type RenameTarget, renameTargetOf, type Occurrences, occurrencesOf, type RenameRow, type RenameFile, renameRowsOf, renamePreviewOf } from './rename-model.ts';
|
|
7
7
|
export { type NameRange, type PeekPlace, type PeekFile, PEEK_READ_FILES, peekFilesOf, type PeekSnippet, snippetOf, definitionSnippetOf, distinguishingFolders, visualColumnOf } from './peek-model.ts';
|
|
8
|
+
export { type CallDirection, type CallLoad, type CallNode, type CallRow, CALL_LEVEL_LIMIT, rootsOf, childrenOf, rowsOf, stepsOf, targetOf, statusIdOf, moreIdOf } from './call-hierarchy-model.ts';
|
|
8
9
|
export { type SymbolGroup, SYMBOL_GROUPS, groupOfKind, letterOfKind, type SymbolTone, toneOfKind, type SymbolEntry, entriesOf, scoreOf, filterEntries, type EntryGroup, groupEntries, type PickerMode, modeOf, type WorkspaceEntry, workspaceEntriesOf } from './symbol-picker-model.ts';
|
|
9
10
|
export { SYMBOL_LINK_CLASS, isTypeName, linkTypeNames, declaredNameOf, placesOfName } from './symbol-links.ts';
|
|
10
11
|
export { scopesOf, decodeSemanticTokens } from './semantic-model.ts';
|
|
12
|
+
export { applySemanticEdits } from './semantic-delta.ts';
|
|
11
13
|
export { type ActionGroup, ACTION_GROUPS, REFACTOR_GROUPS, type ActionEntry, groupOf, actionsOf, mergeEntries, isHint, fixableOnLine, diagnosticsAt, type EditPreview, previewOf } from './code-actions-model.ts';
|
|
14
|
+
export { resourceOperationsOf, type ResourceOperationView } from './workspace-edit.ts';
|
|
12
15
|
export { MAX_DECLARATIONS, type CodeVisionDeclaration, type DeclarationSource, startAfterComments, declarationsOf, usagesText } from './code-vision-model.ts';
|
|
13
16
|
export { UNCOMMITTED, mapBlame, type CodeAuthor, type CodeAuthorship, shortName, authorshipOf, authorsText } from './code-authors.ts';
|
|
14
|
-
export { type SnippetStop, type ParsedSnippet, parseSnippet, tabOrder } from './snippet.ts';
|
|
17
|
+
export { type SnippetTransform, type SnippetStop, type SnippetRange, type SnippetField, type SnippetVariableResolver, type SnippetTemplate, compileSnippet, type ParsedSnippet, parseSnippet, tabOrder } from './snippet.ts';
|
|
15
18
|
export { type LineSpan, lineSpanOf, isEmptyRange, inlineRangeOf, type InlineProblem, problemsOnLines, type InlineAnswer, parseAnswer, fitReplacement, endOfInsertion, type DiffSegment, diffSegments, emphasisOf, offsetOf, textInRange, replaceRange, locateSelection } from './proposal-model.ts';
|
|
16
19
|
export { type LineReplacement, replaceLines, replaceAllLines } from './line-edits.ts';
|
|
17
20
|
export { replacedWords } from './word-diff.ts';
|
|
18
21
|
export { type FindOptions, type FindQuery, EMPTY_FIND_QUERY, type TextMatch, type CompiledFind, MATCH_LIMIT, compileFind, matchesIn, stepIndex } from './find-query.ts';
|
|
19
22
|
export { type PopupSize, type PopupPlacement, type PlaceOptions, placePopup, placeBeside } from './popup-placement.ts';
|
|
20
23
|
export { planConflict, type ConflictStretch, type ConflictPlan } from './conflict-model.ts';
|
|
24
|
+
export { patchLayoutOf, DEFAULT_PATCH_LIMITS, type PatchLayout, type PatchLayoutLine, type PatchLineRole, type PatchFileLayout, type PatchFileStatus, type PatchHunkLayout, type PatchLimits } from './patch-layout.ts';
|
package/dist/models.js
CHANGED
|
@@ -5,16 +5,20 @@ export { splitSignatures, hoverTextOf, isEmptyHover, locationsOf, sameRange, spl
|
|
|
5
5
|
export { parameterSpan, signatureViewOf } from './signature-model.js';
|
|
6
6
|
export { wordRangeAt, renameTargetOf, occurrencesOf, renameRowsOf, renamePreviewOf } from './rename-model.js';
|
|
7
7
|
export { PEEK_READ_FILES, peekFilesOf, snippetOf, definitionSnippetOf, distinguishingFolders, visualColumnOf } from './peek-model.js';
|
|
8
|
+
export { CALL_LEVEL_LIMIT, rootsOf, childrenOf, rowsOf, stepsOf, targetOf, statusIdOf, moreIdOf } from './call-hierarchy-model.js';
|
|
8
9
|
export { SYMBOL_GROUPS, groupOfKind, letterOfKind, toneOfKind, entriesOf, scoreOf, filterEntries, groupEntries, modeOf, workspaceEntriesOf } from './symbol-picker-model.js';
|
|
9
10
|
export { SYMBOL_LINK_CLASS, isTypeName, linkTypeNames, declaredNameOf, placesOfName } from './symbol-links.js';
|
|
10
11
|
export { scopesOf, decodeSemanticTokens } from './semantic-model.js';
|
|
12
|
+
export { applySemanticEdits } from './semantic-delta.js';
|
|
11
13
|
export { ACTION_GROUPS, REFACTOR_GROUPS, groupOf, actionsOf, mergeEntries, isHint, fixableOnLine, diagnosticsAt, previewOf } from './code-actions-model.js';
|
|
14
|
+
export { resourceOperationsOf } from './workspace-edit.js';
|
|
12
15
|
export { MAX_DECLARATIONS, startAfterComments, declarationsOf, usagesText } from './code-vision-model.js';
|
|
13
16
|
export { UNCOMMITTED, mapBlame, shortName, authorshipOf, authorsText } from './code-authors.js';
|
|
14
|
-
export { parseSnippet, tabOrder } from './snippet.js';
|
|
17
|
+
export { compileSnippet, parseSnippet, tabOrder } from './snippet.js';
|
|
15
18
|
export { lineSpanOf, isEmptyRange, inlineRangeOf, problemsOnLines, parseAnswer, fitReplacement, endOfInsertion, diffSegments, emphasisOf, offsetOf, textInRange, replaceRange, locateSelection } from './proposal-model.js';
|
|
16
19
|
export { replaceLines, replaceAllLines } from './line-edits.js';
|
|
17
20
|
export { replacedWords } from './word-diff.js';
|
|
18
21
|
export { EMPTY_FIND_QUERY, MATCH_LIMIT, compileFind, matchesIn, stepIndex } from './find-query.js';
|
|
19
22
|
export { placePopup, placeBeside } from './popup-placement.js';
|
|
20
23
|
export { planConflict } from './conflict-model.js';
|
|
24
|
+
export { patchLayoutOf, DEFAULT_PATCH_LIMITS } from './patch-layout.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const PANEL_BODY_HEIGHT = 180;
|
|
2
|
+
export declare const PANEL_BODY_MIN = 88;
|
|
3
|
+
export declare const PANEL_KEY_STEP = 22;
|
|
4
|
+
export declare function panelBodyMax(available: number): number;
|
|
5
|
+
export declare function clampPanelBody(height: number, available?: number): number;
|
|
6
|
+
export declare function availableHeightOf(container: HTMLElement | null): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* The height of the list-and-preview area of a peek or a call hierarchy, which is what a person drags; the bands and the title bar around it stay. */
|
|
2
|
+
export const PANEL_BODY_HEIGHT = 180;
|
|
3
|
+
/* Four rows of 22px, so a list never shrinks to nothing. */
|
|
4
|
+
export const PANEL_BODY_MIN = 88;
|
|
5
|
+
/* What the bands and the title bar take of the panel, which the share of the editor has to leave room for. */
|
|
6
|
+
const PANEL_CHROME = 63;
|
|
7
|
+
/* The share of the editor's height a panel may take, so the line it belongs to stays in view. */
|
|
8
|
+
const PANEL_MAX_SHARE = 0.8;
|
|
9
|
+
const PANEL_FALLBACK_AVAILABLE = 800;
|
|
10
|
+
export const PANEL_KEY_STEP = 22;
|
|
11
|
+
/* The tallest body for an editor that is `available` pixels high; never below the minimum, so a tiny editor still gets a usable panel. */
|
|
12
|
+
export function panelBodyMax(available) {
|
|
13
|
+
return Math.max(PANEL_BODY_MIN, Math.floor(available * PANEL_MAX_SHARE) - PANEL_CHROME);
|
|
14
|
+
}
|
|
15
|
+
export function clampPanelBody(height, available = PANEL_FALLBACK_AVAILABLE) {
|
|
16
|
+
if (!Number.isFinite(height)) {
|
|
17
|
+
return PANEL_BODY_HEIGHT;
|
|
18
|
+
}
|
|
19
|
+
return Math.min(panelBodyMax(available), Math.max(PANEL_BODY_MIN, Math.round(height)));
|
|
20
|
+
}
|
|
21
|
+
/* The height of the editor's scrolling area around a panel's row; the fallback stands in where nothing is laid out. */
|
|
22
|
+
export function availableHeightOf(container) {
|
|
23
|
+
const height = container?.closest('.se-viewport')?.clientHeight ?? 0;
|
|
24
|
+
return height > 0 ? height : PANEL_FALLBACK_AVAILABLE;
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Editor } from '@adecore/editor';
|
|
2
|
+
import { type PatchLayout, type PatchLimits } from './patch-layout.ts';
|
|
3
|
+
export interface PatchLineLabels {
|
|
4
|
+
added(number: number): string;
|
|
5
|
+
removed(number: number): string;
|
|
6
|
+
unchanged(old: number, fresh: number): string;
|
|
7
|
+
}
|
|
8
|
+
export interface PatchDecorationOptions {
|
|
9
|
+
numbers?: 'single' | 'both';
|
|
10
|
+
labels?: PatchLineLabels;
|
|
11
|
+
limits?: PatchLimits;
|
|
12
|
+
onLayout?(layout: PatchLayout): void;
|
|
13
|
+
delay?: number;
|
|
14
|
+
immediateBelow?: number;
|
|
15
|
+
timer?: PatchTimer;
|
|
16
|
+
}
|
|
17
|
+
export interface PatchTimer {
|
|
18
|
+
set(callback: () => void, delay: number): unknown;
|
|
19
|
+
clear(handle: unknown): void;
|
|
20
|
+
}
|
|
21
|
+
export interface PatchDecoration {
|
|
22
|
+
readonly layout: PatchLayout;
|
|
23
|
+
refresh(): void;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function decoratePatch(editor: Editor, options?: PatchDecorationOptions): PatchDecoration;
|
|
27
|
+
export declare function usePatchDecorations(editor: Editor | null, options?: Omit<PatchDecorationOptions, 'labels' | 'onLayout'>): PatchLayout | null;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { patchLayoutOf } from './patch-layout.js';
|
|
4
|
+
const DEFAULT_TIMER = {
|
|
5
|
+
set: (callback, delay) => setTimeout(callback, delay),
|
|
6
|
+
clear: (handle) => clearTimeout(handle)
|
|
7
|
+
};
|
|
8
|
+
const CHANGE_LAYER = 'patch';
|
|
9
|
+
function numberOf(line, numbers, width) {
|
|
10
|
+
if (line.old === null && line.new === null) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
if (numbers === 'single') {
|
|
14
|
+
return String(line.new ?? line.old);
|
|
15
|
+
}
|
|
16
|
+
const pad = (value) => (value === null ? '' : String(value)).padStart(width, ' ');
|
|
17
|
+
return `${pad(line.old)} ${pad(line.new)}`;
|
|
18
|
+
}
|
|
19
|
+
/* Runs of one role become one highlight, so the bar of consecutive changed lines is one stripe. */
|
|
20
|
+
function highlightsOf(layout) {
|
|
21
|
+
const highlights = [];
|
|
22
|
+
const marks = [];
|
|
23
|
+
const lines = layout.lines;
|
|
24
|
+
for (let index = 0; index < lines.length; index++) {
|
|
25
|
+
const role = lines[index].role;
|
|
26
|
+
if (role === 'file-header') {
|
|
27
|
+
highlights.push({ startLine: index + 1, endLine: index + 1, color: '--text-muted', fill: '--surface-raised' });
|
|
28
|
+
}
|
|
29
|
+
else if (role === 'hunk-header') {
|
|
30
|
+
highlights.push({ startLine: index + 1, endLine: index + 1, color: '--accent' });
|
|
31
|
+
}
|
|
32
|
+
else if (role === 'added' || role === 'removed') {
|
|
33
|
+
let end = index;
|
|
34
|
+
while (end + 1 < lines.length && lines[end + 1].role === role) {
|
|
35
|
+
end++;
|
|
36
|
+
}
|
|
37
|
+
const removed = role === 'removed';
|
|
38
|
+
highlights.push({
|
|
39
|
+
startLine: index + 1,
|
|
40
|
+
endLine: end + 1,
|
|
41
|
+
color: removed ? '--editor-deleted' : '--editor-added',
|
|
42
|
+
bar: removed ? 'hatched' : 'solid'
|
|
43
|
+
});
|
|
44
|
+
marks.push({ startLine: index + 1, endLine: end + 1, kind: removed ? 'deleted' : 'added' });
|
|
45
|
+
index = end;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return { highlights, marks };
|
|
49
|
+
}
|
|
50
|
+
/*
|
|
51
|
+
* Draws a patch in the editor the way the diff views draw a change: tinted lines, numbers from the hunk
|
|
52
|
+
* headers in the gutter and styled file and hunk headers. The editor stays editable. A small patch is read
|
|
53
|
+
* again on the microtask after an edit, so its decorations are right within a frame; a large one waits for
|
|
54
|
+
* the edits to rest, and `onLayout` always does. Typing costs one pass over the text (bounded by the limits).
|
|
55
|
+
*/
|
|
56
|
+
export function decoratePatch(editor, options = {}) {
|
|
57
|
+
let layout = patchLayoutOf('', options.limits);
|
|
58
|
+
let pending = false;
|
|
59
|
+
let disposed = false;
|
|
60
|
+
let length = 0;
|
|
61
|
+
let wait = null;
|
|
62
|
+
const timer = options.timer ?? DEFAULT_TIMER;
|
|
63
|
+
const delay = options.delay ?? 150;
|
|
64
|
+
const immediateBelow = options.immediateBelow ?? 100_000;
|
|
65
|
+
const clearWait = () => {
|
|
66
|
+
if (wait !== null) {
|
|
67
|
+
timer.clear(wait);
|
|
68
|
+
wait = null;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const after = (callback) => {
|
|
72
|
+
clearWait();
|
|
73
|
+
wait = timer.set(() => {
|
|
74
|
+
wait = null;
|
|
75
|
+
callback();
|
|
76
|
+
}, delay);
|
|
77
|
+
};
|
|
78
|
+
const apply = () => {
|
|
79
|
+
const numbers = options.numbers ?? 'single';
|
|
80
|
+
const lines = layout.lines;
|
|
81
|
+
const width = lines.reduce((digits, line) => Math.max(digits, String(Math.max(line.old ?? 0, line.new ?? 0)).length), 1);
|
|
82
|
+
editor.setLineNumbers((line) => {
|
|
83
|
+
const entry = lines[line];
|
|
84
|
+
return entry === undefined ? null : numberOf(entry, numbers, width);
|
|
85
|
+
});
|
|
86
|
+
const labels = options.labels;
|
|
87
|
+
editor.setLineLabels(labels === undefined
|
|
88
|
+
? null
|
|
89
|
+
: (line) => {
|
|
90
|
+
const entry = lines[line];
|
|
91
|
+
if (entry?.role === 'removed') {
|
|
92
|
+
return labels.removed(entry.old);
|
|
93
|
+
}
|
|
94
|
+
if (entry?.role === 'added') {
|
|
95
|
+
return labels.added(entry.new);
|
|
96
|
+
}
|
|
97
|
+
return entry?.role === 'context' ? labels.unchanged(entry.old, entry.new) : null;
|
|
98
|
+
});
|
|
99
|
+
const { highlights, marks } = highlightsOf(layout);
|
|
100
|
+
editor.setLineHighlights(highlights);
|
|
101
|
+
editor.setChangeMarks(marks, CHANGE_LAYER);
|
|
102
|
+
};
|
|
103
|
+
const decorate = () => {
|
|
104
|
+
pending = false;
|
|
105
|
+
if (disposed) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const text = editor.getText();
|
|
109
|
+
length = text.length;
|
|
110
|
+
layout = patchLayoutOf(text, options.limits);
|
|
111
|
+
apply();
|
|
112
|
+
};
|
|
113
|
+
const announce = () => {
|
|
114
|
+
if (!disposed) {
|
|
115
|
+
options.onLayout?.(layout);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const read = () => {
|
|
119
|
+
clearWait();
|
|
120
|
+
decorate();
|
|
121
|
+
announce();
|
|
122
|
+
};
|
|
123
|
+
const schedule = () => {
|
|
124
|
+
if (length < immediateBelow) {
|
|
125
|
+
if (pending) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
pending = true;
|
|
129
|
+
queueMicrotask(() => {
|
|
130
|
+
decorate();
|
|
131
|
+
after(announce);
|
|
132
|
+
});
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
pending = true;
|
|
136
|
+
after(() => {
|
|
137
|
+
decorate();
|
|
138
|
+
announce();
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
const stop = editor.onTextChange(schedule);
|
|
142
|
+
read();
|
|
143
|
+
return {
|
|
144
|
+
get layout() {
|
|
145
|
+
return layout;
|
|
146
|
+
},
|
|
147
|
+
refresh: read,
|
|
148
|
+
dispose() {
|
|
149
|
+
disposed = true;
|
|
150
|
+
clearWait();
|
|
151
|
+
stop();
|
|
152
|
+
editor.setLineNumbers(null);
|
|
153
|
+
editor.setLineLabels(null);
|
|
154
|
+
editor.setLineHighlights([]);
|
|
155
|
+
editor.setChangeMarks([], CHANGE_LAYER);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/* Decorates a mounted editor as a patch for as long as it stands, in the editor namespace's words, and returns the layout for a file tree. */
|
|
160
|
+
export function usePatchDecorations(editor, options = {}) {
|
|
161
|
+
const { t } = useTranslation('editor');
|
|
162
|
+
const [state, setState] = useState(null);
|
|
163
|
+
const { numbers } = options;
|
|
164
|
+
const { maxLines, maxCharacters } = options.limits ?? {};
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (editor === null) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const decoration = decoratePatch(editor, {
|
|
170
|
+
...(numbers === undefined ? {} : { numbers }),
|
|
171
|
+
limits: { ...(maxLines === undefined ? {} : { maxLines }), ...(maxCharacters === undefined ? {} : { maxCharacters }) },
|
|
172
|
+
labels: {
|
|
173
|
+
added: (number) => t('diff.added', { number }),
|
|
174
|
+
removed: (number) => t('diff.removed', { number }),
|
|
175
|
+
unchanged: (old, fresh) => t('diff.unchanged', { old, new: fresh })
|
|
176
|
+
},
|
|
177
|
+
onLayout: (layout) => setState({ editor, layout })
|
|
178
|
+
});
|
|
179
|
+
return () => decoration.dispose();
|
|
180
|
+
}, [editor, numbers, maxLines, maxCharacters, t]);
|
|
181
|
+
return state !== null && state.editor === editor ? state.layout : null;
|
|
182
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type PatchLineRole = 'file-header' | 'hunk-header' | 'context' | 'added' | 'removed' | 'no-newline' | 'binary' | 'other';
|
|
2
|
+
export type PatchFileStatus = 'added' | 'deleted' | 'renamed' | 'copied' | 'modified' | 'binary';
|
|
3
|
+
export interface PatchLayoutLine {
|
|
4
|
+
readonly role: PatchLineRole;
|
|
5
|
+
readonly old: number | null;
|
|
6
|
+
readonly new: number | null;
|
|
7
|
+
}
|
|
8
|
+
export interface PatchHunkLayout {
|
|
9
|
+
readonly line: number;
|
|
10
|
+
readonly oldStart: number;
|
|
11
|
+
readonly oldCount: number;
|
|
12
|
+
readonly newStart: number;
|
|
13
|
+
readonly newCount: number;
|
|
14
|
+
readonly section: string;
|
|
15
|
+
readonly consistent: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface PatchFileLayout {
|
|
18
|
+
readonly oldPath: string | null;
|
|
19
|
+
readonly newPath: string | null;
|
|
20
|
+
readonly status: PatchFileStatus;
|
|
21
|
+
readonly firstLine: number;
|
|
22
|
+
readonly lastLine: number;
|
|
23
|
+
readonly added: number;
|
|
24
|
+
readonly removed: number;
|
|
25
|
+
readonly hunks: readonly PatchHunkLayout[];
|
|
26
|
+
}
|
|
27
|
+
export interface PatchLayout {
|
|
28
|
+
readonly lines: readonly PatchLayoutLine[];
|
|
29
|
+
readonly files: readonly PatchFileLayout[];
|
|
30
|
+
readonly truncated: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface PatchLimits {
|
|
33
|
+
readonly maxLines?: number;
|
|
34
|
+
readonly maxCharacters?: number;
|
|
35
|
+
}
|
|
36
|
+
export declare const DEFAULT_PATCH_LIMITS: {
|
|
37
|
+
readonly maxLines: 50000;
|
|
38
|
+
readonly maxCharacters: 4000000;
|
|
39
|
+
};
|
|
40
|
+
export declare function patchLayoutOf(text: string, limits?: PatchLimits): PatchLayout;
|