@lvce-editor/editor-worker 19.74.2 → 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.
@@ -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 => {
@@ -16863,6 +16863,7 @@ const getBreadcrumbFileIcon = async (uri, applicationId) => {
16863
16863
  }
16864
16864
  };
16865
16865
 
16866
+ const getPreference = (key, applicationId) => applicationId === undefined ? get$3(key) : get$3(key, applicationId);
16866
16867
  const kLineHeight = 'editor.lineHeight';
16867
16868
  const kFontSize = 'editor.fontSize';
16868
16869
  const kFontFamily = 'editor.fontFamily';
@@ -16887,20 +16888,20 @@ const warnIfChanged = (setting, value, bound, direction) => {
16887
16888
  lastWarnings.set(setting, value);
16888
16889
  warn(`[editor-worker] ${setting} value ${value} is too ${direction}; using ${bound}`);
16889
16890
  };
16890
- const isAutoClosingBracketsEnabled = async () => {
16891
- return Boolean(await get$3(kAutoClosingBrackets));
16891
+ const isAutoClosingBracketsEnabled = async applicationId => {
16892
+ return Boolean(await getPreference(kAutoClosingBrackets, applicationId));
16892
16893
  };
16893
- const isAutoClosingQuotesEnabled = async () => {
16894
- return Boolean(await get$3(kAutoClosingQuotes));
16894
+ const isAutoClosingQuotesEnabled = async applicationId => {
16895
+ return Boolean(await getPreference(kAutoClosingQuotes, applicationId));
16895
16896
  };
16896
- const isQuickSuggestionsEnabled = async () => {
16897
- return Boolean(await get$3(kQuickSuggestions));
16897
+ const isQuickSuggestionsEnabled = async applicationId => {
16898
+ return Boolean(await getPreference(kQuickSuggestions, applicationId));
16898
16899
  };
16899
16900
  const isAutoClosingTagsEnabled = async () => {
16900
16901
  return true;
16901
16902
  };
16902
- const getRowHeight = async () => {
16903
- const [lineHeight, fontSize] = await Promise.all([get$3(kLineHeight), getFontSize()]);
16903
+ const getRowHeight = async applicationId => {
16904
+ const [lineHeight, fontSize] = await Promise.all([getPreference(kLineHeight, applicationId), getFontSize(applicationId)]);
16904
16905
  if (typeof lineHeight !== 'number' || !Number.isFinite(lineHeight) || lineHeight === 0) {
16905
16906
  lastWarnings.delete(kLineHeight);
16906
16907
  return fontSize;
@@ -16916,8 +16917,8 @@ const getRowHeight = async () => {
16916
16917
  lastWarnings.delete(kLineHeight);
16917
16918
  return lineHeight;
16918
16919
  };
16919
- const getFontSize = async () => {
16920
- const fontSize = await get$3(kFontSize);
16920
+ const getFontSize = async applicationId => {
16921
+ const fontSize = await getPreference(kFontSize, applicationId);
16921
16922
  if (typeof fontSize !== 'number' || !Number.isFinite(fontSize)) {
16922
16923
  lastWarnings.delete(kFontSize);
16923
16924
  return 15;
@@ -16933,35 +16934,35 @@ const getFontSize = async () => {
16933
16934
  lastWarnings.delete(kFontSize);
16934
16935
  return fontSize;
16935
16936
  };
16936
- const getFontFamily = async () => {
16937
- return (await get$3(kFontFamily)) || 'Fira Code';
16937
+ const getFontFamily = async applicationId => {
16938
+ return (await getPreference(kFontFamily, applicationId)) || 'Fira Code';
16938
16939
  };
16939
- const getLetterSpacing = async () => {
16940
+ const getLetterSpacing = async applicationId => {
16940
16941
  // if (!false) {
16941
16942
  // return 0
16942
16943
  // }
16943
- return (await get$3(kLetterSpacing)) ?? 0.5;
16944
+ return (await getPreference(kLetterSpacing, applicationId)) ?? 0.5;
16944
16945
  };
16945
- const getTabSize = async () => {
16946
- return (await get$3(kTabSize)) || 2;
16946
+ const getTabSize = async applicationId => {
16947
+ return (await getPreference(kTabSize, applicationId)) || 2;
16947
16948
  };
16948
- const getLineNumbers = async () => {
16949
- return (await get$3(kLineNumbers)) ?? false;
16949
+ const getLineNumbers = async applicationId => {
16950
+ return (await getPreference(kLineNumbers, applicationId)) ?? false;
16950
16951
  };
16951
- const getHighlightActiveLineNumber = async () => {
16952
- return (await get$3(kHighlightActiveLineNumber)) ?? true;
16952
+ const getHighlightActiveLineNumber = async applicationId => {
16953
+ return (await getPreference(kHighlightActiveLineNumber, applicationId)) ?? true;
16953
16954
  };
16954
16955
  const getCompletionTriggerCharacters = async () => {
16955
16956
  return ['.', '/'];
16956
16957
  };
16957
- const getFontWeight = async () => {
16958
- return (await get$3(kFontWeight)) ?? 400;
16958
+ const getFontWeight = async applicationId => {
16959
+ return (await getPreference(kFontWeight, applicationId)) ?? 400;
16959
16960
  };
16960
- const getMinimapEnabled = async () => {
16961
- return (await get$3(kMinimapEnabled)) ?? false;
16961
+ const getMinimapEnabled = async applicationId => {
16962
+ return (await getPreference(kMinimapEnabled, applicationId)) ?? false;
16962
16963
  };
16963
- const getMergeConflictActionsEnabled = async () => {
16964
- return (await get$3(kMergeConflictActions)) ?? false;
16964
+ const getMergeConflictActionsEnabled = async applicationId => {
16965
+ return (await getPreference(kMergeConflictActions, applicationId)) ?? false;
16965
16966
  };
16966
16967
 
16967
16968
  const DEFAULT_HOVER_DELAY = 200;
@@ -16993,8 +16994,8 @@ const getHorizontalVirtualizationThreshold = value => {
16993
16994
  }
16994
16995
  return Math.floor(threshold);
16995
16996
  };
16996
- const getEditorPreferences = async () => {
16997
- 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)]);
16998
16999
  return {
16999
17000
  breadcrumbsEnabled: breadcrumbsEnabled ?? false,
17000
17001
  combineWhitespaceTokens: combineWhitespaceTokens ?? true,
@@ -17066,7 +17067,7 @@ const updateFindWidget = async state => {
17066
17067
  };
17067
17068
  const handleSettingsChanged = async state => {
17068
17069
  const editorPreferences = {
17069
- ...(await getEditorPreferences()),
17070
+ ...(await getEditorPreferences(state.applicationId)),
17070
17071
  ...(state.largeFile && getLargeFilePreferences())
17071
17072
  };
17072
17073
  const {
@@ -17079,7 +17080,7 @@ const handleSettingsChanged = async state => {
17079
17080
  minimapEnabled,
17080
17081
  rowHeight
17081
17082
  } = editorPreferences;
17082
- 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)]);
17083
17084
  const isMonospaceFont = fontFamily === 'Fira Code' || fontFamily === "'Fira Code'";
17084
17085
  const editorWithUpdatedSettings = {
17085
17086
  ...state,
@@ -17532,7 +17533,7 @@ const loadContent = async (state, savedState, largeFile = false, focus = true, f
17532
17533
  rowHeight,
17533
17534
  selectedTextOccurrenceMatching,
17534
17535
  tabSize
17535
- } = await getEditorPreferences();
17536
+ } = await getEditorPreferences(state.applicationId);
17536
17537
  // TODO support overwriting language id by setting it explicitly or via settings
17537
17538
  const charWidth = await measureCharacterWidth(fontWeight, fontSize, fontFamily, letterSpacing);
17538
17539
  const languages = await getLanguages(platform, assetDir);
@@ -17666,7 +17667,7 @@ const loadContent = async (state, savedState, largeFile = false, focus = true, f
17666
17667
  horizontalVisibleRanges,
17667
17668
  textInfos
17668
17669
  };
17669
- 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);
17670
17671
  const completionsOnType = Boolean(completionsOnTypeRaw);
17671
17672
  const newEditor5 = {
17672
17673
  ...newEditor4,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.74.2",
3
+ "version": "19.74.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"