@adecore/editor-react 0.31.12 → 0.32.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.
Files changed (137) hide show
  1. package/dist/AnchoredPopup.js +73 -19
  2. package/dist/AttributionCard.js +162 -4
  3. package/dist/BaselineStatus.js +62 -8
  4. package/dist/CallHierarchyPanel.js +977 -60
  5. package/dist/ChangeReview.js +76 -25
  6. package/dist/CodeAuthorsCard.js +314 -14
  7. package/dist/CompletionPopup.js +490 -83
  8. package/dist/DiffView.js +548 -181
  9. package/dist/EditorContextMenu.js +352 -34
  10. package/dist/EditorView.js +276 -99
  11. package/dist/FindReplace.js +525 -67
  12. package/dist/HoverCard.js +378 -38
  13. package/dist/HoverSections.js +367 -56
  14. package/dist/LanguagePopups.js +95 -34
  15. package/dist/Markdown.js +41 -6
  16. package/dist/PanelResizeHandle.js +199 -66
  17. package/dist/PathText.js +49 -7
  18. package/dist/PeekPanel.js +675 -72
  19. package/dist/PickPopup.js +304 -34
  20. package/dist/RenameCard.js +679 -85
  21. package/dist/RenderedDocs.js +329 -58
  22. package/dist/SignatureCard.js +91 -7
  23. package/dist/SplitDiffView.js +344 -254
  24. package/dist/SymbolPicker.js +440 -85
  25. package/dist/call-hierarchy-model.js +102 -68
  26. package/dist/call-hierarchy.js +458 -359
  27. package/dist/code-actions-model.js +88 -76
  28. package/dist/code-actions.js +372 -283
  29. package/dist/code-authors.js +64 -55
  30. package/dist/code-vision-model.js +134 -127
  31. package/dist/code-vision.js +224 -206
  32. package/dist/completion-call.js +94 -67
  33. package/dist/completion-model.js +334 -244
  34. package/dist/completion.js +840 -649
  35. package/dist/conflict-model.js +35 -29
  36. package/dist/context-menu-rows.js +42 -17
  37. package/dist/context-menu.js +64 -46
  38. package/dist/definition-link.js +88 -85
  39. package/dist/diagnostics-model.js +74 -55
  40. package/dist/diagnostics.js +121 -100
  41. package/dist/diff-expansion.js +38 -35
  42. package/dist/diff-overlays.js +144 -22
  43. package/dist/diff-syntax.js +65 -42
  44. package/dist/diff-wordmarks.js +26 -23
  45. package/dist/doc-comment-model.js +265 -216
  46. package/dist/editor-language.js +177 -152
  47. package/dist/error-message.js +2 -2
  48. package/dist/find-query.js +49 -36
  49. package/dist/folding.js +81 -62
  50. package/dist/format-on-type.js +86 -67
  51. package/dist/highlight-layers.js +19 -20
  52. package/dist/highlights.js +105 -83
  53. package/dist/history.js +44 -38
  54. package/dist/holder.js +18 -18
  55. package/dist/host-types.js +1 -1
  56. package/dist/hover-content.js +167 -129
  57. package/dist/hover.js +285 -245
  58. package/dist/index.js +10 -10
  59. package/dist/inlay-hints.js +369 -324
  60. package/dist/key-priority.js +34 -31
  61. package/dist/language-ids.js +45 -42
  62. package/dist/line-edits.js +74 -28
  63. package/dist/line-text.js +18 -3
  64. package/dist/locales/en.json +38 -38
  65. package/dist/locales/nl.json +41 -41
  66. package/dist/models.js +1 -1
  67. package/dist/navigation-history.js +40 -41
  68. package/dist/navigation.js +141 -123
  69. package/dist/panel-size.js +8 -8
  70. package/dist/patch-decorations.js +236 -160
  71. package/dist/patch-layout.js +331 -262
  72. package/dist/paths.js +3 -3
  73. package/dist/peek-model.js +86 -69
  74. package/dist/peek.js +254 -192
  75. package/dist/pick.js +164 -157
  76. package/dist/popup-focus.js +5 -5
  77. package/dist/popup-placement.js +36 -21
  78. package/dist/popups.js +13 -13
  79. package/dist/project-language.js +228 -211
  80. package/dist/project-problems.js +81 -69
  81. package/dist/proposal-model.js +163 -126
  82. package/dist/recent-choices.js +25 -25
  83. package/dist/refresher.js +44 -49
  84. package/dist/rename-model.js +113 -113
  85. package/dist/rename.js +321 -233
  86. package/dist/rendered-docs.d.ts +4 -2
  87. package/dist/rendered-docs.js +384 -318
  88. package/dist/rendering-context.js +5 -3
  89. package/dist/rendering.js +22 -4
  90. package/dist/review-group.js +42 -39
  91. package/dist/row-host.d.ts +4 -2
  92. package/dist/row-host.js +90 -78
  93. package/dist/selection-ranges.js +21 -17
  94. package/dist/semantic-delta.js +22 -19
  95. package/dist/semantic-model.js +86 -73
  96. package/dist/semantic-tokens.js +201 -162
  97. package/dist/shortcut-keys.js +16 -10
  98. package/dist/signature-model.js +34 -28
  99. package/dist/signature.js +177 -129
  100. package/dist/snippet-field-transforms.js +118 -106
  101. package/dist/snippet-indent.js +48 -43
  102. package/dist/snippet-range-order.js +11 -11
  103. package/dist/snippet-session.js +703 -667
  104. package/dist/snippet-transform-client.js +59 -59
  105. package/dist/snippet-transform-format.js +285 -263
  106. package/dist/snippet-transform-protocol.js +1 -1
  107. package/dist/snippet-transform-queue.js +163 -153
  108. package/dist/snippet-transform-worker.js +42 -35
  109. package/dist/snippet-variable-names.js +1 -36
  110. package/dist/snippet-variables.js +53 -63
  111. package/dist/snippet.js +477 -405
  112. package/dist/split-alignment.js +47 -35
  113. package/dist/split-scroll.js +42 -40
  114. package/dist/symbol-links.js +33 -25
  115. package/dist/symbol-picker-model.js +126 -116
  116. package/dist/symbol-picker.js +98 -59
  117. package/dist/symbols.js +117 -88
  118. package/dist/testing.js +248 -165
  119. package/dist/timers.js +35 -30
  120. package/dist/use-panel-body.js +49 -8
  121. package/dist/use-problem-counts.js +29 -15
  122. package/dist/view-state.js +54 -33
  123. package/dist/word-diff.js +18 -18
  124. package/dist/workspace-edit.js +300 -249
  125. package/package.json +6 -6
  126. package/src/CallHierarchyPanel.tsx +2 -2
  127. package/src/DiffView.tsx +3 -3
  128. package/src/FindReplace.tsx +2 -2
  129. package/src/LanguagePopups.tsx +2 -0
  130. package/src/PeekPanel.tsx +3 -3
  131. package/src/RenderedDocs.tsx +9 -10
  132. package/src/SymbolPicker.tsx +2 -2
  133. package/src/diff-overlays.tsx +6 -4
  134. package/src/locales/en.json +38 -38
  135. package/src/locales/nl.json +41 -41
  136. package/src/rendered-docs.ts +14 -3
  137. package/src/row-host.ts +14 -3
