@adecore/editor-react 0.62.1 → 0.63.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/README.md +2 -2
- package/dist/AnchoredPopup.d.ts +2 -1
- package/dist/CompletionPopup.js +0 -2
- package/dist/DiffView.d.ts +1 -28
- package/dist/EditorView.js +0 -1
- package/dist/HoverSections.d.ts +1 -8
- package/dist/HoverSections.js +2 -2
- package/dist/LanguagePopups.js +30 -14
- package/dist/PanelResizeHandle.js +0 -1
- package/dist/PeekPanel.js +0 -1
- package/dist/PickPopup.js +0 -1
- package/dist/RenderedDocs.js +0 -2
- package/dist/SplitDiffView.d.ts +1 -1
- package/dist/SymbolPicker.js +0 -1
- package/dist/call-hierarchy-model.js +0 -4
- package/dist/call-hierarchy.d.ts +9 -2
- package/dist/call-hierarchy.js +51 -67
- package/dist/clipboard-history.d.ts +3 -0
- package/dist/clipboard-history.js +0 -1
- package/dist/code-actions-model.js +1 -1
- package/dist/code-actions.d.ts +14 -2
- package/dist/code-actions.js +14 -9
- package/dist/code-authors.js +4 -12
- package/dist/code-vision-model.d.ts +0 -1
- package/dist/code-vision-model.js +1 -2
- package/dist/code-vision.d.ts +11 -3
- package/dist/code-vision.js +13 -18
- package/dist/completion-call.d.ts +1 -1
- package/dist/completion-call.js +2 -1
- package/dist/completion-model.d.ts +5 -4
- package/dist/completion-model.js +4 -4
- package/dist/completion.d.ts +13 -4
- package/dist/completion.js +19 -18
- package/dist/context-menu-rows.d.ts +2 -1
- package/dist/context-menu.d.ts +9 -3
- package/dist/context-menu.js +17 -19
- package/dist/definition-link.d.ts +8 -2
- package/dist/definition-link.js +4 -2
- package/dist/diagnostics-model.d.ts +6 -8
- package/dist/diagnostics-model.js +1 -54
- package/dist/diagnostics.d.ts +9 -7
- package/dist/diagnostics.js +6 -4
- package/dist/diff-view-props.d.ts +28 -0
- package/dist/diff-view-props.js +1 -0
- package/dist/doc-comment-model.js +0 -2
- package/dist/document-colors.d.ts +9 -4
- package/dist/document-colors.js +7 -4
- package/dist/document-links.d.ts +2 -3
- package/dist/document-links.js +2 -3
- package/dist/document-query.d.ts +2 -2
- package/dist/edit-locations.js +4 -22
- package/dist/editor-language.d.ts +12 -7
- package/dist/editor-language.js +54 -45
- package/dist/emmet.d.ts +3 -2
- package/dist/folding.d.ts +2 -4
- package/dist/folding.js +1 -2
- package/dist/format-on-type.d.ts +8 -2
- package/dist/format-on-type.js +8 -6
- package/dist/highlights.d.ts +2 -6
- package/dist/highlights.js +3 -3
- package/dist/history.d.ts +8 -2
- package/dist/history.js +4 -2
- package/dist/host-types.d.ts +39 -22
- package/dist/hover-content.js +0 -1
- package/dist/hover.d.ts +13 -2
- package/dist/hover.js +25 -28
- package/dist/index.d.ts +19 -9
- package/dist/index.js +5 -2
- package/dist/inlay-hints.d.ts +12 -21
- package/dist/inlay-hints.js +16 -15
- package/dist/inline-completion.d.ts +30 -10
- package/dist/inline-completion.js +346 -102
- package/dist/key-priority.d.ts +1 -1
- package/dist/key-priority.js +2 -2
- package/dist/language-context.d.ts +30 -0
- package/dist/language-context.js +1 -0
- package/dist/language-ids.d.ts +0 -1
- package/dist/language-ids.js +0 -32
- package/dist/line-text.js +0 -1
- package/dist/linked-editing.d.ts +2 -4
- package/dist/linked-editing.js +1 -3
- package/dist/live-templates.d.ts +14 -2
- package/dist/live-templates.js +15 -10
- package/dist/locales/en.d.ts +357 -0
- package/dist/locales/en.js +356 -0
- package/dist/locales/nl.d.ts +357 -0
- package/dist/locales/nl.js +356 -0
- package/dist/markup-context.d.ts +7 -6
- package/dist/markup-context.js +0 -1
- package/dist/markup.d.ts +8 -2
- package/dist/markup.js +19 -20
- package/dist/models.d.ts +2 -1
- package/dist/models.js +2 -1
- package/dist/navigation-history.d.ts +7 -0
- package/dist/navigation.d.ts +11 -8
- package/dist/navigation.js +9 -20
- package/dist/panel-size.d.ts +4 -0
- package/dist/paste-history.d.ts +8 -2
- package/dist/paste-history.js +4 -2
- package/dist/patch-layout.d.ts +0 -4
- package/dist/patch-layout.js +1 -1
- package/dist/peek-model.js +0 -1
- package/dist/peek.d.ts +8 -2
- package/dist/peek.js +31 -42
- package/dist/pick.d.ts +4 -2
- package/dist/pick.js +38 -15
- package/dist/popups.d.ts +25 -20
- package/dist/popups.js +31 -15
- package/dist/positions.d.ts +7 -0
- package/dist/positions.js +54 -0
- package/dist/postfix.d.ts +11 -2
- package/dist/postfix.js +10 -6
- package/dist/project-language.d.ts +11 -3
- package/dist/project-language.js +40 -9
- package/dist/project-problems.d.ts +7 -1
- package/dist/project-problems.js +2 -1
- package/dist/rename-model.js +1 -1
- package/dist/rename.d.ts +2 -2
- package/dist/rename.js +17 -22
- package/dist/rendered-docs.d.ts +8 -2
- package/dist/rendered-docs.js +5 -4
- package/dist/selection-ranges.d.ts +2 -2
- package/dist/semantic-tokens.d.ts +2 -4
- package/dist/semantic-tokens.js +2 -2
- package/dist/shortcut-keys.d.ts +2 -1
- package/dist/signature.d.ts +2 -2
- package/dist/signature.js +9 -15
- package/dist/snippet-field-transforms.js +1 -1
- package/dist/snippet-insert.d.ts +4 -2
- package/dist/snippet-insert.js +9 -15
- package/dist/snippet-session.d.ts +9 -4
- package/dist/snippet-session.js +14 -14
- package/dist/snippet-transform-format.d.ts +2 -1
- package/dist/snippet-transform-queue.d.ts +2 -4
- package/dist/snippet-transform-queue.js +5 -37
- package/dist/snippet.d.ts +2 -1
- package/dist/surround-constructs.d.ts +1 -1
- package/dist/surround.d.ts +13 -2
- package/dist/surround.js +15 -8
- package/dist/symbol-links.d.ts +0 -1
- package/dist/symbol-links.js +1 -1
- package/dist/symbol-picker-model.d.ts +0 -1
- package/dist/symbol-picker-model.js +1 -2
- package/dist/symbol-picker.d.ts +2 -2
- package/dist/symbol-picker.js +5 -10
- package/dist/symbols.d.ts +4 -3
- package/dist/template-builtins.d.ts +1 -1
- package/dist/template-builtins.js +0 -1
- package/dist/template-context.d.ts +3 -3
- package/dist/template-context.js +2 -11
- package/dist/template-types.d.ts +20 -0
- package/dist/template-types.js +1 -0
- package/dist/templates.d.ts +5 -20
- package/dist/templates.js +0 -1
- package/dist/testing.d.ts +6 -0
- package/dist/testing.js +42 -0
- package/dist/use-problem-counts.d.ts +1 -1
- package/dist/word-diff.d.ts +1 -1
- package/dist/word-diff.js +16 -25
- package/dist/workspace-edit.d.ts +1 -24
- package/dist/workspace-edit.js +0 -1
- package/package.json +10 -9
- package/src/AnchoredPopup.tsx +1 -1
- package/src/CompletionPopup.tsx +0 -2
- package/src/DiffView.tsx +6 -38
- package/src/EditorView.tsx +0 -1
- package/src/HoverSections.tsx +2 -2
- package/src/LanguagePopups.tsx +20 -14
- package/src/PanelResizeHandle.tsx +0 -1
- package/src/PeekPanel.tsx +0 -1
- package/src/PickPopup.tsx +0 -1
- package/src/RenderedDocs.tsx +0 -2
- package/src/SplitDiffView.tsx +1 -1
- package/src/SymbolPicker.tsx +0 -1
- package/src/call-hierarchy-model.ts +0 -7
- package/src/call-hierarchy.ts +32 -31
- package/src/clipboard-history.ts +5 -2
- package/src/code-actions-model.ts +1 -4
- package/src/code-actions.ts +26 -10
- package/src/code-authors.ts +4 -15
- package/src/code-vision-model.ts +1 -2
- package/src/code-vision.ts +23 -19
- package/src/completion-call.ts +2 -2
- package/src/completion-model.ts +12 -7
- package/src/completion.ts +31 -16
- package/src/context-menu-rows.ts +1 -1
- package/src/context-menu.ts +19 -10
- package/src/definition-link.ts +12 -4
- package/src/diagnostics-model.ts +8 -55
- package/src/diagnostics.ts +11 -20
- package/src/diff-view-props.ts +38 -0
- package/src/doc-comment-model.ts +0 -2
- package/src/document-colors.ts +14 -6
- package/src/document-links.ts +5 -6
- package/src/document-query.ts +3 -3
- package/src/edit-locations.ts +4 -19
- package/src/editor-language.ts +74 -39
- package/src/emmet.ts +2 -3
- package/src/folding.ts +4 -5
- package/src/format-on-type.ts +14 -7
- package/src/highlights.ts +6 -6
- package/src/history.ts +12 -4
- package/src/host-types.ts +52 -33
- package/src/hover-content.ts +0 -1
- package/src/hover.ts +29 -22
- package/src/index.ts +25 -14
- package/src/inlay-hints.ts +23 -17
- package/src/inline-completion.ts +340 -90
- package/src/key-priority.ts +2 -2
- package/src/language-context.ts +60 -0
- package/src/language-ids.ts +0 -34
- package/src/line-text.ts +0 -1
- package/src/linked-editing.ts +4 -6
- package/src/live-templates.ts +27 -13
- package/src/locales/en.ts +356 -0
- package/src/locales/nl.ts +356 -0
- package/src/markup-context.ts +6 -9
- package/src/markup.ts +19 -10
- package/src/models.ts +2 -1
- package/src/navigation-history.ts +11 -0
- package/src/navigation.ts +18 -20
- package/src/panel-size.ts +8 -0
- package/src/paste-history.ts +12 -4
- package/src/patch-layout.ts +1 -1
- package/src/peek-model.ts +0 -1
- package/src/peek.ts +22 -18
- package/src/pick.ts +30 -16
- package/src/popups.ts +61 -40
- package/src/positions.ts +54 -0
- package/src/postfix.ts +21 -8
- package/src/project-language.ts +63 -14
- package/src/project-problems.ts +10 -2
- package/src/proposal-model.ts +0 -1
- package/src/rename-model.ts +1 -1
- package/src/rename.ts +21 -24
- package/src/rendered-docs.ts +13 -6
- package/src/selection-ranges.ts +2 -2
- package/src/semantic-tokens.ts +5 -5
- package/src/shortcut-keys.ts +1 -1
- package/src/signature.ts +8 -8
- package/src/snippet-field-transforms.ts +1 -1
- package/src/snippet-insert.ts +21 -14
- package/src/snippet-session.ts +25 -24
- package/src/snippet-transform-format.ts +1 -1
- package/src/snippet-transform-queue.ts +5 -51
- package/src/snippet.ts +1 -1
- package/src/surround-constructs.ts +1 -1
- package/src/surround.ts +24 -12
- package/src/symbol-links.ts +1 -1
- package/src/symbol-picker-model.ts +1 -4
- package/src/symbol-picker.ts +6 -7
- package/src/symbols.ts +3 -4
- package/src/template-builtins.ts +1 -2
- package/src/template-context.ts +5 -14
- package/src/template-types.ts +43 -0
- package/src/templates.ts +9 -45
- package/src/testing.ts +52 -0
- package/src/use-problem-counts.ts +1 -1
- package/src/word-diff.ts +17 -28
- package/src/workspace-edit.ts +1 -34
- package/dist/locales/en.json +0 -356
- package/dist/locales/nl.json +0 -356
- package/src/locales/en.json +0 -356
- package/src/locales/nl.json +0 -356
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ bun add @adecore/editor-react
|
|
|
24
24
|
@source "../node_modules/@adecore/editor-react/dist";
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Add `@adecore/editor-react/locales/en
|
|
27
|
+
Add `@adecore/editor-react/locales/en` and `nl` to i18next as the `editor` namespace, then:
|
|
28
28
|
|
|
29
29
|
```tsx
|
|
30
30
|
import { EditorView, ProjectLanguage } from '@adecore/editor-react';
|
|
@@ -42,7 +42,7 @@ const project = new ProjectLanguage(service, { folder, keymap, openPlace, files,
|
|
|
42
42
|
| `@adecore/editor-react/models` | The pure models, without React |
|
|
43
43
|
| `@adecore/editor-react/testing` | `FakeLanguageService` and `ManualTimers` |
|
|
44
44
|
| `@adecore/editor-react/editor-react.css` | The styles of the cards |
|
|
45
|
-
| `@adecore/editor-react/locales
|
|
45
|
+
| `@adecore/editor-react/locales/*` | The words, in English and Dutch |
|
|
46
46
|
|
|
47
47
|
## Documentation
|
|
48
48
|
|
package/dist/AnchoredPopup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorRect } from '@adecore/editor';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import { type PlaceOptions } from './popup-placement.ts';
|
|
4
|
-
|
|
4
|
+
interface AnchoredPopupProps {
|
|
5
5
|
rect: EditorRect;
|
|
6
6
|
className?: string;
|
|
7
7
|
overflow?: 'scroll' | 'clip';
|
|
@@ -11,3 +11,4 @@ export interface AnchoredPopupProps {
|
|
|
11
11
|
onPointerLeave?(): void;
|
|
12
12
|
}
|
|
13
13
|
export declare function AnchoredPopup({ rect, className, overflow, children, placement, onPointerEnter, onPointerLeave }: AnchoredPopupProps): import("react").ReactPortal;
|
|
14
|
+
export {};
|
package/dist/CompletionPopup.js
CHANGED
|
@@ -9,7 +9,6 @@ import { PathText } from "./PathText.js";
|
|
|
9
9
|
import { keepFocusOutOfList, useInputPopup } from './popup-focus.js';
|
|
10
10
|
import { placeBeside, placePopup } from './popup-placement.js';
|
|
11
11
|
import { TONE_CLASSES } from './symbol-picker-model.js';
|
|
12
|
-
/* The label with the characters that match what was typed set apart. */
|
|
13
12
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
function MarkedLabel(t0) {
|
|
15
14
|
const $ = _c(7);
|
|
@@ -76,7 +75,6 @@ const ROW_HEIGHT = 24;
|
|
|
76
75
|
const VISIBLE_ROWS = 8;
|
|
77
76
|
/* Rows drawn past the visible ones on each side, so a wheel turn lands on rows that exist. */
|
|
78
77
|
const OVERSCAN_ROWS = 6;
|
|
79
|
-
/* The padding the listbox has around its rows. */
|
|
80
78
|
const LIST_PADDING = 4;
|
|
81
79
|
/* What a row takes besides its name and namespace: padding, the kind badge and the gaps. */
|
|
82
80
|
const ROW_CHROME = 72;
|
package/dist/DiffView.d.ts
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type DiffDocument, type DiffSourceLine } from '@adecore/merge';
|
|
3
|
-
import { type Ref } from 'react';
|
|
4
|
-
import { type DiffLimits } from './diff-expansion.ts';
|
|
5
|
-
import { type DiffSourceTokens } from './diff-syntax.ts';
|
|
6
|
-
export interface DiffViewProps {
|
|
7
|
-
engine: EditorEngine;
|
|
8
|
-
document: DiffDocument;
|
|
9
|
-
theme: EditorTheme;
|
|
10
|
-
tokens?: DiffSourceTokens;
|
|
11
|
-
wrap?: boolean;
|
|
12
|
-
layout?: 'unified' | 'split';
|
|
13
|
-
splitWrapLimit?: number;
|
|
14
|
-
fill?: boolean;
|
|
15
|
-
maxHeight?: number;
|
|
16
|
-
unfoldLimits?: DiffLimits;
|
|
17
|
-
label: string;
|
|
18
|
-
numbered?: boolean;
|
|
19
|
-
className?: string;
|
|
20
|
-
ref?: Ref<HTMLDivElement>;
|
|
21
|
-
onMount?(editor: Editor, side?: 'old' | 'new'): void | (() => void);
|
|
22
|
-
onSource?(source: DiffSource): void | (() => void);
|
|
23
|
-
}
|
|
24
|
-
export interface DiffSource {
|
|
25
|
-
readonly editor: Editor;
|
|
26
|
-
readonly side?: 'old' | 'new';
|
|
27
|
-
at(): DiffSourceLine | null;
|
|
28
|
-
}
|
|
1
|
+
import type { DiffViewProps } from './diff-view-props.ts';
|
|
29
2
|
export declare function DiffView(props: DiffViewProps): import("react").JSX.Element;
|
package/dist/EditorView.js
CHANGED
|
@@ -32,7 +32,6 @@ function sameFields(left, right) {
|
|
|
32
32
|
const keys = new Set([...Object.keys(left), ...Object.keys(right)]);
|
|
33
33
|
return [...keys].every(key => left[key] === right[key]);
|
|
34
34
|
}
|
|
35
|
-
/* Hands the editor the settings that changed by value, so a new options object with the same values costs nothing. */
|
|
36
35
|
function applyChangedOptions(editor, before, after) {
|
|
37
36
|
if (before.theme !== after.theme) {
|
|
38
37
|
editor.setTheme(after.theme);
|
package/dist/HoverSections.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type HoverText } from './hover-content.ts';
|
|
2
2
|
export declare function Signature({ code, language, onName }: {
|
|
3
3
|
code: string;
|
|
4
4
|
language: string;
|
|
5
5
|
onName?: (name: string) => void;
|
|
6
6
|
}): import("react").JSX.Element;
|
|
7
|
-
export declare function DocTags({ tags }: {
|
|
8
|
-
tags: readonly DocTag[];
|
|
9
|
-
}): import("react").JSX.Element;
|
|
10
|
-
export declare function SymbolSection({ section, onName }: {
|
|
11
|
-
section: HoverSection;
|
|
12
|
-
onName?: (name: string, declared: string | null) => void;
|
|
13
|
-
}): import("react").JSX.Element;
|
|
14
7
|
export declare function SymbolSections({ text, onName }: {
|
|
15
8
|
text: HoverText;
|
|
16
9
|
onName?: (name: string, declared: string | null) => void;
|
package/dist/HoverSections.js
CHANGED
|
@@ -90,7 +90,7 @@ export function Signature(t0) {
|
|
|
90
90
|
}
|
|
91
91
|
/* A docblock's tags as rows: the tag once beside each run of the same tag, so a list of parameters reads as one. */
|
|
92
92
|
function _temp() {}
|
|
93
|
-
|
|
93
|
+
function DocTags(t0) {
|
|
94
94
|
const $ = _c(4);
|
|
95
95
|
const {
|
|
96
96
|
tags
|
|
@@ -128,7 +128,7 @@ export function DocTags(t0) {
|
|
|
128
128
|
return t2;
|
|
129
129
|
}
|
|
130
130
|
/* One symbol: its qualified name muted, its signature, the prose and examples as compact blocks, and its tags as rows. Names in the signature are links only where `onName` says what a press does. */
|
|
131
|
-
|
|
131
|
+
function SymbolSection(t0) {
|
|
132
132
|
const $ = _c(27);
|
|
133
133
|
const {
|
|
134
134
|
section,
|
package/dist/LanguagePopups.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useEffect, useReducer, useSyncExternalStore } from 'react';
|
|
3
3
|
import { AnchoredPopup } from "./AnchoredPopup.js";
|
|
4
4
|
import { CallHierarchyPanel } from "./CallHierarchyPanel.js";
|
|
5
5
|
import { CodeAuthorsCard } from "./CodeAuthorsCard.js";
|
|
@@ -13,12 +13,28 @@ import { RenderedDocs } from "./RenderedDocs.js";
|
|
|
13
13
|
import { SignatureCard } from "./SignatureCard.js";
|
|
14
14
|
import { SymbolPicker } from "./SymbolPicker.js";
|
|
15
15
|
import { WrapCard } from "./WrapCard.js";
|
|
16
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
function useSlot(slot) {
|
|
18
|
+
const $ = _c(3);
|
|
19
|
+
let t0;
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[0] !== slot) {
|
|
22
|
+
t0 = listener => slot.subscribe(listener);
|
|
23
|
+
t1 = () => slot.get();
|
|
24
|
+
$[0] = slot;
|
|
25
|
+
$[1] = t0;
|
|
26
|
+
$[2] = t1;
|
|
27
|
+
} else {
|
|
28
|
+
t0 = $[1];
|
|
29
|
+
t1 = $[2];
|
|
30
|
+
}
|
|
31
|
+
return useSyncExternalStore(t0, t1);
|
|
32
|
+
}
|
|
16
33
|
/*
|
|
17
34
|
* Every card a language feature opens over the editor. Each feature keeps its own state and these
|
|
18
35
|
* only draw it, placed by the screen position of the character it belongs to, which is read again
|
|
19
36
|
* whenever the editor scrolls or resizes.
|
|
20
37
|
*/
|
|
21
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
38
|
export function LanguagePopups({
|
|
23
39
|
language,
|
|
24
40
|
contextMenuItems,
|
|
@@ -29,17 +45,17 @@ export function LanguagePopups({
|
|
|
29
45
|
'use no memo';
|
|
30
46
|
|
|
31
47
|
const [, redraw] = useReducer(count => count + 1, 0);
|
|
32
|
-
const hover =
|
|
33
|
-
const completion =
|
|
34
|
-
const signature =
|
|
35
|
-
const pick =
|
|
36
|
-
const rename =
|
|
37
|
-
const peek =
|
|
38
|
-
const callHierarchy =
|
|
39
|
-
const symbols =
|
|
40
|
-
const menu =
|
|
41
|
-
const authors =
|
|
42
|
-
const wrap =
|
|
48
|
+
const hover = useSlot(language.popups.slot('hover'));
|
|
49
|
+
const completion = useSlot(language.popups.slot('completion'));
|
|
50
|
+
const signature = useSlot(language.popups.slot('signature'));
|
|
51
|
+
const pick = useSlot(language.popups.slot('pick'));
|
|
52
|
+
const rename = useSlot(language.popups.slot('rename'));
|
|
53
|
+
const peek = useSlot(language.popups.slot('peek'));
|
|
54
|
+
const callHierarchy = useSlot(language.popups.slot('callHierarchy'));
|
|
55
|
+
const symbols = useSlot(language.popups.slot('symbols'));
|
|
56
|
+
const menu = useSlot(language.popups.slot('menu'));
|
|
57
|
+
const authors = useSlot(language.popups.slot('authors'));
|
|
58
|
+
const wrap = useSlot(language.popups.slot('wrap'));
|
|
43
59
|
useEffect(() => language.editor.onViewChange(redraw), [language]);
|
|
44
60
|
const hoverRect = hover === null ? null : language.editor.rectAt(hover.anchor);
|
|
45
61
|
const completionRect = completion === null ? null : language.editor.rectAt(completion.anchor);
|
|
@@ -3,7 +3,6 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { PANEL_BODY_MIN, PANEL_KEY_STEP, availableHeightOf, clampPanelBody, panelBodyMax } from './panel-size.js';
|
|
5
5
|
import { realTimers, revealRow } from './timers.js';
|
|
6
|
-
/* The bottom edge of a panel: a drag, or the arrow keys, change the height of its body. */
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
export function PanelResizeHandle(t0) {
|
|
9
8
|
const $ = _c(34);
|
package/dist/PeekPanel.js
CHANGED
|
@@ -353,7 +353,6 @@ function _temp2(place) {
|
|
|
353
353
|
return place.text;
|
|
354
354
|
}
|
|
355
355
|
const NO_LINES = new Map();
|
|
356
|
-
/* A line of code in the colors of its syntax with the name marked, or with its name in the text color and the rest muted while no colors are at hand. */
|
|
357
356
|
function PlaceText(t0) {
|
|
358
357
|
const $ = _c(27);
|
|
359
358
|
const {
|
package/dist/PickPopup.js
CHANGED
|
@@ -7,7 +7,6 @@ import { keepFocusOutOfList, useInputPopup } from './popup-focus.js';
|
|
|
7
7
|
import { placePopup } from './popup-placement.js';
|
|
8
8
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
const CARD = 'fixed top-0 left-0 z-(--z-popup) flex w-[420px] flex-col overflow-hidden rounded-lg border border-border bg-surface-raised text-text shadow-(--float-shadow)';
|
|
10
|
-
/* The label with the part a query matched marked, whatever the case. */
|
|
11
10
|
function MatchedLabel(t0) {
|
|
12
11
|
const $ = _c(18);
|
|
13
12
|
const {
|
package/dist/RenderedDocs.js
CHANGED
|
@@ -10,7 +10,6 @@ import { Markdown } from "./Markdown.js";
|
|
|
10
10
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
const LINK = /\[([^\]]*)\]\(#doc-link:[^)]*\)/g;
|
|
12
12
|
const KNOWN = new Set(['deprecated', 'template', 'param', 'property', 'type', 'var', 'return', 'yield', 'throws', 'see', 'example', 'since', 'version', 'author']);
|
|
13
|
-
/* Code in the editor's face, with a type fainter than a name. */
|
|
14
13
|
function Code(t0) {
|
|
15
14
|
const $ = _c(3);
|
|
16
15
|
const {
|
|
@@ -33,7 +32,6 @@ function Code(t0) {
|
|
|
33
32
|
}
|
|
34
33
|
return t3;
|
|
35
34
|
}
|
|
36
|
-
/* Markdown prose and fenced code as the hover draws them: the blocks in the code face, the rest muted. */
|
|
37
35
|
function Prose(t0) {
|
|
38
36
|
const $ = _c(10);
|
|
39
37
|
const {
|
package/dist/SplitDiffView.d.ts
CHANGED
package/dist/SymbolPicker.js
CHANGED
|
@@ -10,7 +10,6 @@ import { basenameOf } from './paths.js';
|
|
|
10
10
|
import { filterEntries, groupEntries, letterOfKind, modeOf, toneOfKind, TONE_CLASSES } from './symbol-picker-model.js';
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const SEARCH_DELAY_MS = 200;
|
|
13
|
-
/* The letter badge of a symbol kind, tinted by what the symbol is. */
|
|
14
13
|
export function SymbolBadge(t0) {
|
|
15
14
|
const $ = _c(5);
|
|
16
15
|
const {
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
/* Whether a direction walks a type hierarchy and not the calls. */
|
|
2
1
|
export function isTypeDirection(direction) {
|
|
3
2
|
return direction === 'supertypes' || direction === 'subtypes';
|
|
4
3
|
}
|
|
5
4
|
/* The most calls of one level that are drawn at once; the rest wait behind a row that shows more. */
|
|
6
5
|
export const CALL_LEVEL_LIMIT = 50;
|
|
7
|
-
/* The id of the status line under a node. */
|
|
8
6
|
export function statusIdOf(parent) {
|
|
9
7
|
return `${parent}:status`;
|
|
10
8
|
}
|
|
11
|
-
/* The id of the line that shows more calls under a node. */
|
|
12
9
|
export function moreIdOf(parent) {
|
|
13
10
|
return `${parent}:more`;
|
|
14
11
|
}
|
|
15
|
-
/* The tree's roots, each one a symbol the server prepared. */
|
|
16
12
|
export function rootsOf(items) {
|
|
17
13
|
return items.map((item, index) => ({
|
|
18
14
|
id: `r${index}`,
|
package/dist/call-hierarchy.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { EditorPosition } from '@adecore/editor';
|
|
2
2
|
import { type CallDirection } from './call-hierarchy-model.ts';
|
|
3
|
-
import type {
|
|
3
|
+
import type { LanguageContext } from './language-context.ts';
|
|
4
4
|
import { type Timers } from './timers.ts';
|
|
5
5
|
export declare const CALL_HIERARCHY_HEIGHT: number;
|
|
6
|
+
interface CallHierarchyPeers {
|
|
7
|
+
readonly peek: {
|
|
8
|
+
close(): void;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
export declare class CallHierarchyFeature {
|
|
7
12
|
private readonly language;
|
|
13
|
+
private readonly peers;
|
|
8
14
|
private readonly timers;
|
|
9
15
|
private nodes;
|
|
10
16
|
private roots;
|
|
@@ -15,7 +21,7 @@ export declare class CallHierarchyFeature {
|
|
|
15
21
|
private epoch;
|
|
16
22
|
private previewEpoch;
|
|
17
23
|
private texts;
|
|
18
|
-
constructor(language:
|
|
24
|
+
constructor(language: LanguageContext, peers: CallHierarchyPeers, timers?: Timers);
|
|
19
25
|
get isOpen(): boolean;
|
|
20
26
|
get supported(): boolean;
|
|
21
27
|
get typesSupported(): boolean;
|
|
@@ -43,3 +49,4 @@ export declare class CallHierarchyFeature {
|
|
|
43
49
|
private tell;
|
|
44
50
|
private say;
|
|
45
51
|
}
|
|
52
|
+
export {};
|
package/dist/call-hierarchy.js
CHANGED
|
@@ -21,6 +21,7 @@ const OWNER = 'call-hierarchy';
|
|
|
21
21
|
*/
|
|
22
22
|
export class CallHierarchyFeature {
|
|
23
23
|
language;
|
|
24
|
+
peers;
|
|
24
25
|
timers;
|
|
25
26
|
nodes = new Map();
|
|
26
27
|
roots = [];
|
|
@@ -32,8 +33,9 @@ export class CallHierarchyFeature {
|
|
|
32
33
|
epoch = 0;
|
|
33
34
|
previewEpoch = 0;
|
|
34
35
|
texts = new Map();
|
|
35
|
-
constructor(language, timers = realTimers) {
|
|
36
|
+
constructor(language, peers, timers = realTimers) {
|
|
36
37
|
this.language = language;
|
|
38
|
+
this.peers = peers;
|
|
37
39
|
this.timers = timers;
|
|
38
40
|
const {
|
|
39
41
|
editor
|
|
@@ -59,7 +61,7 @@ export class CallHierarchyFeature {
|
|
|
59
61
|
});
|
|
60
62
|
}
|
|
61
63
|
get isOpen() {
|
|
62
|
-
return this.language.popups.
|
|
64
|
+
return this.language.popups.slot('callHierarchy').get() !== null;
|
|
63
65
|
}
|
|
64
66
|
/* Whether a server of this document answers the three requests the tree is made of. */
|
|
65
67
|
get supported() {
|
|
@@ -115,23 +117,21 @@ export class CallHierarchyFeature {
|
|
|
115
117
|
this.tell(this.say(types ? 'typesNone' : 'none'));
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
|
-
this.
|
|
120
|
+
this.peers.peek.close();
|
|
119
121
|
this.prepared = items;
|
|
120
122
|
this.position = position;
|
|
121
123
|
this.direction = direction;
|
|
122
124
|
this.seed();
|
|
123
125
|
const active = this.roots[0];
|
|
124
|
-
this.language.popups.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
preview: null
|
|
134
|
-
}
|
|
126
|
+
this.language.popups.slot('callHierarchy').set({
|
|
127
|
+
direction,
|
|
128
|
+
container: null,
|
|
129
|
+
name: items[0].name,
|
|
130
|
+
rows: rowsOf(this.nodes, this.roots),
|
|
131
|
+
active,
|
|
132
|
+
site: 0,
|
|
133
|
+
sites: 0,
|
|
134
|
+
preview: null
|
|
135
135
|
});
|
|
136
136
|
this.select(active);
|
|
137
137
|
// The editor draws a row once per id, so a tree opened over another needs an id of its own to get a container.
|
|
@@ -148,19 +148,17 @@ export class CallHierarchyFeature {
|
|
|
148
148
|
}
|
|
149
149
|
close() {
|
|
150
150
|
this.reset();
|
|
151
|
-
if (this.language.popups.
|
|
151
|
+
if (this.language.popups.slot('callHierarchy').get() === null) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
this.language.popups.
|
|
155
|
-
callHierarchy: null
|
|
156
|
-
});
|
|
154
|
+
this.language.popups.slot('callHierarchy').set(null);
|
|
157
155
|
this.language.editor.setWidgets([], OWNER);
|
|
158
156
|
this.language.editor.setInputPopup(null);
|
|
159
157
|
this.language.editor.focus();
|
|
160
158
|
}
|
|
161
159
|
/* Starts the tree over from the same symbols for the other direction; a switch between calls and types prepares the symbol again. */
|
|
162
160
|
setDirection(direction) {
|
|
163
|
-
const view = this.language.popups.
|
|
161
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
164
162
|
if (view === null || view.direction === direction) {
|
|
165
163
|
return;
|
|
166
164
|
}
|
|
@@ -172,16 +170,14 @@ export class CallHierarchyFeature {
|
|
|
172
170
|
this.direction = direction;
|
|
173
171
|
this.seed();
|
|
174
172
|
const active = this.roots[0];
|
|
175
|
-
this.language.popups.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
preview: null
|
|
184
|
-
}
|
|
173
|
+
this.language.popups.slot('callHierarchy').set({
|
|
174
|
+
...view,
|
|
175
|
+
direction,
|
|
176
|
+
rows: rowsOf(this.nodes, this.roots),
|
|
177
|
+
active,
|
|
178
|
+
site: 0,
|
|
179
|
+
sites: 0,
|
|
180
|
+
preview: null
|
|
185
181
|
});
|
|
186
182
|
this.select(active);
|
|
187
183
|
for (const root of this.roots) {
|
|
@@ -198,7 +194,7 @@ export class CallHierarchyFeature {
|
|
|
198
194
|
this.patch(id, {
|
|
199
195
|
expanded: false
|
|
200
196
|
});
|
|
201
|
-
const view = this.language.popups.
|
|
197
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
202
198
|
if (view !== null && this.hasAncestor(view.active, id)) {
|
|
203
199
|
this.select(id);
|
|
204
200
|
}
|
|
@@ -211,13 +207,11 @@ export class CallHierarchyFeature {
|
|
|
211
207
|
void this.load(id);
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
|
-
/* Asks again for the calls of a node whose last try failed. */
|
|
215
210
|
retry(id) {
|
|
216
211
|
if (this.nodes.get(id)?.load === 'failed') {
|
|
217
212
|
void this.load(id);
|
|
218
213
|
}
|
|
219
214
|
}
|
|
220
|
-
/* Brings the next stretch of calls of a level. */
|
|
221
215
|
showMore(parent) {
|
|
222
216
|
const node = this.nodes.get(parent);
|
|
223
217
|
if (node === undefined) {
|
|
@@ -227,44 +221,40 @@ export class CallHierarchyFeature {
|
|
|
227
221
|
shown: Math.min(node.children.length, node.shown + CALL_LEVEL_LIMIT)
|
|
228
222
|
});
|
|
229
223
|
const first = node.children[node.shown];
|
|
230
|
-
const view = this.language.popups.
|
|
224
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
231
225
|
// The row that offered more is gone once everything shows, so the selection moves on to what it brought.
|
|
232
226
|
if (first !== undefined && view?.active === moreIdOf(parent)) {
|
|
233
227
|
this.select(first);
|
|
234
228
|
}
|
|
235
229
|
}
|
|
236
|
-
/* Makes a row the active one and shows the code of its call. */
|
|
237
230
|
select(id, site = 0) {
|
|
238
|
-
const view = this.language.popups.
|
|
231
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
239
232
|
const node = this.nodes.get(id);
|
|
240
233
|
if (view === null || !view.rows.some(row => row.id === id)) {
|
|
241
234
|
return;
|
|
242
235
|
}
|
|
243
236
|
const sites = node?.sites.length ?? view.sites;
|
|
244
237
|
const next = node === undefined ? view.site : Math.max(0, Math.min(Math.max(0, sites - 1), site));
|
|
245
|
-
this.language.popups.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
preview: node === undefined ? view.preview : null
|
|
252
|
-
}
|
|
238
|
+
this.language.popups.slot('callHierarchy').set({
|
|
239
|
+
...view,
|
|
240
|
+
active: id,
|
|
241
|
+
site: next,
|
|
242
|
+
sites,
|
|
243
|
+
preview: node === undefined ? view.preview : null
|
|
253
244
|
});
|
|
254
245
|
if (node !== undefined) {
|
|
255
246
|
void this.preview(node, next);
|
|
256
247
|
}
|
|
257
248
|
}
|
|
258
|
-
/* Steps through the places a call is made from when the active one has more than one. */
|
|
259
249
|
stepSite(direction) {
|
|
260
|
-
const view = this.language.popups.
|
|
250
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
261
251
|
if (view !== null && view.sites > 1) {
|
|
262
252
|
this.select(view.active, (view.site + direction + view.sites) % view.sites);
|
|
263
253
|
}
|
|
264
254
|
}
|
|
265
255
|
/* Goes to the call of a row, or to the symbol of a root, and closes the tree. */
|
|
266
256
|
go(id) {
|
|
267
|
-
const view = this.language.popups.
|
|
257
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
268
258
|
const node = this.nodes.get(id);
|
|
269
259
|
if (view === null || node === undefined) {
|
|
270
260
|
return;
|
|
@@ -294,20 +284,18 @@ export class CallHierarchyFeature {
|
|
|
294
284
|
this.nodes = new Map(roots.map(root => [root.id, root]));
|
|
295
285
|
}
|
|
296
286
|
mounted(container) {
|
|
297
|
-
const view = this.language.popups.
|
|
287
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
298
288
|
if (view !== null && view.container !== container) {
|
|
299
|
-
this.language.popups.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
container
|
|
303
|
-
}
|
|
289
|
+
this.language.popups.slot('callHierarchy').set({
|
|
290
|
+
...view,
|
|
291
|
+
container
|
|
304
292
|
});
|
|
305
293
|
revealRow(this.timers, container);
|
|
306
294
|
}
|
|
307
295
|
}
|
|
308
296
|
patch(id, change) {
|
|
309
297
|
const node = this.nodes.get(id);
|
|
310
|
-
const view = this.language.popups.
|
|
298
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
311
299
|
if (node === undefined || view === null) {
|
|
312
300
|
return;
|
|
313
301
|
}
|
|
@@ -315,11 +303,9 @@ export class CallHierarchyFeature {
|
|
|
315
303
|
...node,
|
|
316
304
|
...change
|
|
317
305
|
});
|
|
318
|
-
this.language.popups.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
rows: rowsOf(this.nodes, this.roots)
|
|
322
|
-
}
|
|
306
|
+
this.language.popups.slot('callHierarchy').set({
|
|
307
|
+
...view,
|
|
308
|
+
rows: rowsOf(this.nodes, this.roots)
|
|
323
309
|
});
|
|
324
310
|
}
|
|
325
311
|
async load(id) {
|
|
@@ -416,18 +402,16 @@ export class CallHierarchyFeature {
|
|
|
416
402
|
this.texts.set(uri, text);
|
|
417
403
|
}
|
|
418
404
|
}
|
|
419
|
-
const view = this.language.popups.
|
|
405
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
420
406
|
if (view === null || view.active !== node.id) {
|
|
421
407
|
return;
|
|
422
408
|
}
|
|
423
409
|
const snippet = text === undefined ? null : snippetOf(text, range.start.line, range);
|
|
424
|
-
this.language.popups.
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
uri
|
|
430
|
-
}
|
|
410
|
+
this.language.popups.slot('callHierarchy').set({
|
|
411
|
+
...view,
|
|
412
|
+
preview: snippet === null ? null : {
|
|
413
|
+
...snippet,
|
|
414
|
+
uri
|
|
431
415
|
}
|
|
432
416
|
});
|
|
433
417
|
}
|
|
@@ -445,7 +429,7 @@ export class CallHierarchyFeature {
|
|
|
445
429
|
return false;
|
|
446
430
|
}
|
|
447
431
|
key(event) {
|
|
448
|
-
const view = this.language.popups.
|
|
432
|
+
const view = this.language.popups.slot('callHierarchy').get();
|
|
449
433
|
if (view === null || event.metaKey || event.ctrlKey || event.altKey || event.shiftKey || event.isComposing) {
|
|
450
434
|
return false;
|
|
451
435
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyTextEdits } from '@adecore/lsp';
|
|
2
|
-
import { comparePositions } from './
|
|
2
|
+
import { comparePositions } from './positions.js';
|
|
3
3
|
import { uniqueBy } from './unique.js';
|
|
4
4
|
import { resourceOperationsOf, textEntriesOf } from './workspace-edit.js';
|
|
5
5
|
/* The order of the list under the caret: the fixes and the rewrites that are one keystroke away first, the refactorings after them. */
|
package/dist/code-actions.d.ts
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { type ActionEntry } from './code-actions-model.ts';
|
|
2
|
+
import type { CompletionFeature } from './completion.ts';
|
|
2
3
|
import { type Problem } from './diagnostics-model.ts';
|
|
3
|
-
import type {
|
|
4
|
+
import type { DiagnosticsFeature } from './diagnostics.ts';
|
|
5
|
+
import type { LanguageContext } from './language-context.ts';
|
|
6
|
+
import type { PickFeature } from './pick.ts';
|
|
7
|
+
import type { RenameFeature } from './rename.ts';
|
|
4
8
|
import { type Timers } from './timers.ts';
|
|
9
|
+
interface CodeActionsPeers {
|
|
10
|
+
readonly diagnostics: Pick<DiagnosticsFeature, 'at' | 'onChange' | 'problems'>;
|
|
11
|
+
readonly completion: Pick<CompletionFeature, 'close'>;
|
|
12
|
+
readonly pick: Pick<PickFeature, 'open'>;
|
|
13
|
+
readonly rename: Pick<RenameFeature, 'start'>;
|
|
14
|
+
}
|
|
5
15
|
export declare class CodeActionsFeature {
|
|
6
16
|
private readonly language;
|
|
17
|
+
private readonly peers;
|
|
7
18
|
private readonly refresher;
|
|
8
19
|
private asking;
|
|
9
20
|
private readonly resolved;
|
|
10
|
-
constructor(language:
|
|
21
|
+
constructor(language: LanguageContext, peers: CodeActionsPeers, timers?: Timers);
|
|
11
22
|
get supported(): boolean;
|
|
12
23
|
open(): Promise<void>;
|
|
13
24
|
refactorThis(): Promise<void>;
|
|
@@ -30,3 +41,4 @@ export declare class CodeActionsFeature {
|
|
|
30
41
|
private fail;
|
|
31
42
|
private say;
|
|
32
43
|
}
|
|
44
|
+
export {};
|