@lvce-editor/editor-worker 19.74.1 → 19.74.3
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 +38 -35
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -1478,7 +1478,7 @@ const sendMessagePortToExtensionManagementWorker$1 = async (port, rpcId) => {
|
|
|
1478
1478
|
const command = 'Extensions.handleMessagePort';
|
|
1479
1479
|
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1480
1480
|
};
|
|
1481
|
-
const getPreference = async key => {
|
|
1481
|
+
const getPreference$1 = async key => {
|
|
1482
1482
|
return await invoke$d('Preferences.get', key);
|
|
1483
1483
|
};
|
|
1484
1484
|
const openUri = async (uri, focus, options) => {
|
|
@@ -6630,8 +6630,8 @@ const applyLineEndings = (content, endOfLine) => {
|
|
|
6630
6630
|
return endOfLine === Crlf ? normalizeLineEndings(content).replaceAll('\n', '\r\n') : normalizeLineEndings(content);
|
|
6631
6631
|
};
|
|
6632
6632
|
|
|
6633
|
-
const get$3 = async key => {
|
|
6634
|
-
const value = await getPreference(key);
|
|
6633
|
+
const get$3 = async (key, applicationId) => {
|
|
6634
|
+
const value = applicationId === undefined ? await getPreference$1(key) : await invoke$9(applicationId, 'Preferences.get', key);
|
|
6635
6635
|
return value;
|
|
6636
6636
|
};
|
|
6637
6637
|
const update = async settings => {
|
|
@@ -14300,10 +14300,12 @@ const loadSignatureHelpContent = async state => {
|
|
|
14300
14300
|
x,
|
|
14301
14301
|
y
|
|
14302
14302
|
} = signatureHelpInfo;
|
|
14303
|
+
const documentationVirtualDom = documentation ? await getVirtualDomFromMarkdown(documentation) : [];
|
|
14303
14304
|
return {
|
|
14304
14305
|
...state,
|
|
14305
14306
|
diagnostics: [],
|
|
14306
14307
|
documentation,
|
|
14308
|
+
documentationVirtualDom,
|
|
14307
14309
|
height,
|
|
14308
14310
|
lineInfos,
|
|
14309
14311
|
width,
|
|
@@ -16861,6 +16863,7 @@ const getBreadcrumbFileIcon = async (uri, applicationId) => {
|
|
|
16861
16863
|
}
|
|
16862
16864
|
};
|
|
16863
16865
|
|
|
16866
|
+
const getPreference = (key, applicationId) => applicationId === undefined ? get$3(key) : get$3(key, applicationId);
|
|
16864
16867
|
const kLineHeight = 'editor.lineHeight';
|
|
16865
16868
|
const kFontSize = 'editor.fontSize';
|
|
16866
16869
|
const kFontFamily = 'editor.fontFamily';
|
|
@@ -16885,20 +16888,20 @@ const warnIfChanged = (setting, value, bound, direction) => {
|
|
|
16885
16888
|
lastWarnings.set(setting, value);
|
|
16886
16889
|
warn(`[editor-worker] ${setting} value ${value} is too ${direction}; using ${bound}`);
|
|
16887
16890
|
};
|
|
16888
|
-
const isAutoClosingBracketsEnabled = async
|
|
16889
|
-
return Boolean(await
|
|
16891
|
+
const isAutoClosingBracketsEnabled = async applicationId => {
|
|
16892
|
+
return Boolean(await getPreference(kAutoClosingBrackets, applicationId));
|
|
16890
16893
|
};
|
|
16891
|
-
const isAutoClosingQuotesEnabled = async
|
|
16892
|
-
return Boolean(await
|
|
16894
|
+
const isAutoClosingQuotesEnabled = async applicationId => {
|
|
16895
|
+
return Boolean(await getPreference(kAutoClosingQuotes, applicationId));
|
|
16893
16896
|
};
|
|
16894
|
-
const isQuickSuggestionsEnabled = async
|
|
16895
|
-
return Boolean(await
|
|
16897
|
+
const isQuickSuggestionsEnabled = async applicationId => {
|
|
16898
|
+
return Boolean(await getPreference(kQuickSuggestions, applicationId));
|
|
16896
16899
|
};
|
|
16897
16900
|
const isAutoClosingTagsEnabled = async () => {
|
|
16898
16901
|
return true;
|
|
16899
16902
|
};
|
|
16900
|
-
const getRowHeight = async
|
|
16901
|
-
const [lineHeight, fontSize] = await Promise.all([
|
|
16903
|
+
const getRowHeight = async applicationId => {
|
|
16904
|
+
const [lineHeight, fontSize] = await Promise.all([getPreference(kLineHeight, applicationId), getFontSize(applicationId)]);
|
|
16902
16905
|
if (typeof lineHeight !== 'number' || !Number.isFinite(lineHeight) || lineHeight === 0) {
|
|
16903
16906
|
lastWarnings.delete(kLineHeight);
|
|
16904
16907
|
return fontSize;
|
|
@@ -16914,8 +16917,8 @@ const getRowHeight = async () => {
|
|
|
16914
16917
|
lastWarnings.delete(kLineHeight);
|
|
16915
16918
|
return lineHeight;
|
|
16916
16919
|
};
|
|
16917
|
-
const getFontSize = async
|
|
16918
|
-
const fontSize = await
|
|
16920
|
+
const getFontSize = async applicationId => {
|
|
16921
|
+
const fontSize = await getPreference(kFontSize, applicationId);
|
|
16919
16922
|
if (typeof fontSize !== 'number' || !Number.isFinite(fontSize)) {
|
|
16920
16923
|
lastWarnings.delete(kFontSize);
|
|
16921
16924
|
return 15;
|
|
@@ -16931,35 +16934,35 @@ const getFontSize = async () => {
|
|
|
16931
16934
|
lastWarnings.delete(kFontSize);
|
|
16932
16935
|
return fontSize;
|
|
16933
16936
|
};
|
|
16934
|
-
const getFontFamily = async
|
|
16935
|
-
return (await
|
|
16937
|
+
const getFontFamily = async applicationId => {
|
|
16938
|
+
return (await getPreference(kFontFamily, applicationId)) || 'Fira Code';
|
|
16936
16939
|
};
|
|
16937
|
-
const getLetterSpacing = async
|
|
16940
|
+
const getLetterSpacing = async applicationId => {
|
|
16938
16941
|
// if (!false) {
|
|
16939
16942
|
// return 0
|
|
16940
16943
|
// }
|
|
16941
|
-
return (await
|
|
16944
|
+
return (await getPreference(kLetterSpacing, applicationId)) ?? 0.5;
|
|
16942
16945
|
};
|
|
16943
|
-
const getTabSize = async
|
|
16944
|
-
return (await
|
|
16946
|
+
const getTabSize = async applicationId => {
|
|
16947
|
+
return (await getPreference(kTabSize, applicationId)) || 2;
|
|
16945
16948
|
};
|
|
16946
|
-
const getLineNumbers = async
|
|
16947
|
-
return (await
|
|
16949
|
+
const getLineNumbers = async applicationId => {
|
|
16950
|
+
return (await getPreference(kLineNumbers, applicationId)) ?? false;
|
|
16948
16951
|
};
|
|
16949
|
-
const getHighlightActiveLineNumber = async
|
|
16950
|
-
return (await
|
|
16952
|
+
const getHighlightActiveLineNumber = async applicationId => {
|
|
16953
|
+
return (await getPreference(kHighlightActiveLineNumber, applicationId)) ?? true;
|
|
16951
16954
|
};
|
|
16952
16955
|
const getCompletionTriggerCharacters = async () => {
|
|
16953
16956
|
return ['.', '/'];
|
|
16954
16957
|
};
|
|
16955
|
-
const getFontWeight = async
|
|
16956
|
-
return (await
|
|
16958
|
+
const getFontWeight = async applicationId => {
|
|
16959
|
+
return (await getPreference(kFontWeight, applicationId)) ?? 400;
|
|
16957
16960
|
};
|
|
16958
|
-
const getMinimapEnabled = async
|
|
16959
|
-
return (await
|
|
16961
|
+
const getMinimapEnabled = async applicationId => {
|
|
16962
|
+
return (await getPreference(kMinimapEnabled, applicationId)) ?? false;
|
|
16960
16963
|
};
|
|
16961
|
-
const getMergeConflictActionsEnabled = async
|
|
16962
|
-
return (await
|
|
16964
|
+
const getMergeConflictActionsEnabled = async applicationId => {
|
|
16965
|
+
return (await getPreference(kMergeConflictActions, applicationId)) ?? false;
|
|
16963
16966
|
};
|
|
16964
16967
|
|
|
16965
16968
|
const DEFAULT_HOVER_DELAY = 200;
|
|
@@ -16991,8 +16994,8 @@ const getHorizontalVirtualizationThreshold = value => {
|
|
|
16991
16994
|
}
|
|
16992
16995
|
return Math.floor(threshold);
|
|
16993
16996
|
};
|
|
16994
|
-
const getEditorPreferences = async
|
|
16995
|
-
const [diagnosticsEnabled, fontFamily, fontSize, fontWeight, formatOnSave, hoverEnabled, hoverDelay, horizontalVirtualizationThreshold, messageDelay, isAutoClosingBracketsEnabled$1, isAutoClosingQuotesEnabled$1, isAutoClosingTagsEnabled$1, isQuickSuggestionsEnabled$1, lineNumbers, highlightActiveLineNumber, rowHeight, tabSize, letterSpacing, completionTriggerCharacters, minimapEnabled, mergeConflictActionsEnabled, breadcrumbsEnabled, insertSpaces, dragAndDropEnabled, roundedSelection, combineWhitespaceTokens, selectedTextOccurrenceMatching] = await Promise.all([get$3('editor.diagnostics'), getFontFamily(), getFontSize(), getFontWeight(), get$3('editor.formatOnSave'), get$3('editor.hover'), get$3('editor.hoverDelay'), get$3('editor.horizontalVirtualizationThreshold'), get$3('editor.messageDelay'), isAutoClosingBracketsEnabled(), isAutoClosingQuotesEnabled(), isAutoClosingTagsEnabled(), isQuickSuggestionsEnabled(), getLineNumbers(), getHighlightActiveLineNumber(), getRowHeight(), getTabSize(), getLetterSpacing(), getCompletionTriggerCharacters(), getMinimapEnabled(), getMergeConflictActionsEnabled(), get$3('breadcrumbs.enabled'), get$3('editor.insertSpaces'), get$3('editor.dragAndDrop'), get$3('editor.roundedSelection'), get$3('editor.combineWhitespaceTokens'), get$3('editor.selectedTextOccurrenceMatching')]);
|
|
16997
|
+
const getEditorPreferences = async applicationId => {
|
|
16998
|
+
const [diagnosticsEnabled, fontFamily, fontSize, fontWeight, formatOnSave, hoverEnabled, hoverDelay, horizontalVirtualizationThreshold, messageDelay, isAutoClosingBracketsEnabled$1, isAutoClosingQuotesEnabled$1, isAutoClosingTagsEnabled$1, isQuickSuggestionsEnabled$1, lineNumbers, highlightActiveLineNumber, rowHeight, tabSize, letterSpacing, completionTriggerCharacters, minimapEnabled, mergeConflictActionsEnabled, breadcrumbsEnabled, insertSpaces, dragAndDropEnabled, roundedSelection, combineWhitespaceTokens, selectedTextOccurrenceMatching] = await Promise.all([get$3('editor.diagnostics', applicationId), getFontFamily(applicationId), getFontSize(applicationId), getFontWeight(applicationId), get$3('editor.formatOnSave', applicationId), get$3('editor.hover', applicationId), get$3('editor.hoverDelay', applicationId), get$3('editor.horizontalVirtualizationThreshold', applicationId), get$3('editor.messageDelay', applicationId), isAutoClosingBracketsEnabled(applicationId), isAutoClosingQuotesEnabled(applicationId), isAutoClosingTagsEnabled(), isQuickSuggestionsEnabled(applicationId), getLineNumbers(applicationId), getHighlightActiveLineNumber(applicationId), getRowHeight(applicationId), getTabSize(applicationId), getLetterSpacing(applicationId), getCompletionTriggerCharacters(), getMinimapEnabled(applicationId), getMergeConflictActionsEnabled(applicationId), get$3('breadcrumbs.enabled', applicationId), get$3('editor.insertSpaces', applicationId), get$3('editor.dragAndDrop', applicationId), get$3('editor.roundedSelection', applicationId), get$3('editor.combineWhitespaceTokens', applicationId), get$3('editor.selectedTextOccurrenceMatching', applicationId)]);
|
|
16996
16999
|
return {
|
|
16997
17000
|
breadcrumbsEnabled: breadcrumbsEnabled ?? false,
|
|
16998
17001
|
combineWhitespaceTokens: combineWhitespaceTokens ?? true,
|
|
@@ -17064,7 +17067,7 @@ const updateFindWidget = async state => {
|
|
|
17064
17067
|
};
|
|
17065
17068
|
const handleSettingsChanged = async state => {
|
|
17066
17069
|
const editorPreferences = {
|
|
17067
|
-
...(await getEditorPreferences()),
|
|
17070
|
+
...(await getEditorPreferences(state.applicationId)),
|
|
17068
17071
|
...(state.largeFile && getLargeFilePreferences())
|
|
17069
17072
|
};
|
|
17070
17073
|
const {
|
|
@@ -17077,7 +17080,7 @@ const handleSettingsChanged = async state => {
|
|
|
17077
17080
|
minimapEnabled,
|
|
17078
17081
|
rowHeight
|
|
17079
17082
|
} = editorPreferences;
|
|
17080
|
-
const [charWidth, completionsOnTypeRaw] = await Promise.all([measureCharacterWidth(fontWeight, fontSize, fontFamily, letterSpacing), get$3('editor.completionsOnType')]);
|
|
17083
|
+
const [charWidth, completionsOnTypeRaw] = await Promise.all([measureCharacterWidth(fontWeight, fontSize, fontFamily, letterSpacing), state.applicationId === undefined ? get$3('editor.completionsOnType') : get$3('editor.completionsOnType', state.applicationId)]);
|
|
17081
17084
|
const isMonospaceFont = fontFamily === 'Fira Code' || fontFamily === "'Fira Code'";
|
|
17082
17085
|
const editorWithUpdatedSettings = {
|
|
17083
17086
|
...state,
|
|
@@ -17530,7 +17533,7 @@ const loadContent = async (state, savedState, largeFile = false, focus = true, f
|
|
|
17530
17533
|
rowHeight,
|
|
17531
17534
|
selectedTextOccurrenceMatching,
|
|
17532
17535
|
tabSize
|
|
17533
|
-
} = await getEditorPreferences();
|
|
17536
|
+
} = await getEditorPreferences(state.applicationId);
|
|
17534
17537
|
// TODO support overwriting language id by setting it explicitly or via settings
|
|
17535
17538
|
const charWidth = await measureCharacterWidth(fontWeight, fontSize, fontFamily, letterSpacing);
|
|
17536
17539
|
const languages = await getLanguages(platform, assetDir);
|
|
@@ -17664,7 +17667,7 @@ const loadContent = async (state, savedState, largeFile = false, focus = true, f
|
|
|
17664
17667
|
horizontalVisibleRanges,
|
|
17665
17668
|
textInfos
|
|
17666
17669
|
};
|
|
17667
|
-
const completionsOnTypeRaw = await get$3('editor.completionsOnType');
|
|
17670
|
+
const completionsOnTypeRaw = state.applicationId === undefined ? await get$3('editor.completionsOnType') : await get$3('editor.completionsOnType', state.applicationId);
|
|
17668
17671
|
const completionsOnType = Boolean(completionsOnTypeRaw);
|
|
17669
17672
|
const newEditor5 = {
|
|
17670
17673
|
...newEditor4,
|