@@ -1,5 +1,5 @@
1
1
  function endpointKey(namespace, path) {
2
- return `${namespace}:${path}`;
2
+ return `${namespace}:${path}`;
3
3
  }
4
4
  /* Where each file's editor was when it went, so switching tabs or a node scrolling back into view opens it there again. Per window, never stored. */
5
5
  export const viewStates = new Map();
@@ -9,22 +9,37 @@ export const viewStates = new Map();
9
9
  * whichever way it opens.
10
10
  */
11
11
  export function openingPlace(reveal, last, placeholderScroll, foldDefaults) {
12
- const folds = last === undefined ? { foldDefaults } : { folds: last.folds };
13
- if (reveal !== null) {
14
- return { line: reveal.line, ...folds };
15
- }
16
- if (last !== undefined) {
17
- return { line: last.line, column: last.column, scrollTop: last.scrollTop, ...folds };
18
- }
19
- return { scrollTop: placeholderScroll, ...folds };
12
+ const folds = last === undefined ? {
13
+ foldDefaults
14
+ } : {
15
+ folds: last.folds
16
+ };
17
+ if (reveal !== null) {
18
+ return {
19
+ line: reveal.line,
20
+ ...folds
21
+ };
22
+ }
23
+ if (last !== undefined) {
24
+ return {
25
+ line: last.line,
26
+ column: last.column,
27
+ scrollTop: last.scrollTop,
28
+ ...folds
29
+ };
30
+ }
31
+ return {
32
+ scrollTop: placeholderScroll,
33
+ ...folds
34
+ };
20
35
  }
21
36
  /* Where a place the editors know by the key it had goes now: a file, or the files of a folder that moved. */
22
37
  const moves = [];
