@lvce-editor/editor-worker 19.28.0 → 19.28.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/editorWorkerMain.js +37 -7
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -9760,6 +9760,36 @@ const getSignatureHelpContent = signatureHelp => {
|
|
|
9760
9760
|
};
|
|
9761
9761
|
};
|
|
9762
9762
|
|
|
9763
|
+
const borderHeight = 2;
|
|
9764
|
+
const documentationPaddingHeight = 8;
|
|
9765
|
+
const displayStringLineHeight = 20;
|
|
9766
|
+
const displayStringPaddingHeight = 8;
|
|
9767
|
+
const preferredWidth = 600;
|
|
9768
|
+
const getHeight = (lineCount, documentationHeight, hasDocumentation) => {
|
|
9769
|
+
const displayStringHeight = lineCount * displayStringLineHeight + displayStringPaddingHeight;
|
|
9770
|
+
const fullDocumentationHeight = hasDocumentation ? documentationHeight + documentationPaddingHeight : 0;
|
|
9771
|
+
return borderHeight + displayStringHeight + fullDocumentationHeight;
|
|
9772
|
+
};
|
|
9773
|
+
const getSignatureHelpWidgetBounds = (editor, rowIndex, columnIndex, lineCount, documentationHeight, hasDocumentation) => {
|
|
9774
|
+
const width = Math.min(preferredWidth, editor.width);
|
|
9775
|
+
const height = Math.min(getHeight(lineCount, documentationHeight, hasDocumentation), editor.height);
|
|
9776
|
+
const cursorX = x(editor, rowIndex, columnIndex);
|
|
9777
|
+
const cursorY = y(editor, rowIndex);
|
|
9778
|
+
const editorRight = editor.x + editor.width;
|
|
9779
|
+
const editorBottom = editor.y + editor.height;
|
|
9780
|
+
const x$1 = clamp(cursorX, editor.x, editorRight - width);
|
|
9781
|
+
const yBelow = cursorY;
|
|
9782
|
+
const yAbove = cursorY - editor.rowHeight - height;
|
|
9783
|
+
const preferredY = yBelow + height <= editorBottom ? yBelow : yAbove;
|
|
9784
|
+
const y$1 = clamp(preferredY, editor.y, editorBottom - height);
|
|
9785
|
+
return {
|
|
9786
|
+
height,
|
|
9787
|
+
width,
|
|
9788
|
+
x: x$1,
|
|
9789
|
+
y: y$1
|
|
9790
|
+
};
|
|
9791
|
+
};
|
|
9792
|
+
|
|
9763
9793
|
const getTextDocument$1 = editor => {
|
|
9764
9794
|
return {
|
|
9765
9795
|
documentId: editor.id || editor.uid,
|
|
@@ -9803,14 +9833,11 @@ const getSignatureHelpInfo = async editorUid => {
|
|
|
9803
9833
|
} = content;
|
|
9804
9834
|
const lineInfos = await tokenizeCodeBlock(displayString, editor.languageId || 'typescript', '');
|
|
9805
9835
|
const documentationHeight = await measureTextBlockHeight();
|
|
9806
|
-
const
|
|
9807
|
-
const y$1 = editor.height - y(editor, rowIndex) + editor.y + 40;
|
|
9836
|
+
const bounds = getSignatureHelpWidgetBounds(editor, rowIndex, columnIndex, lineInfos.length, documentationHeight, Boolean(documentation));
|
|
9808
9837
|
return {
|
|
9838
|
+
...bounds,
|
|
9809
9839
|
documentation,
|
|
9810
|
-
|
|
9811
|
-
lineInfos,
|
|
9812
|
-
x: x$1,
|
|
9813
|
-
y: y$1
|
|
9840
|
+
lineInfos
|
|
9814
9841
|
};
|
|
9815
9842
|
};
|
|
9816
9843
|
|
|
@@ -9824,7 +9851,9 @@ const loadSignatureHelpContent = async state => {
|
|
|
9824
9851
|
}
|
|
9825
9852
|
const {
|
|
9826
9853
|
documentation,
|
|
9854
|
+
height,
|
|
9827
9855
|
lineInfos,
|
|
9856
|
+
width,
|
|
9828
9857
|
x,
|
|
9829
9858
|
y
|
|
9830
9859
|
} = signatureHelpInfo;
|
|
@@ -9832,8 +9861,9 @@ const loadSignatureHelpContent = async state => {
|
|
|
9832
9861
|
...state,
|
|
9833
9862
|
diagnostics: [],
|
|
9834
9863
|
documentation,
|
|
9864
|
+
height,
|
|
9835
9865
|
lineInfos,
|
|
9836
|
-
width
|
|
9866
|
+
width,
|
|
9837
9867
|
x,
|
|
9838
9868
|
y
|
|
9839
9869
|
};
|