23
38
  function movedKey(key, from, to) {
24
- if (key === from) {
25
- return to;
26
- }
27
- return key.startsWith(`${from}/`) ? `${to}${key.slice(from.length)}` : null;
39
+ if (key === from) {
40
+ return to;
41
+ }
42
+ return key.startsWith(`${from}/`) ? `${to}${key.slice(from.length)}` : null;
28
43
  }
29
44
  /*
30
45
  * A file or folder moved, so where its editors were follows it. An editor that is still open writes its place once
@@ -32,32 +47,38 @@ function movedKey(key, from, to) {
32
47
  * old path forgets the move.
33
48
  */
34
49
  export function followViewStates(endpointId, from, to) {
35
- const oldKey = endpointKey(endpointId, from);
36
- const newKey = endpointKey(endpointId, to);
37
- for (const [key, state] of [...viewStates]) {
38
- const target = movedKey(key, oldKey, newKey);
39
- if (target !== null) {
40
- viewStates.delete(key);
41
- viewStates.set(target, state);
42
- }
50
+ const oldKey = endpointKey(endpointId, from);
51
+ const newKey = endpointKey(endpointId, to);
52
+ for (const [key, state] of [...viewStates]) {
53
+ const target = movedKey(key, oldKey, newKey);
54
+ if (target !== null) {
55
+ viewStates.delete(key);
56
+ viewStates.set(target, state);
43
57
  }
44
- moves.push({ from: oldKey, to: newKey });
58
+ }
59
+ moves.push({
60
+ from: oldKey,
61
+ to: newKey
62
+ });
45
63
  }
46
64
  /* The key an editor that mounted under `key` leaves its place under. */
47
65
  export function viewStateKey(key) {
48
- for (const { from, to } of moves) {
49
- const target = movedKey(key, from, to);
50
- if (target !== null) {
51
- return target;
52
- }
66
+ for (const {
67
+ from,
68
+ to
69
+ } of moves) {
70
+ const target = movedKey(key, from, to);
71
+ if (target !== null) {
72
+ return target;
53
73
  }
54
- return key;
74
+ }
75
+ return key;
55
76
  }
56
77
  /* An editor mounts under `key`, which is a file of its own again whatever moved away from there. */
57
78
  export function forgetMovesFrom(key) {
58
- for (let i = moves.length - 1; i >= 0; i--) {
59
- if (movedKey(key, moves[i].from, moves[i].to) !== null) {
60
- moves.splice(i, 1);
61
- }
79
+ for (let i = moves.length - 1; i >= 0; i--) {
80
+ if (movedKey(key, moves[i].from, moves[i].to) !== null) {
81
+ moves.splice(i, 1);
62
82
  }
63
- }
83
+ }
84
+ }
package/dist/word-diff.js CHANGED
@@ -6,25 +6,25 @@ const TOKEN = /\w+|\s+|[^\w\s]/g;
6
6
  * many were added as removed; any other change has no pairing and marks no words.
7
7
  */
8
8
  export function replacedWords(removed, added) {
9
- return removed.map((line, index) => (removed.length === added.length ? replacedRanges(line, added[index]) : []));
9
+ return removed.map((line, index) => removed.length === added.length ? replacedRanges(line, added[index]) : []);
10
10
  }
11
11
  function replacedRanges(removed, added) {
12
- const before = removed.match(TOKEN) ?? [];
13
- const after = added.match(TOKEN) ?? [];
14
- const starts = [];
15
- let offset = 0;
16
- for (const token of before) {
17
- starts.push(offset);
18
- offset += token.length;
19
- }
12
+ const before = removed.match(TOKEN) ?? [];
13
+ const after = added.match(TOKEN) ?? [];
14
+ const starts = [];
15
+ let offset = 0;
16
+ for (const token of before) {
20
17
  starts.push(offset);
21
- const ranges = [];
22
- for (const change of diffLines(before, after)) {
23
- const text = removed.slice(starts[change.baseStart], starts[change.baseEnd]);
24
- if (text.trim() !== '') {
25
- const start = starts[change.baseStart] + (text.length - text.trimStart().length);
26
- ranges.push([start, start + text.trim().length]);
27
- }
18
+ offset += token.length;
19
+ }
20
+ starts.push(offset);
21
+ const ranges = [];
22
+ for (const change of diffLines(before, after)) {
23
+ const text = removed.slice(starts[change.baseStart], starts[change.baseEnd]);
24
+ if (text.trim() !== '') {
25
+ const start = starts[change.baseStart] + (text.length - text.trimStart().length);
26
+ ranges.push([start, start + text.trim().length]);
28
27
  }
29
- return ranges;
30
- }
28
+ }
29
+ return ranges;
30
+ }