@lvce-editor/editor-worker 14.1.0 → 14.2.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 (2) hide show
  1. package/dist/editorWorkerMain.js +1004 -1000
  2. package/package.json +1 -1
@@ -1309,15 +1309,15 @@ const launchWorker = async (name, url, intializeCommand) => {
1309
1309
  // @ts-ignore
1310
1310
  await invokeAndTransfer$1('IpcParent.create', {
1311
1311
  method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug,
1312
- url,
1313
1312
  name: name,
1313
+ port: port1,
1314
1314
  raw: true,
1315
- port: port1
1315
+ url
1316
1316
  });
1317
1317
  const rpc = await MessagePortRpcParent.create({
1318
1318
  commandMap: {},
1319
- messagePort: port2,
1320
- isMessagePortOpen: true
1319
+ isMessagePortOpen: true,
1320
+ messagePort: port2
1321
1321
  });
1322
1322
  port2.start();
1323
1323
  if (intializeCommand) {
@@ -1346,11 +1346,11 @@ const invoke$9 = async (method, ...params) => {
1346
1346
 
1347
1347
  const loadContent$2 = async (state, parentUid) => {
1348
1348
  const {
1349
+ height,
1349
1350
  uid,
1350
- x,
1351
- y,
1352
1351
  width,
1353
- height
1352
+ x,
1353
+ y
1354
1354
  } = state;
1355
1355
  await invoke$9('ColorPicker.create', uid, x, y, width, height, parentUid);
1356
1356
  await invoke$9('ColorPicker.loadContent', uid);
@@ -1433,8 +1433,8 @@ const set$6 = (id, oldEditor, newEditor) => {
1433
1433
  object(oldEditor);
1434
1434
  object(newEditor);
1435
1435
  editors[id] = {
1436
- oldState: oldEditor,
1437
- newState: newEditor
1436
+ newState: newEditor,
1437
+ oldState: oldEditor
1438
1438
  };
1439
1439
  };
1440
1440
 
@@ -1495,29 +1495,18 @@ const getDecorationClassName = type => {
1495
1495
  switch (type) {
1496
1496
  case Link:
1497
1497
  return Link$1;
1498
- case Ts2816:
1499
- case Ts2817:
1500
- case Ts2824:
1501
- case Ts2825:
1502
- case Ts2856:
1503
- case Ts2857:
1504
- case Ts3072:
1505
- case Ts3073:
1506
- case Ts3077:
1507
- case Ts3088:
1508
- return Function;
1509
- case Ts1792:
1510
- case Ts1793:
1511
- return Parameter;
1512
- case Ts512:
1513
- case Ts513:
1514
- case Ts769:
1515
1498
  case Ts1024:
1516
1499
  case Ts1536:
1517
1500
  case Ts1537:
1518
1501
  case Ts1544:
1519
1502
  case Ts1545:
1503
+ case Ts512:
1504
+ case Ts513:
1505
+ case Ts769:
1520
1506
  return Type;
1507
+ case Ts1792:
1508
+ case Ts1793:
1509
+ return Parameter;
1521
1510
  case Ts2048:
1522
1511
  case Ts2049:
1523
1512
  case Ts2056:
@@ -1537,6 +1526,17 @@ const getDecorationClassName = type => {
1537
1526
  case Ts257:
1538
1527
  case Ts272:
1539
1528
  return Class;
1529
+ case Ts2816:
1530
+ case Ts2817:
1531
+ case Ts2824:
1532
+ case Ts2825:
1533
+ case Ts2856:
1534
+ case Ts2857:
1535
+ case Ts3072:
1536
+ case Ts3073:
1537
+ case Ts3077:
1538
+ case Ts3088:
1539
+ return Function;
1540
1540
  default:
1541
1541
  return `Unknown-${type}`;
1542
1542
  }
@@ -1583,8 +1583,8 @@ const safeTokenizeLine = (languageId, tokenizeLine, line, lineStateAtStart, hasA
1583
1583
  } catch (error) {
1584
1584
  console.error(error);
1585
1585
  return {
1586
- tokens: [/* type */0, /* length */line.length],
1587
- lineState: lineStateAtStart
1586
+ lineState: lineStateAtStart,
1587
+ tokens: [/* type */0, /* length */line.length]
1588
1588
  };
1589
1589
  }
1590
1590
  };
@@ -1611,8 +1611,8 @@ const initialLineState = {
1611
1611
  const hasArrayReturn = true;
1612
1612
  const tokenizeLine = (line, lineState) => {
1613
1613
  return {
1614
- tokens: [TokenType.Text, line.length],
1615
- state: lineState.state
1614
+ state: lineState.state,
1615
+ tokens: [TokenType.Text, line.length]
1616
1616
  };
1617
1617
  };
1618
1618
 
@@ -1635,12 +1635,14 @@ const getEnabled$1 = () => {
1635
1635
  };
1636
1636
 
1637
1637
  const {
1638
- set: set$5,
1639
- invoke: invoke$8} = SyntaxHighlightingWorker;
1638
+ invoke: invoke$8,
1639
+ set: set$5
1640
+ } = SyntaxHighlightingWorker;
1640
1641
 
1641
1642
  const state$6 = {
1642
- tokenizers: Object.create(null),
1643
- pending: Object.create(null)};
1643
+ pending: Object.create(null),
1644
+ tokenizers: Object.create(null)
1645
+ };
1644
1646
  const has = languageId => {
1645
1647
  return languageId in state$6.tokenizers;
1646
1648
  };
@@ -1721,8 +1723,8 @@ const getTokensViewportEmbedded = (langageId, lines, lineCache, linesWithEmbed)
1721
1723
  if (result.embeddedLanguage) {
1722
1724
  const {
1723
1725
  embeddedLanguage,
1724
- embeddedLanguageStart,
1725
- embeddedLanguageEnd
1726
+ embeddedLanguageEnd,
1727
+ embeddedLanguageStart
1726
1728
  } = result;
1727
1729
  const embeddedTokenizer = getTokenizer(embeddedLanguage);
1728
1730
  if (embeddedLanguageStart !== line.length && embeddedTokenizer && embeddedTokenizer !== TokenizePlainText) {
@@ -1732,9 +1734,9 @@ const getTokensViewportEmbedded = (langageId, lines, lineCache, linesWithEmbed)
1732
1734
  topContext = embedResult;
1733
1735
  result.embeddedResultIndex = embeddedResults.length;
1734
1736
  embeddedResults.push({
1737
+ isFull,
1735
1738
  result: embedResult,
1736
- TokenMap: embeddedTokenizer.TokenMap,
1737
- isFull
1739
+ TokenMap: embeddedTokenizer.TokenMap
1738
1740
  });
1739
1741
  } else if (line.length === 0) {
1740
1742
  const embedResult = {
@@ -1742,15 +1744,15 @@ const getTokensViewportEmbedded = (langageId, lines, lineCache, linesWithEmbed)
1742
1744
  };
1743
1745
  result.embeddedResultIndex = embeddedResults.length;
1744
1746
  embeddedResults.push({
1745
- result: embedResult,
1746
1747
  isFull: true,
1748
+ result: embedResult,
1747
1749
  TokenMap: []
1748
1750
  });
1749
1751
  } else {
1750
1752
  tokenizersToLoad.push(embeddedLanguage);
1751
1753
  embeddedResults.push({
1752
- result: {},
1753
1754
  isFull: false,
1755
+ result: {},
1754
1756
  TokenMap: []
1755
1757
  });
1756
1758
  topContext = undefined;
@@ -1760,8 +1762,8 @@ const getTokensViewportEmbedded = (langageId, lines, lineCache, linesWithEmbed)
1760
1762
  }
1761
1763
  }
1762
1764
  return {
1763
- tokenizersToLoad,
1764
- embeddedResults
1765
+ embeddedResults,
1766
+ tokenizersToLoad
1765
1767
  };
1766
1768
  };
1767
1769
  const getTokenizeEndIndex = (invalidStartIndex, endLineIndex, tokenizeStartIndex) => {
@@ -1772,16 +1774,16 @@ const getTokenizeEndIndex = (invalidStartIndex, endLineIndex, tokenizeStartIndex
1772
1774
  const getTokensViewport = (editor, startLineIndex, endLineIndex) => {
1773
1775
  const {
1774
1776
  invalidStartIndex,
1777
+ languageId,
1775
1778
  lineCache,
1776
- tokenizerId,
1777
1779
  lines,
1778
- languageId
1780
+ tokenizerId
1779
1781
  } = editor;
1780
1782
  const tokenizer = get$2(tokenizerId);
1781
1783
  const {
1782
1784
  hasArrayReturn,
1783
- tokenizeLine,
1784
- initialLineState
1785
+ initialLineState,
1786
+ tokenizeLine
1785
1787
  } = tokenizer;
1786
1788
  const tokenizeStartIndex = invalidStartIndex;
1787
1789
  const tokenizeEndIndex = getTokenizeEndIndex(invalidStartIndex, endLineIndex, tokenizeStartIndex);
@@ -1802,22 +1804,22 @@ const getTokensViewport = (editor, startLineIndex, endLineIndex) => {
1802
1804
  const visibleLines = lineCache.slice(startLineIndex + 1, endLineIndex + 1);
1803
1805
  if (linesWithEmbed.length > 0) {
1804
1806
  const {
1805
- tokenizersToLoad,
1806
- embeddedResults
1807
+ embeddedResults,
1808
+ tokenizersToLoad
1807
1809
  } = getTokensViewportEmbedded(languageId, lines, lineCache, linesWithEmbed);
1808
1810
  // TODO support lineCache with embedded content
1809
1811
  editor.invalidStartIndex = 0;
1810
1812
  return {
1811
- tokens: visibleLines,
1813
+ embeddedResults,
1812
1814
  tokenizersToLoad,
1813
- embeddedResults
1815
+ tokens: visibleLines
1814
1816
  };
1815
1817
  }
1816
1818
  editor.invalidStartIndex = Math.max(invalidStartIndex, tokenizeEndIndex);
1817
1819
  return {
1818
- tokens: visibleLines,
1820
+ embeddedResults,
1819
1821
  tokenizersToLoad,
1820
- embeddedResults
1822
+ tokens: visibleLines
1821
1823
  };
1822
1824
  };
1823
1825
 
@@ -1828,10 +1830,10 @@ const getTokensViewport2 = async (editor, startLineIndex, endLineIndex, syncIncr
1828
1830
  if (getEnabled$1()) {
1829
1831
  if (syncIncremental) {
1830
1832
  const {
1833
+ id,
1831
1834
  invalidStartIndex,
1832
- lines,
1833
1835
  languageId,
1834
- id
1836
+ lines
1835
1837
  } = editor;
1836
1838
  let hasLinesToSend = true;
1837
1839
  let linesToSend = lines;
@@ -1842,8 +1844,8 @@ const getTokensViewport2 = async (editor, startLineIndex, endLineIndex, syncIncr
1842
1844
  sentLines[id] = lines;
1843
1845
  }
1844
1846
  const slimEditor = {
1845
- languageId,
1846
- invalidStartIndex
1847
+ invalidStartIndex,
1848
+ languageId
1847
1849
  };
1848
1850
  return invoke$8('GetTokensViewport.getTokensViewport', slimEditor,
1849
1851
  // @ts-ignore
@@ -2060,8 +2062,8 @@ const positionAt = (textDocument, offset) => {
2060
2062
  columnIndex = currentOffset - offset;
2061
2063
  }
2062
2064
  return {
2063
- rowIndex,
2064
- columnIndex
2065
+ columnIndex,
2066
+ rowIndex
2065
2067
  };
2066
2068
  };
2067
2069
 
@@ -2116,8 +2118,8 @@ const getStartDefaults = (tokens, minOffset) => {
2116
2118
  }
2117
2119
  }
2118
2120
  return {
2119
- start,
2120
2121
  end,
2122
+ start,
2121
2123
  startIndex
2122
2124
  };
2123
2125
  };
@@ -2128,9 +2130,9 @@ const getLineInfoEmbeddedFull = (embeddedResults, tokenResults, line, normalize,
2128
2130
  const embeddedTokenMap = embeddedResult.TokenMap;
2129
2131
  const tokensLength = embeddedTokens.length;
2130
2132
  let {
2131
- startIndex,
2133
+ end,
2132
2134
  start,
2133
- end
2135
+ startIndex
2134
2136
  } = getStartDefaults(embeddedTokens, minOffset);
2135
2137
  const difference = getDifference(start, averageCharWidth, deltaX);
2136
2138
  for (let i = startIndex; i < tokensLength; i += 2) {
@@ -2147,8 +2149,8 @@ const getLineInfoEmbeddedFull = (embeddedResults, tokenResults, line, normalize,
2147
2149
  }
2148
2150
  }
2149
2151
  return {
2150
- lineInfo,
2151
- difference
2152
+ difference,
2153
+ lineInfo
2152
2154
  };
2153
2155
  };
2154
2156
  const getOffsets = (deltaX, width, averageCharWidth) => {
@@ -2156,15 +2158,15 @@ const getOffsets = (deltaX, width, averageCharWidth) => {
2156
2158
  // and use fast measurements for monospace ascii text
2157
2159
  if (deltaX === 0) {
2158
2160
  return {
2159
- minOffset: 0,
2160
- maxOffset: Math.ceil(width / averageCharWidth)
2161
+ maxOffset: Math.ceil(width / averageCharWidth),
2162
+ minOffset: 0
2161
2163
  };
2162
2164
  }
2163
2165
  const minOffset = Math.ceil(deltaX / averageCharWidth);
2164
2166
  const maxOffset = minOffset + Math.ceil(width / averageCharWidth);
2165
2167
  return {
2166
- minOffset,
2167
- maxOffset
2168
+ maxOffset,
2169
+ minOffset
2168
2170
  };
2169
2171
  };
2170
2172
  const getDifference = (start, averageCharWidth, deltaX) => {
@@ -2185,9 +2187,9 @@ const getLineInfoDefault = (line, tokenResults, embeddedResults, decorations, To
2185
2187
  tokens
2186
2188
  } = tokenResults;
2187
2189
  let {
2188
- startIndex,
2190
+ end,
2189
2191
  start,
2190
- end
2192
+ startIndex
2191
2193
  } = getStartDefaults(tokens, minOffset);
2192
2194
  const difference = getDifference(start, averageCharWidth, deltaX);
2193
2195
  const tokensLength = tokens.length;
@@ -2220,14 +2222,14 @@ const getLineInfoDefault = (line, tokenResults, embeddedResults, decorations, To
2220
2222
  }
2221
2223
  }
2222
2224
  return {
2223
- lineInfo,
2224
- difference
2225
+ difference,
2226
+ lineInfo
2225
2227
  };
2226
2228
  };
2227
2229
  const getLineInfo$1 = (line, tokenResults, embeddedResults, decorations, TokenMap, lineOffset, normalize, tabSize, width, deltaX, averageCharWidth) => {
2228
2230
  const {
2229
- minOffset,
2230
- maxOffset
2231
+ maxOffset,
2232
+ minOffset
2231
2233
  } = getOffsets(deltaX, width, averageCharWidth);
2232
2234
  if (embeddedResults.length > 0 && tokenResults.embeddedResultIndex !== undefined) {
2233
2235
  const embeddedResult = embeddedResults[tokenResults.embeddedResultIndex];
@@ -2243,9 +2245,9 @@ const getLineInfosViewport = (editor, tokens, embeddedResults, minLineY, maxLine
2243
2245
  const result = [];
2244
2246
  const differences = [];
2245
2247
  const {
2246
- lines,
2247
2248
  decorations,
2248
- languageId
2249
+ languageId,
2250
+ lines
2249
2251
  } = editor;
2250
2252
  const tokenMap = get$3(languageId);
2251
2253
  let offset = minLineOffset;
@@ -2254,16 +2256,16 @@ const getLineInfosViewport = (editor, tokens, embeddedResults, minLineY, maxLine
2254
2256
  const line = lines[i];
2255
2257
  const normalize = shouldNormalizeText(line);
2256
2258
  const {
2257
- lineInfo,
2258
- difference
2259
+ difference,
2260
+ lineInfo
2259
2261
  } = getLineInfo$1(line, tokens[i - minLineY], embeddedResults, decorations, tokenMap, offset, normalize, tabSize, width, deltaX, averageCharWidth);
2260
2262
  result.push(lineInfo);
2261
2263
  differences.push(difference);
2262
2264
  offset += line.length + 1;
2263
2265
  }
2264
2266
  return {
2265
- result,
2266
- differences
2267
+ differences,
2268
+ result
2267
2269
  };
2268
2270
  };
2269
2271
  const getVisible$1 = async (editor, syncIncremental) => {
@@ -2273,32 +2275,32 @@ const getVisible$1 = async (editor, syncIncremental) => {
2273
2275
  // editor.invalidStartIndex = changes[0].start.rowIndex
2274
2276
  // @ts-ignore
2275
2277
  const {
2278
+ charWidth,
2279
+ deltaX,
2280
+ lines,
2276
2281
  minLineY,
2277
2282
  numberOfVisibleLines,
2278
- lines,
2279
- width,
2280
- deltaX,
2281
- charWidth
2283
+ width
2282
2284
  } = editor;
2283
2285
  const maxLineY = Math.min(minLineY + numberOfVisibleLines, lines.length);
2284
2286
  // @ts-ignore
2285
2287
  const {
2286
- tokens,
2288
+ embeddedResults,
2287
2289
  tokenizersToLoad,
2288
- embeddedResults
2290
+ tokens
2289
2291
  } = await getTokensViewport2(editor, minLineY, maxLineY, syncIncremental);
2290
2292
  const minLineOffset = offsetAtSync(editor, minLineY, 0);
2291
2293
  const averageCharWidth = charWidth;
2292
2294
  const {
2293
- result,
2294
- differences
2295
+ differences,
2296
+ result
2295
2297
  } = getLineInfosViewport(editor, tokens, embeddedResults, minLineY, maxLineY, minLineOffset, width, deltaX, averageCharWidth);
2296
2298
  if (tokenizersToLoad.length > 0) {
2297
2299
  loadTokenizers(tokenizersToLoad);
2298
2300
  }
2299
2301
  return {
2300
- textInfos: result,
2301
- differences
2302
+ differences,
2303
+ textInfos: result
2302
2304
  };
2303
2305
  };
2304
2306
 
@@ -2327,21 +2329,21 @@ const getNewDeltaPercent = (height, scrollBarHeight, relativeY) => {
2327
2329
  if (relativeY <= halfScrollBarHeight) {
2328
2330
  // clicked at top
2329
2331
  return {
2330
- percent: 0,
2331
- handleOffset: relativeY
2332
+ handleOffset: relativeY,
2333
+ percent: 0
2332
2334
  };
2333
2335
  }
2334
2336
  if (relativeY <= height - halfScrollBarHeight) {
2335
2337
  // clicked in middle
2336
2338
  return {
2337
- percent: (relativeY - halfScrollBarHeight) / (height - scrollBarHeight),
2338
- handleOffset: halfScrollBarHeight
2339
+ handleOffset: halfScrollBarHeight,
2340
+ percent: (relativeY - halfScrollBarHeight) / (height - scrollBarHeight)
2339
2341
  };
2340
2342
  }
2341
2343
  // clicked at bottom
2342
2344
  return {
2343
- percent: 1,
2344
- handleOffset: scrollBarHeight - height + relativeY
2345
+ handleOffset: scrollBarHeight - height + relativeY,
2346
+ percent: 1
2345
2347
  };
2346
2348
  };
2347
2349
 
@@ -2358,12 +2360,12 @@ const setDeltaY$2 = async (state, value) => {
2358
2360
  object(state);
2359
2361
  number(value);
2360
2362
  const {
2361
- finalDeltaY,
2362
2363
  deltaY,
2363
- numberOfVisibleLines,
2364
+ finalDeltaY,
2364
2365
  height,
2365
- scrollBarHeight,
2366
- itemHeight
2366
+ itemHeight,
2367
+ numberOfVisibleLines,
2368
+ scrollBarHeight
2367
2369
  } = state;
2368
2370
  const newDeltaY = clamp(value, 0, finalDeltaY);
2369
2371
  if (deltaY === newDeltaY) {
@@ -2374,20 +2376,20 @@ const setDeltaY$2 = async (state, value) => {
2374
2376
  const scrollBarY = getScrollBarY(newDeltaY, finalDeltaY, height, scrollBarHeight);
2375
2377
  const newEditor1 = {
2376
2378
  ...state,
2377
- minLineY: newMinLineY,
2378
- maxLineY: newMaxLineY,
2379
2379
  deltaY: newDeltaY,
2380
+ maxLineY: newMaxLineY,
2381
+ minLineY: newMinLineY,
2380
2382
  scrollBarY
2381
2383
  };
2382
2384
  const syncIncremental = getEnabled();
2383
2385
  const {
2384
- textInfos,
2385
- differences
2386
+ differences,
2387
+ textInfos
2386
2388
  } = await getVisible$1(newEditor1, syncIncremental);
2387
2389
  const newEditor2 = {
2388
2390
  ...newEditor1,
2389
- textInfos,
2390
- differences
2391
+ differences,
2392
+ textInfos
2391
2393
  };
2392
2394
  return newEditor2;
2393
2395
  };
@@ -2578,8 +2580,8 @@ const from = (array, getSelection) => {
2578
2580
  let i = 0;
2579
2581
  for (const item of array) {
2580
2582
  const {
2581
- start,
2582
- end
2583
+ end,
2584
+ start
2583
2585
  } = getSelection(item);
2584
2586
  newSelections[i++] = start.rowIndex;
2585
2587
  newSelections[i++] = start.columnIndex;
@@ -2631,22 +2633,22 @@ const getVisible = async editor => {
2631
2633
  // // TODO binary search
2632
2634
 
2633
2635
  const {
2634
- selections,
2635
- minLineY,
2636
- maxLineY,
2637
- rowHeight,
2638
- lines,
2639
- fontSize,
2636
+ charWidth,
2637
+ cursorWidth,
2638
+ differences,
2639
+ focused,
2640
2640
  fontFamily,
2641
+ fontSize,
2641
2642
  fontWeight,
2643
+ isMonospaceFont,
2642
2644
  letterSpacing,
2643
- cursorWidth,
2645
+ lines,
2646
+ maxLineY,
2647
+ minLineY,
2648
+ rowHeight,
2649
+ selections,
2644
2650
  tabSize,
2645
- width,
2646
- differences,
2647
- focused,
2648
- charWidth,
2649
- isMonospaceFont
2651
+ width
2650
2652
  } = editor;
2651
2653
  const averageCharWidth = charWidth;
2652
2654
  const halfCursorWidth = cursorWidth / 2;
@@ -2716,29 +2718,29 @@ const getVisible = async editor => {
2716
2718
 
2717
2719
  const getSelectionFromChange = change => {
2718
2720
  const {
2719
- start,
2720
- inserted
2721
+ inserted,
2722
+ start
2721
2723
  } = change;
2722
2724
  const startRowIndex = start.rowIndex;
2723
2725
  const startColumnIndex = start.columnIndex;
2724
2726
  const insertedLength = inserted.length;
2725
2727
  if (insertedLength === 1) {
2726
2728
  const newPosition = {
2727
- rowIndex: startRowIndex + insertedLength - 1,
2728
- columnIndex: inserted.at(-1).length + startColumnIndex
2729
+ columnIndex: inserted.at(-1).length + startColumnIndex,
2730
+ rowIndex: startRowIndex + insertedLength - 1
2729
2731
  };
2730
2732
  return {
2731
- start: newPosition,
2732
- end: newPosition
2733
+ end: newPosition,
2734
+ start: newPosition
2733
2735
  };
2734
2736
  }
2735
2737
  const newPosition = {
2736
- rowIndex: startRowIndex + insertedLength - 1,
2737
- columnIndex: startColumnIndex
2738
+ columnIndex: startColumnIndex,
2739
+ rowIndex: startRowIndex + insertedLength - 1
2738
2740
  };
2739
2741
  return {
2740
- start: newPosition,
2741
- end: newPosition
2742
+ end: newPosition,
2743
+ start: newPosition
2742
2744
  };
2743
2745
  };
2744
2746
  const setSelections$1 = (editor, selections) => {
@@ -2836,11 +2838,11 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
2836
2838
  const autoClosingRanges = applyAutoClosingRangesEdit(editor, changes);
2837
2839
  const newEditor = {
2838
2840
  ...partialNewEditor,
2841
+ autoClosingRanges,
2842
+ invalidStartIndex,
2839
2843
  lines: newLines,
2840
2844
  selections: newSelections,
2841
- undoStack: [...editor.undoStack, changes],
2842
- invalidStartIndex,
2843
- autoClosingRanges
2845
+ undoStack: [...editor.undoStack, changes]
2844
2846
  };
2845
2847
  set$6(editor.uid, editor, newEditor);
2846
2848
  const incrementalEdits = await getIncrementalEdits(editor, newEditor);
@@ -2855,13 +2857,13 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
2855
2857
  }
2856
2858
  const syncIncremental = getEnabled();
2857
2859
  const {
2858
- textInfos,
2859
- differences
2860
+ differences,
2861
+ textInfos
2860
2862
  } = await getVisible$1(newEditor2, syncIncremental);
2861
2863
  return {
2862
2864
  ...newEditor2,
2863
- textInfos,
2864
- differences
2865
+ differences,
2866
+ textInfos
2865
2867
  };
2866
2868
  };
2867
2869
  // @ts-ignore
@@ -2880,10 +2882,10 @@ const scheduleDocumentAndCursorsSelectionIsUndo = async (editor, changes) => {
2880
2882
  const invalidStartIndex = Math.min(editor.invalidStartIndex, changes[0].start.rowIndex);
2881
2883
  const newEditor = {
2882
2884
  ...partialNewEditor,
2883
- lines: newLines,
2884
- selections: newSelections,
2885
2885
  // undoStack: [...editor.undoStack.slice(0, -2)],
2886
- invalidStartIndex
2886
+ invalidStartIndex,
2887
+ lines: newLines,
2888
+ selections: newSelections
2887
2889
  };
2888
2890
  const incrementalEdits = await getIncrementalEdits(editor, newEditor);
2889
2891
 
@@ -2897,13 +2899,13 @@ const scheduleDocumentAndCursorsSelectionIsUndo = async (editor, changes) => {
2897
2899
  }
2898
2900
  const syncIncremental = getEnabled();
2899
2901
  const {
2900
- textInfos,
2901
- differences
2902
+ differences,
2903
+ textInfos
2902
2904
  } = await getVisible$1(finalEditor, syncIncremental);
2903
2905
  return {
2904
2906
  ...finalEditor,
2905
- textInfos,
2906
- differences
2907
+ differences,
2908
+ textInfos
2907
2909
  };
2908
2910
  };
2909
2911
 
@@ -2925,9 +2927,9 @@ const scheduleDocument = async (editor, changes) => {
2925
2927
 
2926
2928
  const newEditor = {
2927
2929
  ...editor,
2928
- undoStack: [...editor.undoStack, changes],
2930
+ invalidStartIndex,
2929
2931
  lines: newLines,
2930
- invalidStartIndex
2932
+ undoStack: [...editor.undoStack, changes]
2931
2933
  };
2932
2934
  const incrementalEdits = await getIncrementalEdits(editor, newEditor);
2933
2935
 
@@ -2941,13 +2943,13 @@ const scheduleDocument = async (editor, changes) => {
2941
2943
  }
2942
2944
  const syncIncremental = getEnabled();
2943
2945
  const {
2944
- textInfos,
2945
- differences
2946
+ differences,
2947
+ textInfos
2946
2948
  } = await getVisible$1(finalEditor, syncIncremental);
2947
2949
  return {
2948
2950
  ...finalEditor,
2949
- textInfos,
2950
- differences
2951
+ differences,
2952
+ textInfos
2951
2953
  };
2952
2954
  // RendererProcess.send([
2953
2955
  // /* Viewlet.invoke */ 'Viewlet.send',
@@ -2975,23 +2977,23 @@ const setBounds = (editor, x, y, width, height, columnWidth) => {
2975
2977
  const finalDeltaY = finalY * itemHeight;
2976
2978
  return {
2977
2979
  ...editor,
2978
- x,
2979
- y,
2980
- width,
2981
- height,
2982
2980
  columnWidth,
2983
- numberOfVisibleLines,
2984
- maxLineY,
2981
+ finalDeltaY,
2985
2982
  finalY,
2986
- finalDeltaY
2983
+ height,
2984
+ maxLineY,
2985
+ numberOfVisibleLines,
2986
+ width,
2987
+ x,
2988
+ y
2987
2989
  };
2988
2990
  };
2989
2991
  const setText = (editor, text) => {
2990
2992
  const lines = splitLines(text);
2991
2993
  const {
2992
2994
  itemHeight,
2993
- numberOfVisibleLines,
2994
- minimumSliderSize
2995
+ minimumSliderSize,
2996
+ numberOfVisibleLines
2995
2997
  } = editor;
2996
2998
  const total = lines.length;
2997
2999
  const maxLineY = Math.min(numberOfVisibleLines, total);
@@ -3001,42 +3003,42 @@ const setText = (editor, text) => {
3001
3003
  const scrollBarHeight = getScrollBarSize(editor.height, contentHeight, minimumSliderSize);
3002
3004
  return {
3003
3005
  ...editor,
3006
+ finalDeltaY,
3007
+ finalY,
3004
3008
  lines,
3005
3009
  maxLineY,
3006
- finalY,
3007
- finalDeltaY,
3008
3010
  scrollBarHeight
3009
3011
  };
3010
3012
  };
3011
3013
 
3012
3014
  const emptyEditor = {
3013
- textInfos: [],
3015
+ debugEnabled: false,
3016
+ decorations: [],
3017
+ deltaX: 0,
3018
+ deltaY: 0,
3019
+ diagnostics: [],
3014
3020
  differences: [],
3015
- uri: '',
3021
+ embeds: [],
3022
+ focused: false,
3023
+ height: 0,
3024
+ highlightedLine: -1,
3025
+ incrementalEdits: emptyIncrementalEdits,
3016
3026
  languageId: '',
3017
3027
  // TODO use numeric language id?
3028
+ lineCache: [],
3018
3029
  lines: [],
3019
- x: 0,
3020
- y: 0,
3021
- width: 0,
3022
- height: 0,
3023
- tokenizerId: 0,
3024
- minLineY: 0,
3025
- decorations: [],
3026
- embeds: [],
3027
- deltaX: 0,
3028
- focused: false,
3029
- deltaY: 0,
3030
- scrollBarHeight: 0,
3031
3030
  longestLineWidth: 0,
3032
3031
  maxLineY: 0,
3033
- undoStack: [],
3034
- lineCache: [],
3032
+ minLineY: 0,
3033
+ scrollBarHeight: 0,
3035
3034
  selections: new Uint32Array(),
3036
- diagnostics: [],
3037
- highlightedLine: -1,
3038
- debugEnabled: false,
3039
- incrementalEdits: emptyIncrementalEdits
3035
+ textInfos: [],
3036
+ tokenizerId: 0,
3037
+ undoStack: [],
3038
+ uri: '',
3039
+ width: 0,
3040
+ x: 0,
3041
+ y: 0
3040
3042
  };
3041
3043
 
3042
3044
  const HoverExecute = 'ExtensionHostHover.execute';
@@ -3044,8 +3046,9 @@ const TabCompletionExecuteTabCompletionProvider = 'ExtensionHost.executeTabCompl
3044
3046
  const TextDocumentSyncFull = 'ExtensionHostTextDocument.syncFull';
3045
3047
 
3046
3048
  const {
3047
- set: set$1,
3048
- invoke: invoke$6} = ExtensionHost;
3049
+ invoke: invoke$6,
3050
+ set: set$1
3051
+ } = ExtensionHost;
3049
3052
 
3050
3053
  const ColorPicker = 41;
3051
3054
  const EditorCompletion = 9;
@@ -3128,8 +3131,8 @@ const OnHover = 'onHover';
3128
3131
  const OnTabCompletion = 'onTabCompletion';
3129
3132
 
3130
3133
  const execute = async ({
3131
- editor,
3132
3134
  args,
3135
+ editor,
3133
3136
  event,
3134
3137
  method,
3135
3138
  noProviderFoundMessage,
@@ -3143,10 +3146,10 @@ const execute = async ({
3143
3146
 
3144
3147
  const executeDiagnosticProvider = editor => {
3145
3148
  return execute({
3149
+ args: [],
3146
3150
  editor,
3147
3151
  event: OnDiagnostic,
3148
3152
  method: 'ExtensionHost.executeDiagnosticProvider',
3149
- args: [],
3150
3153
  noProviderFoundMessage: 'no diagnostic provider found'});
3151
3154
  };
3152
3155
 
@@ -3157,23 +3160,23 @@ const getDiagnosticType = diagnostic => {
3157
3160
  const getVisibleDiagnostics = async (editor, diagnostics) => {
3158
3161
  const visibleDiagnostics = [];
3159
3162
  const {
3160
- width,
3161
- rowHeight,
3162
- minLineY,
3163
3163
  charWidth,
3164
- letterSpacing,
3165
- lines,
3166
- fontWeight,
3167
- fontSize,
3168
3164
  fontFamily,
3165
+ fontSize,
3166
+ fontWeight,
3169
3167
  isMonospaceFont,
3170
- tabSize
3168
+ letterSpacing,
3169
+ lines,
3170
+ minLineY,
3171
+ rowHeight,
3172
+ tabSize,
3173
+ width
3171
3174
  } = editor;
3172
3175
  for (const diagnostic of diagnostics) {
3173
3176
  const {
3174
- rowIndex,
3175
3177
  columnIndex,
3176
- endColumnIndex
3178
+ endColumnIndex,
3179
+ rowIndex
3177
3180
  } = diagnostic;
3178
3181
  const columnDelta = endColumnIndex - columnIndex;
3179
3182
  const diagnosticWidth = columnDelta * charWidth;
@@ -3182,11 +3185,11 @@ const getVisibleDiagnostics = async (editor, diagnostics) => {
3182
3185
  const x = await getX(lines[rowIndex], columnIndex, fontWeight, fontSize, fontFamily, isMonospaceFont, letterSpacing, tabSize, halfCursorWidth, width, charWidth, endLineDifference);
3183
3186
  const y = getY(rowIndex, minLineY, rowHeight) - rowHeight;
3184
3187
  visibleDiagnostics.push({
3185
- x,
3186
- y,
3187
- width: diagnosticWidth,
3188
3188
  height: rowHeight,
3189
- type: getDiagnosticType(diagnostic)
3189
+ type: getDiagnosticType(diagnostic),
3190
+ width: diagnosticWidth,
3191
+ x,
3192
+ y
3190
3193
  });
3191
3194
  }
3192
3195
  return visibleDiagnostics;
@@ -3214,8 +3217,8 @@ const updateDiagnostics = async newState => {
3214
3217
  const decorations = await getVisibleDiagnostics(latest.newState, diagnostics);
3215
3218
  const newEditor = {
3216
3219
  ...latest.newState,
3217
- diagnostics,
3218
- decorations
3220
+ decorations,
3221
+ diagnostics
3219
3222
  };
3220
3223
  set$6(newState.id, latest.oldState, newEditor);
3221
3224
  // @ts-ignore
@@ -3232,35 +3235,35 @@ const updateDiagnostics = async newState => {
3232
3235
  };
3233
3236
 
3234
3237
  const createEditor = async ({
3235
- id,
3238
+ columnToReveal,
3239
+ completionTriggerCharacters,
3236
3240
  content,
3237
- savedDeltaY,
3238
- rowHeight,
3241
+ diagnosticsEnabled,
3242
+ fontFamily,
3239
3243
  fontSize,
3240
- hoverEnabled,
3241
- letterSpacing,
3242
- tabSize,
3243
- links,
3244
- lineNumbers,
3244
+ fontWeight,
3245
3245
  formatOnSave,
3246
+ height,
3247
+ hoverEnabled,
3248
+ id,
3246
3249
  isAutoClosingBracketsEnabled,
3247
- isAutoClosingTagsEnabled,
3248
3250
  isAutoClosingQuotesEnabled,
3251
+ isAutoClosingTagsEnabled,
3252
+ isMonospaceFont,
3249
3253
  isQuickSuggestionsEnabled,
3250
- completionTriggerCharacters,
3251
- savedSelections,
3252
3254
  languageId,
3253
- x,
3254
- y,
3255
- width,
3256
- height,
3257
- fontWeight,
3258
- fontFamily,
3259
- isMonospaceFont,
3260
- uri,
3261
- diagnosticsEnabled,
3255
+ letterSpacing,
3256
+ lineNumbers,
3262
3257
  lineToReveal,
3263
- columnToReveal
3258
+ links,
3259
+ rowHeight,
3260
+ savedDeltaY,
3261
+ savedSelections,
3262
+ tabSize,
3263
+ uri,
3264
+ width,
3265
+ x,
3266
+ y
3264
3267
  }) => {
3265
3268
  number(id);
3266
3269
  string(content);
@@ -3342,15 +3345,15 @@ const createEditor = async ({
3342
3345
  }
3343
3346
  const syncIncremental = getEnabled();
3344
3347
  const {
3345
- textInfos,
3346
- differences
3348
+ differences,
3349
+ textInfos
3347
3350
  } = await getVisible$1(newEditor3, syncIncremental);
3348
3351
  const newEditor4 = {
3349
3352
  ...newEditor3,
3350
- focused: true,
3353
+ differences,
3351
3354
  focus: FocusEditorText$1,
3352
- textInfos,
3353
- differences
3355
+ focused: true,
3356
+ textInfos
3354
3357
  };
3355
3358
  set$6(id, emptyEditor, newEditor4);
3356
3359
 
@@ -3418,8 +3421,8 @@ const getNewSelections$b = (selections, linesLength) => {
3418
3421
  // @ts-ignore
3419
3422
  const addCursorBelow = editor => {
3420
3423
  const {
3421
- selections,
3422
- lines
3424
+ lines,
3425
+ selections
3423
3426
  } = editor;
3424
3427
  const newSelections = getNewSelections$b(selections, lines.length);
3425
3428
  return {
@@ -3434,15 +3437,15 @@ const getDocumentEdits = (editor, edits) => {
3434
3437
  const start = positionAt(editor, edit.startOffset);
3435
3438
  const end = positionAt(editor, edit.endOffset);
3436
3439
  const deleted = getSelectionText(editor, {
3437
- start,
3438
- end
3440
+ end,
3441
+ start
3439
3442
  });
3440
3443
  const documentEdit = {
3441
- start,
3444
+ deleted,
3442
3445
  end,
3443
3446
  inserted: splitLines(edit.inserted),
3444
- deleted,
3445
- origin: Format
3447
+ origin: Format,
3448
+ start
3446
3449
  };
3447
3450
  if (documentEdit.inserted.length === 0) {
3448
3451
  documentEdit.inserted = [''];
@@ -3487,15 +3490,15 @@ const getTextChanges = (editor, changes) => {
3487
3490
  const startPosition = positionAt(editor, edit.offset);
3488
3491
  const endPosition = positionAt(editor, edit.offset + edit.deleted);
3489
3492
  const deleted = getSelectionText(editor, {
3490
- start: startPosition,
3491
- end: endPosition
3493
+ end: endPosition,
3494
+ start: startPosition
3492
3495
  });
3493
3496
  const textChange = {
3494
- start: startPosition,
3497
+ deleted,
3495
3498
  end: endPosition,
3496
3499
  inserted: [edit.inserted],
3497
- deleted,
3498
- origin: Rename
3500
+ origin: Rename,
3501
+ start: startPosition
3499
3502
  };
3500
3503
  textChanges.push(textChange);
3501
3504
  }
@@ -3536,23 +3539,23 @@ const replaceRange = (editor, ranges, replacement, origin) => {
3536
3539
  for (let i = 0; i < rangesLength; i += 4) {
3537
3540
  const [selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn] = getSelectionPairs(ranges, i);
3538
3541
  const start = {
3539
- rowIndex: selectionStartRow,
3540
- columnIndex: selectionStartColumn
3542
+ columnIndex: selectionStartColumn,
3543
+ rowIndex: selectionStartRow
3541
3544
  };
3542
3545
  const end = {
3543
- rowIndex: selectionEndRow,
3544
- columnIndex: selectionEndColumn
3546
+ columnIndex: selectionEndColumn,
3547
+ rowIndex: selectionEndRow
3545
3548
  };
3546
3549
  const selection = {
3547
- start,
3548
- end
3550
+ end,
3551
+ start
3549
3552
  };
3550
3553
  changes.push({
3551
- start: start,
3554
+ deleted: getSelectionText(editor, selection),
3552
3555
  end: end,
3553
3556
  inserted: replacement,
3554
- deleted: getSelectionText(editor, selection),
3555
- origin
3557
+ origin,
3558
+ start: start
3556
3559
  });
3557
3560
  }
3558
3561
  return changes;
@@ -3586,30 +3589,30 @@ const create$8 = () => {
3586
3589
  const segments = segmenter.segment(line);
3587
3590
  return segments.containing(index);
3588
3591
  },
3589
- visualIndex(line, index) {
3592
+ getSegments(line) {
3593
+ return segmenter.segment(line);
3594
+ },
3595
+ modelIndex(line, visualIndex) {
3590
3596
  const segments = segmenter.segment(line);
3591
3597
  let currentVisualIndex = 0;
3592
3598
  for (const segment of segments) {
3593
- if (segment.index >= index) {
3594
- return currentVisualIndex;
3599
+ if (currentVisualIndex >= visualIndex) {
3600
+ return segment.index;
3595
3601
  }
3596
3602
  currentVisualIndex++;
3597
3603
  }
3598
- return currentVisualIndex;
3604
+ return line.length;
3599
3605
  },
3600
- modelIndex(line, visualIndex) {
3606
+ visualIndex(line, index) {
3601
3607
  const segments = segmenter.segment(line);
3602
3608
  let currentVisualIndex = 0;
3603
3609
  for (const segment of segments) {
3604
- if (currentVisualIndex >= visualIndex) {
3605
- return segment.index;
3610
+ if (segment.index >= index) {
3611
+ return currentVisualIndex;
3606
3612
  }
3607
3613
  currentVisualIndex++;
3608
3614
  }
3609
- return line.length;
3610
- },
3611
- getSegments(line) {
3612
- return segmenter.segment(line);
3615
+ return currentVisualIndex;
3613
3616
  }
3614
3617
  };
3615
3618
  };
@@ -3673,31 +3676,31 @@ const at = async (editor, eventX, eventY) => {
3673
3676
  number(eventX);
3674
3677
  number(eventY);
3675
3678
  const {
3676
- y,
3679
+ charWidth,
3677
3680
  deltaY,
3678
- rowHeight,
3681
+ fontFamily,
3679
3682
  fontSize,
3680
3683
  fontWeight,
3681
- fontFamily,
3684
+ isMonospaceFont,
3682
3685
  letterSpacing,
3683
3686
  lines,
3687
+ rowHeight,
3684
3688
  tabSize,
3685
- isMonospaceFont,
3686
- charWidth
3689
+ y
3687
3690
  } = editor;
3688
3691
  const rowIndex = Math.floor((eventY - y + deltaY) / rowHeight);
3689
3692
  if (rowIndex < 0) {
3690
3693
  return {
3691
- rowIndex: 0,
3692
- columnIndex: 0
3694
+ columnIndex: 0,
3695
+ rowIndex: 0
3693
3696
  };
3694
3697
  }
3695
3698
  const clampedRowIndex = clamp(rowIndex, 0, lines.length - 1);
3696
3699
  const line = lines[clampedRowIndex];
3697
3700
  const columnIndex = await getAccurateColumnIndex(line, fontWeight, fontSize, fontFamily, letterSpacing, isMonospaceFont, charWidth, tabSize, eventX);
3698
3701
  return {
3699
- rowIndex: clampedRowIndex,
3700
- columnIndex
3702
+ columnIndex,
3703
+ rowIndex: clampedRowIndex
3701
3704
  };
3702
3705
  };
3703
3706
 
@@ -3792,12 +3795,12 @@ const getErrorMessage$4 = error => {
3792
3795
  // @ts-ignore
3793
3796
  const getMatchingClosingBrace$1 = brace => {
3794
3797
  switch (brace) {
3795
- case '{':
3796
- return '}';
3797
3798
  case '(':
3798
3799
  return ')';
3799
3800
  case '[':
3800
3801
  return ']';
3802
+ case '{':
3803
+ return '}';
3801
3804
  default:
3802
3805
  return '???';
3803
3806
  }
@@ -3865,8 +3868,8 @@ const closeCodeGenerator = editor => {
3865
3868
  const newWidgets = removeEditorWidget(widgets, CodeGenerator);
3866
3869
  return {
3867
3870
  ...editor,
3868
- widgets: newWidgets,
3869
- focused: true
3871
+ focused: true,
3872
+ widgets: newWidgets
3870
3873
  };
3871
3874
  };
3872
3875
 
@@ -3884,8 +3887,8 @@ const closeFind = editor => {
3884
3887
  const newWidgets = removeEditorWidget(widgets, Find);
3885
3888
  return {
3886
3889
  ...editor,
3887
- widgets: newWidgets,
3888
- focused: true
3890
+ focused: true,
3891
+ widgets: newWidgets
3889
3892
  };
3890
3893
  };
3891
3894
 
@@ -3915,8 +3918,8 @@ const isRenameWidget = widget => {
3915
3918
  };
3916
3919
  const closeRename = async editor => {
3917
3920
  const {
3918
- widgets,
3919
- uid
3921
+ uid,
3922
+ widgets
3920
3923
  } = editor;
3921
3924
  const renameWidgetIndex = widgets.findIndex(isRenameWidget);
3922
3925
  if (renameWidgetIndex === -1) {
@@ -3979,10 +3982,10 @@ const addWidgetToEditor = async (widgetId, focusKey, editor, factory, newStateGe
3979
3982
  const newFocus = !fullFocus;
3980
3983
  const newEditor = {
3981
3984
  ...editor,
3982
- widgets: newWidgets,
3983
- focused: newFocus,
3985
+ additionalFocus: fullFocus ? 0 : focusKey,
3984
3986
  focus: fullFocus ? focusKey : FocusEditorText$1,
3985
- additionalFocus: fullFocus ? 0 : focusKey
3987
+ focused: newFocus,
3988
+ widgets: newWidgets
3986
3989
  };
3987
3990
  return newEditor;
3988
3991
  };
@@ -3995,21 +3998,21 @@ const create$6 = () => {
3995
3998
  const completionUid = create$7();
3996
3999
  const widget = {
3997
4000
  id: ColorPicker$1,
3998
- oldState: {
4001
+ newState: {
4002
+ commands: [],
4003
+ height: 0,
3999
4004
  uid: completionUid,
4000
- x: 0,
4001
- y: 0,
4002
4005
  width: 0,
4003
- height: 0,
4004
- commands: []
4006
+ x: 0,
4007
+ y: 0
4005
4008
  },
4006
- newState: {
4009
+ oldState: {
4010
+ commands: [],
4011
+ height: 0,
4007
4012
  uid: completionUid,
4008
- x: 0,
4009
- y: 0,
4010
4013
  width: 0,
4011
- height: 0,
4012
- commands: []
4014
+ x: 0,
4015
+ y: 0
4013
4016
  }
4014
4017
  };
4015
4018
  return widget;
@@ -4023,8 +4026,8 @@ const openColorPicker = async editor => {
4023
4026
  };
4024
4027
 
4025
4028
  const state$4 = {
4026
- isComposing: false,
4027
- compositionText: ''
4029
+ compositionText: '',
4030
+ isComposing: false
4028
4031
  };
4029
4032
  const compositionStart = (editor, event) => {
4030
4033
  state$4.isComposing = true;
@@ -4039,17 +4042,17 @@ const getCompositionChanges = (selections, data) => {
4039
4042
  const selectionEndColumn = selections[i + 3];
4040
4043
  const startColumnIndex = selectionStartColumn - state$4.compositionText.length;
4041
4044
  changes.push({
4042
- start: {
4043
- rowIndex: selectionStartRow,
4044
- columnIndex: startColumnIndex
4045
- },
4045
+ deleted: [state$4.compositionText],
4046
4046
  end: {
4047
- rowIndex: selectionEndRow,
4048
- columnIndex: selectionEndColumn
4047
+ columnIndex: selectionEndColumn,
4048
+ rowIndex: selectionEndRow
4049
4049
  },
4050
4050
  inserted: [data],
4051
- deleted: [state$4.compositionText],
4052
- origin: CompositionUpdate
4051
+ origin: CompositionUpdate,
4052
+ start: {
4053
+ columnIndex: startColumnIndex,
4054
+ rowIndex: selectionStartRow
4055
+ }
4053
4056
  });
4054
4057
  }
4055
4058
  return changes;
@@ -4086,24 +4089,24 @@ const getSelectionRange = (lines, copyFullLine, startRowIndex, startColumnIndex,
4086
4089
  if (copyFullLine) {
4087
4090
  const lineLength = lines[endRowIndex].length;
4088
4091
  return {
4089
- start: {
4090
- rowIndex: startRowIndex,
4091
- columnIndex: 0
4092
- },
4093
4092
  end: {
4094
- rowIndex: startRowIndex,
4095
- columnIndex: lineLength
4093
+ columnIndex: lineLength,
4094
+ rowIndex: startRowIndex
4095
+ },
4096
+ start: {
4097
+ columnIndex: 0,
4098
+ rowIndex: startRowIndex
4096
4099
  }
4097
4100
  };
4098
4101
  }
4099
4102
  return {
4100
- start: {
4101
- rowIndex: startRowIndex,
4102
- columnIndex: startColumnIndex
4103
- },
4104
4103
  end: {
4105
- rowIndex: endRowIndex,
4106
- columnIndex: endColumnIndex
4104
+ columnIndex: endColumnIndex,
4105
+ rowIndex: endRowIndex
4106
+ },
4107
+ start: {
4108
+ columnIndex: startColumnIndex,
4109
+ rowIndex: startRowIndex
4107
4110
  }
4108
4111
  };
4109
4112
  };
@@ -4146,14 +4149,14 @@ const copyLineDown = editor => {
4146
4149
  const rowIndex = selections[0];
4147
4150
  number(rowIndex);
4148
4151
  const position = {
4149
- rowIndex,
4150
- columnIndex: 0
4152
+ columnIndex: 0,
4153
+ rowIndex
4151
4154
  };
4152
4155
  const changes = [{
4153
- start: position,
4156
+ deleted: [''],
4154
4157
  end: position,
4155
4158
  inserted: [getLine(editor, rowIndex), ''],
4156
- deleted: ['']
4159
+ start: position
4157
4160
  }];
4158
4161
  return scheduleDocumentAndCursorsSelections(editor, changes);
4159
4162
  };
@@ -4164,14 +4167,14 @@ const copyLineUp = editor => {
4164
4167
  } = editor;
4165
4168
  const rowIndex = selections[0];
4166
4169
  const position = {
4167
- rowIndex: rowIndex,
4168
- columnIndex: 0
4170
+ columnIndex: 0,
4171
+ rowIndex: rowIndex
4169
4172
  };
4170
4173
  const changes = [{
4171
- start: position,
4174
+ deleted: [''],
4172
4175
  end: position,
4173
4176
  inserted: [getLine(editor, rowIndex), ''],
4174
- deleted: ['']
4177
+ start: position
4175
4178
  }];
4176
4179
  return scheduleDocumentAndCursorsSelections(editor, changes);
4177
4180
  };
@@ -4181,19 +4184,19 @@ const editorGetPositionLeft = (rowIndex, columnIndex, lines, getDelta) => {
4181
4184
  if (columnIndex === 0) {
4182
4185
  if (rowIndex === 0) {
4183
4186
  return {
4184
- rowIndex: 0,
4185
- columnIndex: 0
4187
+ columnIndex: 0,
4188
+ rowIndex: 0
4186
4189
  };
4187
4190
  }
4188
4191
  return {
4189
- rowIndex: rowIndex - 1,
4190
- columnIndex: lines[rowIndex - 1].length
4192
+ columnIndex: lines[rowIndex - 1].length,
4193
+ rowIndex: rowIndex - 1
4191
4194
  };
4192
4195
  }
4193
4196
  const delta = getDelta(lines[rowIndex], columnIndex);
4194
4197
  return {
4195
- rowIndex,
4196
- columnIndex: columnIndex - delta
4198
+ columnIndex: columnIndex - delta,
4199
+ rowIndex
4197
4200
  };
4198
4201
  };
4199
4202
 
@@ -4379,14 +4382,14 @@ const editorGetPositionRight = (position, lines, getDelta) => {
4379
4382
  return position;
4380
4383
  }
4381
4384
  return {
4382
- rowIndex: rowIndex + 1,
4383
- columnIndex: 0
4385
+ columnIndex: 0,
4386
+ rowIndex: rowIndex + 1
4384
4387
  };
4385
4388
  }
4386
4389
  const delta = getDelta(lines[rowIndex], columnIndex);
4387
4390
  return {
4388
- rowIndex,
4389
- columnIndex: columnIndex + delta
4391
+ columnIndex: columnIndex + delta,
4392
+ rowIndex
4390
4393
  };
4391
4394
  };
4392
4395
  const moveToPositionRight = (selections, i, rowIndex, columnIndex, lines, getDelta) => {
@@ -4555,20 +4558,20 @@ const getChanges$5 = (lines, selections, getDelta) => {
4555
4558
  const deleteSelection = (selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn) => {
4556
4559
  const positionLeft = editorGetPositionLeft(selectionStartRow, selectionStartColumn, lines, getDelta);
4557
4560
  const selectionEnd = {
4558
- rowIndex: selectionEndRow,
4559
- columnIndex: selectionEndColumn
4561
+ columnIndex: selectionEndColumn,
4562
+ rowIndex: selectionEndRow
4560
4563
  };
4561
4564
  changes.push({
4562
- start: positionLeft,
4563
- end: selectionEnd,
4564
- inserted: [''],
4565
4565
  deleted: getSelectionText({
4566
4566
  lines
4567
4567
  }, {
4568
- start: positionLeft,
4569
- end: selectionEnd
4568
+ end: selectionEnd,
4569
+ start: positionLeft
4570
4570
  }),
4571
- origin: DeleteLeft
4571
+ end: selectionEnd,
4572
+ inserted: [''],
4573
+ origin: DeleteLeft,
4574
+ start: positionLeft
4572
4575
  });
4573
4576
  };
4574
4577
  forEach(selections, deleteSelection);
@@ -4606,8 +4609,8 @@ const isAllAutoClosingPairDelete = (autoClosingRanges, selections) => {
4606
4609
 
4607
4610
  const deleteLeftWithAutoClose = editor => {
4608
4611
  const {
4609
- selections,
4610
- lines
4612
+ lines,
4613
+ selections
4611
4614
  } = editor;
4612
4615
  for (let i = 0; i < selections.length; i += 4) {
4613
4616
  selections[i + 1]++;
@@ -4619,8 +4622,8 @@ const deleteLeftWithAutoClose = editor => {
4619
4622
  const editorDeleteHorizontalLeft = (editor, getDelta) => {
4620
4623
  const {
4621
4624
  autoClosingRanges = [],
4622
- selections,
4623
- lines
4625
+ lines,
4626
+ selections
4624
4627
  } = editor;
4625
4628
  if (isAllAutoClosingPairDelete(autoClosingRanges, selections)) {
4626
4629
  return deleteLeftWithAutoClose(editor);
@@ -4654,19 +4657,19 @@ const getChanges$4 = (editor, getDelta) => {
4654
4657
  // @ts-ignore
4655
4658
  const [selectionStartRow, selectionStartColumn] = getSelectionPairs(selections, i);
4656
4659
  const start = {
4657
- rowIndex: selectionStartRow,
4658
- columnIndex: selectionStartColumn
4660
+ columnIndex: selectionStartColumn,
4661
+ rowIndex: selectionStartRow
4659
4662
  };
4660
4663
  const positionRight = editorGetPositionRight(start, lines, getDelta);
4661
4664
  changes.push({
4662
- start: start,
4663
- end: positionRight,
4664
- inserted: [''],
4665
4665
  deleted: getSelectionText(editor, {
4666
- start: start,
4667
- end: positionRight
4666
+ end: positionRight,
4667
+ start: start
4668
4668
  }),
4669
- origin: DeleteHorizontalRight
4669
+ end: positionRight,
4670
+ inserted: [''],
4671
+ origin: DeleteHorizontalRight,
4672
+ start: start
4670
4673
  });
4671
4674
  }
4672
4675
  return changes;
@@ -4719,10 +4722,10 @@ const findAllReferences$1 = async editor => {
4719
4722
 
4720
4723
  const getFormattingEdits = async editor => {
4721
4724
  const edits = await execute({
4725
+ args: [],
4722
4726
  editor,
4723
4727
  event: 'onFormatting',
4724
- method: 'ExtensionHostFormatting.executeFormattingProvider',
4725
- args: []
4728
+ method: 'ExtensionHostFormatting.executeFormattingProvider'
4726
4729
  });
4727
4730
  return edits;
4728
4731
  };
@@ -4966,9 +4969,9 @@ const editorCopyLineUp = () => {
4966
4969
  // @ts-ignore
4967
4970
  const goTo = async ({
4968
4971
  editor,
4972
+ getErrorMessage,
4969
4973
  getLocation,
4970
4974
  getNoLocationFoundMessage,
4971
- getErrorMessage,
4972
4975
  isNoProviderFoundError
4973
4976
  }) => {
4974
4977
  const {
@@ -5003,10 +5006,10 @@ const goTo = async ({
5003
5006
  // TODO open file and scroll to that position and set cursor to that position
5004
5007
 
5005
5008
  const context = {
5006
- startRowIndex: definition.startRowIndex,
5007
- startColumnIndex: definition.startColumnIndex,
5009
+ endColumnIndex: definition.endColumnIndex,
5008
5010
  endRowIndex: definition.endRowIndex,
5009
- endColumnIndex: definition.endColumnIndex
5011
+ startColumnIndex: definition.startColumnIndex,
5012
+ startRowIndex: definition.startRowIndex
5010
5013
  };
5011
5014
  await invoke$b(/* Main.openUri */'Main.openUri', /* uri */uri, /* focus */true, context);
5012
5015
  return editor;
@@ -5070,9 +5073,9 @@ const isNoProviderFoundError$1 = error => {
5070
5073
  const goToDefinition = async editor => {
5071
5074
  return goTo({
5072
5075
  editor,
5076
+ getErrorMessage: getErrorMessage$3,
5073
5077
  getLocation: getLocation$1,
5074
5078
  getNoLocationFoundMessage: getNoLocationFoundMessage$1,
5075
- getErrorMessage: getErrorMessage$3,
5076
5079
  isNoProviderFoundError: isNoProviderFoundError$1
5077
5080
  });
5078
5081
  };
@@ -5116,10 +5119,10 @@ const isNoProviderFoundError = error => {
5116
5119
  const goToTypeDefinition = async (editor, explicit = true) => {
5117
5120
  return goTo({
5118
5121
  editor,
5122
+ getErrorMessage: getErrorMessage$2,
5119
5123
  getLocation,
5120
5124
  getNoLocationFoundMessage: getNoLocationFoundMessage,
5121
- isNoProviderFoundError,
5122
- getErrorMessage: getErrorMessage$2
5125
+ isNoProviderFoundError
5123
5126
  });
5124
5127
  };
5125
5128
 
@@ -5144,8 +5147,8 @@ const closeWidgetsMaybe = widgets => {
5144
5147
 
5145
5148
  const state$3 = {
5146
5149
  position: {
5147
- rowIndex: 0,
5148
- columnIndex: 0
5150
+ columnIndex: 0,
5151
+ rowIndex: 0
5149
5152
  }
5150
5153
  };
5151
5154
  const getPosition$1 = () => {
@@ -5161,8 +5164,8 @@ const setPosition$1 = position => {
5161
5164
  // cursor should appear at mousedown position immediately
5162
5165
  const handleSingleClickWithAlt = async (editor, position) => {
5163
5166
  const {
5164
- rowIndex,
5165
- columnIndex
5167
+ columnIndex,
5168
+ rowIndex
5166
5169
  } = position;
5167
5170
  const newEditor = {
5168
5171
  ...editor,
@@ -5209,8 +5212,8 @@ const handleSingleClickDefault = (editor, position) => {
5209
5212
  const widgets = closeWidgetsMaybe(editor.widgets);
5210
5213
  return {
5211
5214
  ...editor,
5212
- selections: new Uint32Array([position.rowIndex, position.columnIndex, position.rowIndex, position.columnIndex]),
5213
5215
  focused: true,
5216
+ selections: new Uint32Array([position.rowIndex, position.columnIndex, position.rowIndex, position.columnIndex]),
5214
5217
  widgets
5215
5218
  };
5216
5219
  };
@@ -5232,8 +5235,8 @@ const handleClickAtPosition = async (editor, modifier, rowIndex, columnIndex) =>
5232
5235
  number(columnIndex);
5233
5236
  const fn = getClickHandler(modifier);
5234
5237
  const newEditor = await fn(editor, {
5235
- rowIndex,
5236
- columnIndex
5238
+ columnIndex,
5239
+ rowIndex
5237
5240
  });
5238
5241
  return newEditor;
5239
5242
  };
@@ -5286,9 +5289,9 @@ const handleFocus$1 = editor => {
5286
5289
  }
5287
5290
  return {
5288
5291
  ...editor,
5289
- focused: true,
5292
+ additionalFocus: 0,
5290
5293
  focus: FocusEditorText$1,
5291
- additionalFocus: 0
5294
+ focused: true
5292
5295
  };
5293
5296
  };
5294
5297
 
@@ -5335,10 +5338,10 @@ const handleTripleClick = (editor, modifier, x, y) => {
5335
5338
 
5336
5339
  const handleMouseDown = (state, modifier, x, y, detail) => {
5337
5340
  switch (detail) {
5338
- case Single:
5339
- return handleSingleClick(state, modifier, x, y);
5340
5341
  case Double:
5341
5342
  return handleDoubleClick(state, modifier, x, y);
5343
+ case Single:
5344
+ return handleSingleClick(state, modifier, x, y);
5342
5345
  case Triple:
5343
5346
  return handleTripleClick(state, modifier, x, y);
5344
5347
  default:
@@ -5347,10 +5350,10 @@ const handleMouseDown = (state, modifier, x, y, detail) => {
5347
5350
  };
5348
5351
 
5349
5352
  const state$2 = {
5353
+ editor: undefined,
5350
5354
  timeout: -1,
5351
5355
  x: 0,
5352
- y: 0,
5353
- editor: undefined
5356
+ y: 0
5354
5357
  };
5355
5358
  const get = () => {
5356
5359
  return state$2;
@@ -5378,9 +5381,9 @@ const showHover$1 = async (editor, position) => {
5378
5381
 
5379
5382
  const onHoverIdle = async () => {
5380
5383
  const {
5384
+ editor,
5381
5385
  x,
5382
- y,
5383
- editor
5386
+ y
5384
5387
  } = get();
5385
5388
  await at(editor, x, y);
5386
5389
  await showHover$1();
@@ -5473,21 +5476,21 @@ const getSelectionFromNativeRange = (editor, range) => {
5473
5476
  const getChanges$3 = (editor, data, range) => {
5474
5477
  const selection = getSelectionFromNativeRange(editor, range);
5475
5478
  const selectionRange = {
5476
- start: {
5477
- rowIndex: selection[0],
5478
- columnIndex: selection[1]
5479
- },
5480
5479
  end: {
5481
- rowIndex: selection[2],
5482
- columnIndex: selection[3]
5480
+ columnIndex: selection[3],
5481
+ rowIndex: selection[2]
5482
+ },
5483
+ start: {
5484
+ columnIndex: selection[1],
5485
+ rowIndex: selection[0]
5483
5486
  }
5484
5487
  };
5485
5488
  const changes = [{
5486
- start: selectionRange.start,
5489
+ deleted: getSelectionText(editor, selectionRange),
5487
5490
  end: selectionRange.end,
5488
5491
  inserted: [data],
5489
- deleted: getSelectionText(editor, selectionRange),
5490
- origin: ContentEditableInput
5492
+ origin: ContentEditableInput,
5493
+ start: selectionRange.start
5491
5494
  }];
5492
5495
  return changes;
5493
5496
  };
@@ -5511,8 +5514,8 @@ const state$1 = {
5511
5514
  currentEditor: undefined,
5512
5515
  hasListener: false,
5513
5516
  position: {
5514
- rowIndex: 0,
5515
- columnIndex: 0
5517
+ columnIndex: 0,
5518
+ rowIndex: 0
5516
5519
  }
5517
5520
  };
5518
5521
 
@@ -5568,10 +5571,10 @@ const getNewPercent$1 = (size, scrollBarSize, relativeX) => {
5568
5571
  // @ts-ignore
5569
5572
  const handleScrollBarHorizontalMove = (state, eventX) => {
5570
5573
  const {
5571
- x,
5572
- width,
5574
+ handleOffsetX,
5573
5575
  longestLineWidth,
5574
- handleOffsetX
5576
+ width,
5577
+ x
5575
5578
  } = state;
5576
5579
  const spaceRight = 20; // TODO make this configurable
5577
5580
  const normalizedEventX = clamp(eventX, x, x + width);
@@ -5602,10 +5605,10 @@ const handleScrollBarHorizontalMove = (state, eventX) => {
5602
5605
  const handleScrollBarHorizontalPointerDown = (state, eventX) => {
5603
5606
  // @ts-ignore
5604
5607
  const {
5605
- x,
5606
5608
  deltaX,
5609
+ longestLineWidth,
5607
5610
  width,
5608
- longestLineWidth
5611
+ x
5609
5612
  } = state;
5610
5613
  const relativeX = eventX - x;
5611
5614
  const scrollBarWidth = getScrollBarWidth(width, longestLineWidth);
@@ -5619,14 +5622,14 @@ const handleScrollBarHorizontalPointerDown = (state, eventX) => {
5619
5622
  };
5620
5623
  }
5621
5624
  const {
5622
- percent,
5623
- handleOffset
5625
+ handleOffset,
5626
+ percent
5624
5627
  } = getNewDeltaPercent(width, scrollBarWidth, relativeX);
5625
5628
  const newDeltaX = percent * finalDeltaX;
5626
5629
  return {
5627
5630
  ...state,
5628
- handleOffsetX: handleOffset,
5629
- deltaX: newDeltaX
5631
+ deltaX: newDeltaX,
5632
+ handleOffsetX: handleOffset
5630
5633
  };
5631
5634
  };
5632
5635
 
@@ -5653,9 +5656,9 @@ const getNewPercent = (state, relativeY) => {
5653
5656
  // @ts-ignore
5654
5657
  const handleScrollBarMove = (state, eventY) => {
5655
5658
  const {
5656
- y,
5657
5659
  finalDeltaY,
5658
- handleOffset
5660
+ handleOffset,
5661
+ y
5659
5662
  } = state;
5660
5663
  const relativeY = eventY - y - handleOffset;
5661
5664
  const newPercent = getNewPercent(state, relativeY);
@@ -5672,11 +5675,11 @@ const handleScrollBarVerticalPointerMove = handleScrollBarMove;
5672
5675
 
5673
5676
  const handleScrollBarPointerDown = (state, eventY) => {
5674
5677
  const {
5675
- y,
5676
5678
  deltaY,
5677
5679
  finalDeltaY,
5678
5680
  height,
5679
- scrollBarHeight
5681
+ scrollBarHeight,
5682
+ y
5680
5683
  } = state;
5681
5684
  const relativeY = eventY - y;
5682
5685
  const currentScrollBarY = getScrollBarY(deltaY, finalDeltaY, height, scrollBarHeight);
@@ -5688,8 +5691,8 @@ const handleScrollBarPointerDown = (state, eventY) => {
5688
5691
  };
5689
5692
  }
5690
5693
  const {
5691
- percent,
5692
- handleOffset
5694
+ handleOffset,
5695
+ percent
5693
5696
  } = getNewDeltaPercent(height, scrollBarHeight, relativeY);
5694
5697
  const newDeltaY = percent * finalDeltaY;
5695
5698
  return {
@@ -5721,8 +5724,8 @@ const handleTouchEnd = (editor, touchEvent) => {
5721
5724
  };
5722
5725
 
5723
5726
  const state = {
5724
- touchOffsetY: 0,
5725
- deltaY: 0
5727
+ deltaY: 0,
5728
+ touchOffsetY: 0
5726
5729
  };
5727
5730
 
5728
5731
  // @ts-ignore
@@ -5789,17 +5792,17 @@ const getChanges$2 = selections => {
5789
5792
  }
5790
5793
  for (const rowToIndent of rowsToIndentLess) {
5791
5794
  changes.push({
5792
- start: {
5793
- rowIndex: rowToIndent,
5794
- columnIndex: 0
5795
- },
5795
+ deleted: [' '],
5796
5796
  end: {
5797
- rowIndex: rowToIndent,
5798
- columnIndex: 2
5797
+ columnIndex: 2,
5798
+ rowIndex: rowToIndent
5799
5799
  },
5800
5800
  inserted: [''],
5801
- deleted: [' '],
5802
- origin: IndentLess
5801
+ origin: IndentLess,
5802
+ start: {
5803
+ columnIndex: 0,
5804
+ rowIndex: rowToIndent
5805
+ }
5803
5806
  });
5804
5807
  }
5805
5808
  return changes;
@@ -5826,17 +5829,17 @@ const getChanges$1 = selections => {
5826
5829
  const changes = [];
5827
5830
  for (const rowToIndent of rowsToIndent) {
5828
5831
  changes.push({
5829
- start: {
5830
- rowIndex: rowToIndent,
5831
- columnIndex: 0
5832
- },
5832
+ deleted: [''],
5833
5833
  end: {
5834
- rowIndex: rowToIndent,
5835
- columnIndex: 0
5834
+ columnIndex: 0,
5835
+ rowIndex: rowToIndent
5836
5836
  },
5837
5837
  inserted: [' '],
5838
- deleted: [''],
5839
- origin: IndentMore
5838
+ origin: IndentMore,
5839
+ start: {
5840
+ columnIndex: 0,
5841
+ rowIndex: rowToIndent
5842
+ }
5840
5843
  });
5841
5844
  }
5842
5845
  return changes;
@@ -5852,8 +5855,8 @@ const indentMore = editor => {
5852
5855
  const getLanguageConfiguration = async editor => {
5853
5856
  // @ts-ignore
5854
5857
  return invoke$b('Languages.getLanguageConfiguration', {
5855
- uri: editor.uri,
5856
- languageId: editor.languageId
5858
+ languageId: editor.languageId,
5859
+ uri: editor.uri
5857
5860
  });
5858
5861
  };
5859
5862
 
@@ -5877,16 +5880,16 @@ const getChanges = (lines, selections, languageConfiguration) => {
5877
5880
  for (let i = 0; i < selections.length; i += 4) {
5878
5881
  const [selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn] = getSelectionPairs(selections, i);
5879
5882
  const start = {
5880
- rowIndex: selectionStartRow,
5881
- columnIndex: selectionStartColumn
5883
+ columnIndex: selectionStartColumn,
5884
+ rowIndex: selectionStartRow
5882
5885
  };
5883
5886
  const end = {
5884
- rowIndex: selectionEndRow,
5885
- columnIndex: selectionEndColumn
5887
+ columnIndex: selectionEndColumn,
5888
+ rowIndex: selectionEndRow
5886
5889
  };
5887
5890
  const range = {
5888
- start,
5889
- end
5891
+ end,
5892
+ start
5890
5893
  };
5891
5894
  if (isEmpty(selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn)) {
5892
5895
  const line = lines[selectionStartRow];
@@ -5894,36 +5897,36 @@ const getChanges = (lines, selections, languageConfiguration) => {
5894
5897
  const indent = getIndent(before);
5895
5898
  if (shouldIncreaseIndent(before, increaseIndentRegex)) {
5896
5899
  changes.push({
5897
- start: start,
5898
- end: end,
5899
- inserted: ['', indent + ' ', indent],
5900
5900
  deleted: getSelectionText({
5901
5901
  lines
5902
5902
  }, range),
5903
- origin: InsertLineBreak
5903
+ end: end,
5904
+ inserted: ['', indent + ' ', indent],
5905
+ origin: InsertLineBreak,
5906
+ start: start
5904
5907
  });
5905
5908
  selectionChanges.push(selectionStartRow + 1, indent.length + 2, selectionStartRow + 1, indent.length + 2);
5906
5909
  } else {
5907
5910
  changes.push({
5908
- start: start,
5909
- end: end,
5910
- inserted: ['', indent],
5911
5911
  deleted: getSelectionText({
5912
5912
  lines
5913
5913
  }, range),
5914
- origin: InsertLineBreak
5914
+ end: end,
5915
+ inserted: ['', indent],
5916
+ origin: InsertLineBreak,
5917
+ start: start
5915
5918
  });
5916
5919
  selectionChanges.push(selectionStartRow + 1, indent.length, selectionStartRow + 1, indent.length);
5917
5920
  }
5918
5921
  } else {
5919
5922
  changes.push({
5920
- start: start,
5921
- end: end,
5922
- inserted: ['', ''],
5923
5923
  deleted: getSelectionText({
5924
5924
  lines
5925
5925
  }, range),
5926
- origin: InsertLineBreak
5926
+ end: end,
5927
+ inserted: ['', ''],
5928
+ origin: InsertLineBreak,
5929
+ start: start
5927
5930
  });
5928
5931
  selectionChanges.push(selectionStartRow + 1, 0, selectionStartRow + 1, 0);
5929
5932
  }
@@ -6019,12 +6022,12 @@ const editorMoveSelectionForwards = (anchor, position) => {
6019
6022
  // @ts-ignore
6020
6023
  const getNewSelections$5 = (anchor, position) => {
6021
6024
  switch (compare(position, anchor)) {
6022
- case LessThan:
6023
- return editorMoveSelectionBackwards(anchor, position);
6024
6025
  case Equal:
6025
6026
  return editorMoveSelectionEqual(anchor, position);
6026
6027
  case GreaterThan:
6027
6028
  return editorMoveSelectionForwards(anchor, position);
6029
+ case LessThan:
6030
+ return editorMoveSelectionBackwards(anchor, position);
6028
6031
  default:
6029
6032
  throw new Error('unexpected comparison result');
6030
6033
  }
@@ -6045,8 +6048,8 @@ const requestAnimationFrame = fn => {
6045
6048
  // @ts-ignore
6046
6049
  const getNewEditor$1 = (editor, position) => {
6047
6050
  const {
6048
- minLineY,
6049
6051
  maxLineY,
6052
+ minLineY,
6050
6053
  rowHeight
6051
6054
  } = editor;
6052
6055
  const diff = maxLineY - minLineY;
@@ -6058,9 +6061,9 @@ const getNewEditor$1 = (editor, position) => {
6058
6061
  const newSelections = new Uint32Array([position.rowIndex - 1, position.columnIndex, anchor.rowIndex, anchor.columnIndex]);
6059
6062
  return {
6060
6063
  ...editor,
6061
- minLineY: newMinLineY,
6062
- maxLineY: newMaxLineY,
6063
6064
  deltaY: newDeltaY,
6065
+ maxLineY: newMaxLineY,
6066
+ minLineY: newMinLineY,
6064
6067
  selections: newSelections
6065
6068
  };
6066
6069
  }
@@ -6073,9 +6076,9 @@ const getNewEditor$1 = (editor, position) => {
6073
6076
  const newSelections = new Uint32Array([anchor.rowIndex, anchor.columnIndex, position.rowIndex + 1, position.columnIndex]);
6074
6077
  return {
6075
6078
  ...editor,
6076
- minLineY: newMinLineY,
6077
- maxLineY: newMaxLineY,
6078
6079
  deltaY: newDeltaY,
6080
+ maxLineY: newMaxLineY,
6081
+ minLineY: newMinLineY,
6079
6082
  selections: newSelections
6080
6083
  };
6081
6084
  }
@@ -6099,8 +6102,8 @@ const continueScrollingAndMovingSelection = async () => {
6099
6102
  // @ts-ignore
6100
6103
  const delta = position.rowIndex < editor.minLineY ? -1 : 1;
6101
6104
  setPosition({
6102
- rowIndex: position.rowIndex + delta,
6103
- columnIndex: position.columnIndex
6105
+ columnIndex: position.columnIndex,
6106
+ rowIndex: position.rowIndex + delta
6104
6107
  });
6105
6108
  requestAnimationFrame(continueScrollingAndMovingSelection);
6106
6109
  // TODO get editor state
@@ -6130,25 +6133,25 @@ const create$5 = () => {
6130
6133
  const completionUid = create$7();
6131
6134
  const widget = {
6132
6135
  id: CodeGenerator,
6133
- oldState: {
6134
- uid: completionUid,
6136
+ newState: {
6137
+ focused: true,
6138
+ focusSource: Script,
6139
+ height: 0,
6135
6140
  questions: [],
6136
- x: 0,
6137
- y: 0,
6141
+ uid: completionUid,
6138
6142
  width: 0,
6139
- height: 0,
6140
- focused: false,
6141
- focusSource: Unknown$1
6143
+ x: 0,
6144
+ y: 0
6142
6145
  },
6143
- newState: {
6144
- uid: completionUid,
6146
+ oldState: {
6147
+ focused: false,
6148
+ focusSource: Unknown$1,
6149
+ height: 0,
6145
6150
  questions: [],
6146
- x: 0,
6147
- y: 0,
6151
+ uid: completionUid,
6148
6152
  width: 0,
6149
- height: 0,
6150
- focused: true,
6151
- focusSource: Script
6153
+ x: 0,
6154
+ y: 0
6152
6155
  }
6153
6156
  };
6154
6157
  return widget;
@@ -6157,10 +6160,10 @@ const create$5 = () => {
6157
6160
  const newStateGenerator$5 = async state => {
6158
6161
  const latestState = {
6159
6162
  ...state,
6160
- x: 100,
6161
- y: 100,
6163
+ height: 45,
6162
6164
  width: 150,
6163
- height: 45
6165
+ x: 100,
6166
+ y: 100
6164
6167
  };
6165
6168
  return latestState;
6166
6169
  };
@@ -6173,38 +6176,38 @@ const create$4 = () => {
6173
6176
  const completionUid = create$7();
6174
6177
  const completionWidget = {
6175
6178
  id: Completion,
6176
- oldState: {
6179
+ newState: {
6180
+ commands: [],
6181
+ height: 0,
6177
6182
  uid: completionUid,
6178
- x: 0,
6179
- y: 0,
6180
6183
  width: 0,
6181
- height: 0,
6182
- commands: []
6184
+ x: 0,
6185
+ y: 0
6183
6186
  },
6184
- newState: {
6187
+ oldState: {
6188
+ commands: [],
6189
+ height: 0,
6185
6190
  uid: completionUid,
6186
- x: 0,
6187
- y: 0,
6188
6191
  width: 0,
6189
- height: 0,
6190
- commands: []
6192
+ x: 0,
6193
+ y: 0
6191
6194
  }
6192
6195
  };
6193
6196
  return completionWidget;
6194
6197
  };
6195
6198
 
6196
6199
  const {
6197
- setFactory,
6198
- invoke: invoke$4
6200
+ invoke: invoke$4,
6201
+ setFactory
6199
6202
  } = createLazyRpc(CompletionWorker);
6200
6203
 
6201
6204
  const newStateGenerator$4 = async (state, parentUid) => {
6202
6205
  const {
6206
+ height,
6203
6207
  uid,
6204
- x,
6205
- y,
6206
6208
  width,
6207
- height
6209
+ x,
6210
+ y
6208
6211
  } = state;
6209
6212
  const {
6210
6213
  newState
@@ -6230,23 +6233,23 @@ const create$3 = () => {
6230
6233
  const uid = create$7();
6231
6234
  const widget = {
6232
6235
  id: Find,
6233
- oldState: {
6236
+ newState: {
6237
+ commands: [],
6238
+ editorUid: 0,
6239
+ height: 0,
6234
6240
  uid,
6235
- x: 0,
6236
- y: 0,
6237
6241
  width: 0,
6238
- height: 0,
6239
- commands: [],
6240
- editorUid: 0
6242
+ x: 0,
6243
+ y: 0
6241
6244
  },
6242
- newState: {
6245
+ oldState: {
6246
+ commands: [],
6247
+ editorUid: 0,
6248
+ height: 0,
6243
6249
  uid,
6244
- x: 0,
6245
- y: 0,
6246
6250
  width: 0,
6247
- height: 0,
6248
- commands: [],
6249
- editorUid: 0
6251
+ x: 0,
6252
+ y: 0
6250
6253
  }
6251
6254
  };
6252
6255
  return widget;
@@ -6300,10 +6303,10 @@ const loadContent$1 = async (state, parentUid) => {
6300
6303
  } = state;
6301
6304
  const editor = getEditor(parentUid);
6302
6305
  const {
6303
- x,
6304
- y,
6306
+ height,
6305
6307
  width,
6306
- height
6308
+ x,
6309
+ y
6307
6310
  } = editor;
6308
6311
  await launch();
6309
6312
  await invoke$3('FindWidget.create', uid, x, y, width, height, parentUid);
@@ -6337,10 +6340,10 @@ const getPositionAtCursor$1 = editor => {
6337
6340
  const x$1 = x(editor, rowIndex, columnIndex);
6338
6341
  const y$1 = y(editor, rowIndex);
6339
6342
  return {
6340
- x: x$1,
6341
- y: y$1,
6343
+ columnIndex,
6342
6344
  rowIndex,
6343
- columnIndex
6345
+ x: x$1,
6346
+ y: y$1
6344
6347
  };
6345
6348
  };
6346
6349
 
@@ -6348,21 +6351,21 @@ const create$2 = () => {
6348
6351
  const completionUid = create$7();
6349
6352
  const renameWidget = {
6350
6353
  id: Rename$1,
6351
- oldState: {
6354
+ newState: {
6355
+ commands: [],
6356
+ height: 0,
6352
6357
  uid: completionUid,
6353
- x: 0,
6354
- y: 0,
6355
6358
  width: 0,
6356
- height: 0,
6357
- commands: []
6359
+ x: 0,
6360
+ y: 0
6358
6361
  },
6359
- newState: {
6362
+ oldState: {
6363
+ commands: [],
6364
+ height: 0,
6360
6365
  uid: completionUid,
6361
- x: 0,
6362
- y: 0,
6363
6366
  width: 0,
6364
- height: 0,
6365
- commands: []
6367
+ x: 0,
6368
+ y: 0
6366
6369
  }
6367
6370
  };
6368
6371
  return renameWidget;
@@ -6370,11 +6373,11 @@ const create$2 = () => {
6370
6373
 
6371
6374
  const newStateGenerator$2 = async (state, parentUid) => {
6372
6375
  const {
6376
+ height,
6373
6377
  uid,
6374
- x,
6375
- y,
6376
6378
  width,
6377
- height
6379
+ x,
6380
+ y
6378
6381
  } = state;
6379
6382
  const {
6380
6383
  newState
@@ -6393,8 +6396,8 @@ const newStateGenerator$2 = async (state, parentUid) => {
6393
6396
  };
6394
6397
  const openRename = async editor => {
6395
6398
  const {
6396
- rowIndex,
6397
- columnIndex
6399
+ columnIndex,
6400
+ rowIndex
6398
6401
  } = getPositionAtCursor$1(editor);
6399
6402
  const {
6400
6403
  word
@@ -6408,10 +6411,10 @@ const openRename = async editor => {
6408
6411
 
6409
6412
  const getOrganizeImportEdits = async editor => {
6410
6413
  const edits = await execute({
6414
+ args: [],
6411
6415
  editor,
6412
6416
  event: 'onLanguage',
6413
- method: 'ExtensionHostOrganizeImports.execute',
6414
- args: []
6417
+ method: 'ExtensionHostOrganizeImports.execute'
6415
6418
  });
6416
6419
  return edits;
6417
6420
  };
@@ -6453,26 +6456,26 @@ const getErrorMessage$1 = error => {
6453
6456
  const prepareErrorMessageWithCodeFrame = error => {
6454
6457
  if (!error) {
6455
6458
  return {
6459
+ codeFrame: undefined,
6456
6460
  message: error,
6457
6461
  stack: undefined,
6458
- codeFrame: undefined,
6459
6462
  type: 'Error'
6460
6463
  };
6461
6464
  }
6462
6465
  const message = getErrorMessage$1(error);
6463
6466
  if (error.codeFrame) {
6464
6467
  return {
6468
+ codeFrame: error.codeFrame,
6465
6469
  message,
6466
6470
  stack: error.stack,
6467
- codeFrame: error.codeFrame,
6468
6471
  type: error.constructor.name
6469
6472
  };
6470
6473
  }
6471
6474
  return {
6475
+ category: error.category,
6476
+ codeFrame: error.originalCodeFrame,
6472
6477
  message,
6473
6478
  stack: error.originalStack,
6474
- codeFrame: error.originalCodeFrame,
6475
- category: error.category,
6476
6479
  stderr: error.stderr
6477
6480
  };
6478
6481
  };
@@ -6671,8 +6674,8 @@ const getWordMatchAtPosition = (lines, rowIndex, columnIndex) => {
6671
6674
  const end = getWordEndIndex(line, columnIndex);
6672
6675
  const word = line.slice(start, end);
6673
6676
  return {
6674
- start,
6675
6677
  end,
6678
+ start,
6676
6679
  word
6677
6680
  };
6678
6681
  };
@@ -7022,8 +7025,9 @@ const getSelectNextOccurrenceResult = editor => {
7022
7025
  }
7023
7026
  }
7024
7027
  return {
7025
- selectionEdits: newSelections,
7026
- revealRange: newSelections.length - 4 // TODO should be primary selection
7028
+ revealRange: newSelections.length - 4,
7029
+ // TODO should be primary selection
7030
+ selectionEdits: newSelections
7027
7031
  };
7028
7032
  }
7029
7033
  if (isEverySelectionSingleLine(editor.selections)) {
@@ -7149,8 +7153,8 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
7149
7153
  }
7150
7154
  const syncIncremental = getEnabled();
7151
7155
  const {
7152
- textInfos,
7153
- differences
7156
+ differences,
7157
+ textInfos
7154
7158
  } = await getVisible$1(editor, syncIncremental);
7155
7159
  const latest2 = getEditor(editor.uid);
7156
7160
  if (!latest2) {
@@ -7158,9 +7162,9 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
7158
7162
  }
7159
7163
  const newEditor4 = {
7160
7164
  ...latest2,
7165
+ differences,
7161
7166
  focused: true,
7162
- textInfos,
7163
- differences
7167
+ textInfos
7164
7168
  };
7165
7169
 
7166
7170
  // TODO don't update editor if tokenizer was already loaded
@@ -7169,16 +7173,16 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
7169
7173
 
7170
7174
  return {
7171
7175
  ...newEditor4,
7172
- languageId,
7173
7176
  invalidStartIndex: 0,
7177
+ languageId,
7174
7178
  tokenizerId: newTokenizerId
7175
7179
  };
7176
7180
  };
7177
7181
 
7178
7182
  const setSelections = (editor, selections) => {
7179
7183
  const {
7180
- minLineY,
7181
7184
  maxLineY,
7185
+ minLineY,
7182
7186
  rowHeight
7183
7187
  } = editor;
7184
7188
  const startRowIndex = selections[0];
@@ -7186,20 +7190,20 @@ const setSelections = (editor, selections) => {
7186
7190
  const deltaY = startRowIndex * rowHeight;
7187
7191
  return {
7188
7192
  ...editor,
7189
- minLineY: startRowIndex,
7193
+ deltaY,
7190
7194
  maxLineY: startRowIndex + 1,
7191
- selections,
7192
- deltaY
7195
+ minLineY: startRowIndex,
7196
+ selections
7193
7197
  };
7194
7198
  }
7195
7199
  if (startRowIndex > maxLineY) {
7196
7200
  const deltaY = startRowIndex * rowHeight;
7197
7201
  return {
7198
7202
  ...editor,
7199
- minLineY: startRowIndex,
7203
+ deltaY,
7200
7204
  maxLineY: startRowIndex + 1,
7201
- selections,
7202
- deltaY
7205
+ minLineY: startRowIndex,
7206
+ selections
7203
7207
  };
7204
7208
  }
7205
7209
  return {
@@ -7212,31 +7216,31 @@ const create$1 = () => {
7212
7216
  const uid = create$7();
7213
7217
  const widget = {
7214
7218
  id: Hover,
7215
- oldState: {
7216
- uid: uid,
7217
- x: 0,
7218
- y: 0,
7219
- width: 0,
7220
- height: 0,
7219
+ newState: {
7220
+ commands: [],
7221
7221
  content: '',
7222
7222
  diagnostics: [],
7223
7223
  documentation: '',
7224
7224
  editorUid: 0,
7225
+ height: 0,
7225
7226
  lineInfos: [],
7226
- commands: []
7227
- },
7228
- newState: {
7229
7227
  uid: uid,
7230
- x: 0,
7231
- y: 0,
7232
7228
  width: 0,
7233
- height: 0,
7229
+ x: 0,
7230
+ y: 0
7231
+ },
7232
+ oldState: {
7233
+ commands: [],
7234
7234
  content: '',
7235
7235
  diagnostics: [],
7236
7236
  documentation: '',
7237
7237
  editorUid: 0,
7238
+ height: 0,
7238
7239
  lineInfos: [],
7239
- commands: []
7240
+ uid: uid,
7241
+ width: 0,
7242
+ x: 0,
7243
+ y: 0
7240
7244
  }
7241
7245
  };
7242
7246
  return widget;
@@ -7264,11 +7268,11 @@ const invoke$2 = async (method, ...params) => {
7264
7268
 
7265
7269
  const newStateGenerator$1 = async (state, parentUid) => {
7266
7270
  const {
7271
+ height,
7267
7272
  uid,
7268
- x,
7269
- y,
7270
7273
  width,
7271
- height
7274
+ x,
7275
+ y
7272
7276
  } = state;
7273
7277
  const {
7274
7278
  newState
@@ -7300,27 +7304,27 @@ const create = () => {
7300
7304
  const completionUid = create$7();
7301
7305
  const widget = {
7302
7306
  id: SourceAction$1,
7303
- oldState: {
7304
- uid: completionUid,
7305
- x: 0,
7306
- y: 0,
7307
- width: 0,
7308
- height: 0,
7307
+ newState: {
7308
+ commands: [],
7309
7309
  focusedIndex: 0,
7310
- sourceActions: [],
7310
+ height: 0,
7311
7311
  maxHeight: 0,
7312
- commands: []
7313
- },
7314
- newState: {
7312
+ sourceActions: [],
7315
7313
  uid: completionUid,
7316
- x: 0,
7317
- y: 0,
7318
7314
  width: 0,
7319
- height: 0,
7315
+ x: 0,
7316
+ y: 0
7317
+ },
7318
+ oldState: {
7319
+ commands: [],
7320
7320
  focusedIndex: 0,
7321
- sourceActions: [],
7321
+ height: 0,
7322
7322
  maxHeight: 0,
7323
- commands: []
7323
+ sourceActions: [],
7324
+ uid: completionUid,
7325
+ width: 0,
7326
+ x: 0,
7327
+ y: 0
7324
7328
  }
7325
7329
  };
7326
7330
  return widget;
@@ -7348,11 +7352,11 @@ const invoke$1 = async (method, ...params) => {
7348
7352
 
7349
7353
  const newStateGenerator = async (state, parentUid) => {
7350
7354
  const {
7355
+ height,
7351
7356
  uid,
7352
- x,
7353
- y,
7354
7357
  width,
7355
- height
7358
+ x,
7359
+ y
7356
7360
  } = state;
7357
7361
  const {
7358
7362
  newState
@@ -7396,27 +7400,27 @@ const getSortLinesAscendingChanges = (lines, selections) => {
7396
7400
  const selectionEndRow = selections[i + 2];
7397
7401
  const selectionEndColumn = selections[i + 3];
7398
7402
  const start = {
7399
- rowIndex: selectionStartRow,
7400
- columnIndex: selectionStartColumn
7403
+ columnIndex: selectionStartColumn,
7404
+ rowIndex: selectionStartRow
7401
7405
  };
7402
7406
  const end = {
7403
- rowIndex: selectionEndRow,
7404
- columnIndex: selectionEndColumn
7407
+ columnIndex: selectionEndColumn,
7408
+ rowIndex: selectionEndRow
7405
7409
  };
7406
7410
  const selection = {
7407
- start,
7408
- end
7411
+ end,
7412
+ start
7409
7413
  };
7410
7414
  const selectionLines = lines.slice(startRowIndex, endRowIndex + 1);
7411
7415
  const sortedSelectionLines = getSortedLines(selectionLines);
7412
7416
  changes.push({
7413
- start: start,
7414
- end: end,
7415
- inserted: sortedSelectionLines,
7416
7417
  deleted: getSelectionText({
7417
7418
  lines
7418
7419
  }, selection),
7419
- origin
7420
+ end: end,
7421
+ inserted: sortedSelectionLines,
7422
+ origin,
7423
+ start: start
7420
7424
  });
7421
7425
  }
7422
7426
  return changes;
@@ -7434,10 +7438,10 @@ const sortLinesAscending = editor => {
7434
7438
 
7435
7439
  const executeTabCompletionProvider = async (editor, offset) => {
7436
7440
  return execute({
7441
+ args: [offset],
7437
7442
  editor,
7438
7443
  event: OnTabCompletion,
7439
7444
  method: TabCompletionExecuteTabCompletionProvider,
7440
- args: [offset],
7441
7445
  noProviderFoundMessage: 'No tab completion provider found',
7442
7446
  noProviderFoundResult: undefined
7443
7447
  });
@@ -7474,17 +7478,17 @@ const getSnippetChanges = (lines, selections, snippet) => {
7474
7478
  const insertedLinesHere = [insertedLines[0], ...insertedLines.slice(1).map(line => indent + line)];
7475
7479
  const deleted = [''];
7476
7480
  changes.push({
7477
- start: {
7478
- rowIndex: selectionStartRow,
7479
- columnIndex: selectionStartColumn - snippet.deleted
7480
- },
7481
+ deleted,
7481
7482
  end: {
7482
- rowIndex: selectionEndRow,
7483
- columnIndex: selectionEndColumn
7483
+ columnIndex: selectionEndColumn,
7484
+ rowIndex: selectionEndRow
7484
7485
  },
7485
7486
  inserted: insertedLinesHere,
7486
- deleted,
7487
- origin: EditorSnippet
7487
+ origin: EditorSnippet,
7488
+ start: {
7489
+ columnIndex: selectionStartColumn - snippet.deleted,
7490
+ rowIndex: selectionStartRow
7491
+ }
7488
7492
  });
7489
7493
  const lastInsertedLine = insertedLines.at(-1);
7490
7494
  selectionChanges.push(selectionEndRow + insertedLines.length - deleted.length,
@@ -7501,34 +7505,34 @@ const getSnippetChanges = (lines, selections, snippet) => {
7501
7505
  selectionChanges.push(selectionStartRow, cursorColumnIndex, selectionStartRow, cursorColumnIndex);
7502
7506
  // @ts-ignore
7503
7507
  changes.push({
7504
- start: {
7505
- rowIndex: selectionStartRow,
7506
- columnIndex: selectionStartColumn - snippet.deleted
7507
- },
7508
+ deleted: [''],
7508
7509
  end: {
7509
- rowIndex: selectionEndRow,
7510
- columnIndex: selectionEndColumn
7510
+ columnIndex: selectionEndColumn,
7511
+ rowIndex: selectionEndRow
7511
7512
  },
7512
7513
  inserted: insertedLines,
7513
- deleted: [''],
7514
- origin: EditorSnippet
7514
+ origin: EditorSnippet,
7515
+ start: {
7516
+ columnIndex: selectionStartColumn - snippet.deleted,
7517
+ rowIndex: selectionStartRow
7518
+ }
7515
7519
  });
7516
7520
  } else {
7517
7521
  const inserted = line.replace('$0', '');
7518
7522
  const cursorColumnIndex = selectionEndColumn + 2;
7519
7523
  selectionChanges.push(selectionStartRow, cursorColumnIndex, selectionStartRow, cursorColumnIndex);
7520
7524
  changes.push({
7521
- start: {
7522
- rowIndex: selectionStartRow,
7523
- columnIndex: selectionStartColumn - snippet.deleted
7524
- },
7525
+ deleted: [''],
7525
7526
  end: {
7526
- rowIndex: selectionEndRow,
7527
- columnIndex: selectionEndColumn
7527
+ columnIndex: selectionEndColumn,
7528
+ rowIndex: selectionEndRow
7528
7529
  },
7529
7530
  inserted: [inserted],
7530
- deleted: [''],
7531
- origin: EditorSnippet
7531
+ origin: EditorSnippet,
7532
+ start: {
7533
+ columnIndex: selectionStartColumn - snippet.deleted,
7534
+ rowIndex: selectionStartRow
7535
+ }
7532
7536
  });
7533
7537
  }
7534
7538
  }
@@ -7633,58 +7637,58 @@ const getBlockCommentEdits = (editor, blockComment) => {
7633
7637
  if (startColumnIndex !== -1 && endColumnIndex !== -1) {
7634
7638
  if (startRowIndex === endRowIndex) {
7635
7639
  const change1 = {
7636
- start: {
7637
- rowIndex,
7638
- columnIndex: startColumnIndex
7639
- },
7640
+ deleted: [blockCommentStart],
7640
7641
  end: {
7641
- rowIndex,
7642
- columnIndex: startColumnIndex + blockCommentStart.length
7642
+ columnIndex: startColumnIndex + blockCommentStart.length,
7643
+ rowIndex
7643
7644
  },
7644
7645
  inserted: [],
7645
- deleted: [blockCommentStart],
7646
- origin: ToggleBlockComment$1
7646
+ origin: ToggleBlockComment$1,
7647
+ start: {
7648
+ columnIndex: startColumnIndex,
7649
+ rowIndex
7650
+ }
7647
7651
  };
7648
7652
  const change2 = {
7649
- start: {
7650
- rowIndex,
7651
- columnIndex: endColumnIndex - blockCommentStart.length
7652
- },
7653
+ deleted: [blockCommentEnd],
7653
7654
  end: {
7654
- rowIndex,
7655
- columnIndex: endColumnIndex - blockCommentStart.length + blockCommentEnd.length
7655
+ columnIndex: endColumnIndex - blockCommentStart.length + blockCommentEnd.length,
7656
+ rowIndex
7656
7657
  },
7657
7658
  inserted: [],
7658
- deleted: [blockCommentEnd],
7659
- origin: ToggleBlockComment$1
7659
+ origin: ToggleBlockComment$1,
7660
+ start: {
7661
+ columnIndex: endColumnIndex - blockCommentStart.length,
7662
+ rowIndex
7663
+ }
7660
7664
  };
7661
7665
  changes.push(change1, change2);
7662
7666
  } else {
7663
7667
  const change1 = {
7664
- start: {
7665
- rowIndex: startRowIndex,
7666
- columnIndex: startColumnIndex
7667
- },
7668
+ deleted: [blockCommentStart],
7668
7669
  end: {
7669
- rowIndex: startRowIndex,
7670
- columnIndex: startColumnIndex + blockCommentStart.length
7670
+ columnIndex: startColumnIndex + blockCommentStart.length,
7671
+ rowIndex: startRowIndex
7671
7672
  },
7672
7673
  inserted: [],
7673
- deleted: [blockCommentStart],
7674
- origin: ToggleBlockComment$1
7674
+ origin: ToggleBlockComment$1,
7675
+ start: {
7676
+ columnIndex: startColumnIndex,
7677
+ rowIndex: startRowIndex
7678
+ }
7675
7679
  };
7676
7680
  const change2 = {
7677
- start: {
7678
- rowIndex: endRowIndex,
7679
- columnIndex: endColumnIndex
7680
- },
7681
+ deleted: [blockCommentEnd],
7681
7682
  end: {
7682
- rowIndex: endRowIndex,
7683
- columnIndex: endColumnIndex + blockCommentEnd.length
7683
+ columnIndex: endColumnIndex + blockCommentEnd.length,
7684
+ rowIndex: endRowIndex
7684
7685
  },
7685
7686
  inserted: [],
7686
- deleted: [blockCommentEnd],
7687
- origin: ToggleBlockComment$1
7687
+ origin: ToggleBlockComment$1,
7688
+ start: {
7689
+ columnIndex: endColumnIndex,
7690
+ rowIndex: endRowIndex
7691
+ }
7688
7692
  };
7689
7693
  changes.push(change1, change2);
7690
7694
 
@@ -7713,30 +7717,30 @@ const getBlockCommentEdits = (editor, blockComment) => {
7713
7717
  endColumnIndex -= whitespaceAtEnd[0].length;
7714
7718
  }
7715
7719
  const change1 = {
7716
- start: {
7717
- rowIndex,
7718
- columnIndex: startColumnIndex
7719
- },
7720
+ deleted: [],
7720
7721
  end: {
7721
- rowIndex,
7722
- columnIndex: startColumnIndex
7722
+ columnIndex: startColumnIndex,
7723
+ rowIndex
7723
7724
  },
7724
7725
  inserted: [blockCommentStart],
7725
- deleted: [],
7726
- origin: ToggleBlockComment$1
7726
+ origin: ToggleBlockComment$1,
7727
+ start: {
7728
+ columnIndex: startColumnIndex,
7729
+ rowIndex
7730
+ }
7727
7731
  };
7728
7732
  const change2 = {
7729
- start: {
7730
- rowIndex,
7731
- columnIndex: endColumnIndex + blockCommentStart.length
7732
- },
7733
+ deleted: [],
7733
7734
  end: {
7734
- rowIndex,
7735
- columnIndex: endColumnIndex + blockCommentStart.length
7735
+ columnIndex: endColumnIndex + blockCommentStart.length,
7736
+ rowIndex
7736
7737
  },
7737
7738
  inserted: [blockCommentEnd],
7738
- deleted: [],
7739
- origin: ToggleBlockComment$1
7739
+ origin: ToggleBlockComment$1,
7740
+ start: {
7741
+ columnIndex: endColumnIndex + blockCommentStart.length,
7742
+ rowIndex
7743
+ }
7740
7744
  };
7741
7745
  changes.push(change1, change2);
7742
7746
  // TextDocument.setLine(
@@ -7810,45 +7814,45 @@ const getLineCommentEdit = (rowIndex, line, lineComment) => {
7810
7814
  // TODO also check tab character
7811
7815
  if (line[index + lineComment.length] === ' ') {
7812
7816
  return {
7813
- inserted: [''],
7814
7817
  deleted: [lineComment + ' '],
7815
- start: {
7816
- rowIndex,
7817
- columnIndex: index
7818
- },
7819
7818
  end: {
7820
- rowIndex,
7821
- columnIndex: index + lineComment.length + 1
7819
+ columnIndex: index + lineComment.length + 1,
7820
+ rowIndex
7822
7821
  },
7823
- origin: LineComment
7822
+ inserted: [''],
7823
+ origin: LineComment,
7824
+ start: {
7825
+ columnIndex: index,
7826
+ rowIndex
7827
+ }
7824
7828
  };
7825
7829
  }
7826
7830
  return {
7827
- inserted: [''],
7828
7831
  deleted: [lineComment],
7829
- start: {
7830
- rowIndex,
7831
- columnIndex: index
7832
- },
7833
7832
  end: {
7834
- rowIndex,
7835
- columnIndex: index + lineComment.length
7833
+ columnIndex: index + lineComment.length,
7834
+ rowIndex
7836
7835
  },
7837
- origin: LineComment
7836
+ inserted: [''],
7837
+ origin: LineComment,
7838
+ start: {
7839
+ columnIndex: index,
7840
+ rowIndex
7841
+ }
7838
7842
  };
7839
7843
  }
7840
7844
  return {
7841
- inserted: [`${lineComment} `],
7842
7845
  deleted: [],
7843
- start: {
7844
- rowIndex,
7845
- columnIndex: index
7846
- },
7847
7846
  end: {
7848
- rowIndex,
7849
- columnIndex: index
7847
+ columnIndex: index,
7848
+ rowIndex
7850
7849
  },
7851
- origin: LineComment
7850
+ inserted: [`${lineComment} `],
7851
+ origin: LineComment,
7852
+ start: {
7853
+ columnIndex: index,
7854
+ rowIndex
7855
+ }
7852
7856
  };
7853
7857
  };
7854
7858
 
@@ -7986,11 +7990,10 @@ const typeWithAutoClosing = async (editor, text) => {
7986
7990
  isAutoClosingTagsEnabled
7987
7991
  } = editor;
7988
7992
  switch (text) {
7989
- case CurlyOpen:
7990
- case RoundOpen:
7991
- case SquareOpen:
7992
- if (isAutoClosingBracketsEnabled) {
7993
- return typeWithAutoClosingBracket(editor, text);
7993
+ // case AutoClosing.ClosingAngleBracket: // TODO support auto closing when typing closing angle bracket of start tag
7994
+ case Slash:
7995
+ if (isAutoClosingTagsEnabled) {
7996
+ return typeWithAutoClosingTag(editor, text);
7994
7997
  }
7995
7998
  break;
7996
7999
  case CurlyClose:
@@ -8000,19 +8003,20 @@ const typeWithAutoClosing = async (editor, text) => {
8000
8003
  return typeWithAutoClosingEndBracket(editor, text);
8001
8004
  }
8002
8005
  break;
8006
+ case CurlyOpen:
8007
+ case RoundOpen:
8008
+ case SquareOpen:
8009
+ if (isAutoClosingBracketsEnabled) {
8010
+ return typeWithAutoClosingBracket(editor, text);
8011
+ }
8012
+ break;
8013
+ case BackTick:
8003
8014
  case DoubleQuote:
8004
8015
  case SingleQuote:
8005
- case BackTick:
8006
8016
  if (isAutoClosingQuotesEnabled) {
8007
8017
  return typeWithAutoClosingQuote(editor, text);
8008
8018
  }
8009
8019
  break;
8010
- // case AutoClosing.ClosingAngleBracket: // TODO support auto closing when typing closing angle bracket of start tag
8011
- case Slash:
8012
- if (isAutoClosingTagsEnabled) {
8013
- return typeWithAutoClosingTag(editor, text);
8014
- }
8015
- break;
8016
8020
  }
8017
8021
  const newEditor = type(editor, text);
8018
8022
  // const extraCommands: any[] = []
@@ -8042,13 +8046,13 @@ const typeWithAutoClosing = async (editor, text) => {
8042
8046
  const inverseChange = edit => {
8043
8047
  const endColumnIndex = edit.end.columnIndex - edit.deleted[0].length + edit.inserted[0].length;
8044
8048
  return {
8045
- start: edit.start,
8049
+ deleted: edit.inserted,
8046
8050
  end: {
8047
- rowIndex: edit.end.rowIndex,
8048
- columnIndex: endColumnIndex
8051
+ columnIndex: endColumnIndex,
8052
+ rowIndex: edit.end.rowIndex
8049
8053
  },
8050
8054
  inserted: edit.deleted,
8051
- deleted: edit.inserted
8055
+ start: edit.start
8052
8056
  };
8053
8057
  };
8054
8058
 
@@ -8188,11 +8192,11 @@ const editorUnindent = editor => {
8188
8192
  const isFunctional = widgetId => {
8189
8193
  switch (widgetId) {
8190
8194
  case ColorPicker$1:
8191
- case Rename$1:
8192
8195
  case Completion:
8193
8196
  case Find:
8194
- case SourceAction$1:
8195
8197
  case Hover:
8198
+ case Rename$1:
8199
+ case SourceAction$1:
8196
8200
  return true;
8197
8201
  default:
8198
8202
  return false;
@@ -8238,12 +8242,12 @@ const getWidgetInvoke = widgetId => {
8238
8242
  return invoke$4;
8239
8243
  case Find:
8240
8244
  return invoke$3;
8245
+ case Hover:
8246
+ return invoke$2;
8241
8247
  case Rename$1:
8242
8248
  return invoke$5;
8243
8249
  case SourceAction$1:
8244
8250
  return invoke$1;
8245
- case Hover:
8246
- return invoke$2;
8247
8251
  default:
8248
8252
  return undefined;
8249
8253
  }
@@ -8262,8 +8266,8 @@ const updateWidget = (editor, widgetId, newState) => {
8262
8266
  const childWidget = editor.widgets[childIndex];
8263
8267
  const newWidget = {
8264
8268
  ...childWidget,
8265
- oldState: childWidget.newState,
8266
- newState
8269
+ newState,
8270
+ oldState: childWidget.newState
8267
8271
  };
8268
8272
  const newWidgets = [...editor.widgets.slice(0, childIndex), newWidget, ...editor.widgets.slice(childIndex + 1)];
8269
8273
  return {
@@ -8350,6 +8354,8 @@ const remove$7 = widget => {
8350
8354
  return [['Viewlet.dispose', widget.newState.uid]];
8351
8355
  };
8352
8356
  const {
8357
+ close: close$4,
8358
+ closeDetails: closeDetails$1,
8353
8359
  focusFirst: focusFirst$1,
8354
8360
  focusIndex: focusIndex$2,
8355
8361
  focusLast: focusLast$1,
@@ -8359,14 +8365,12 @@ const {
8359
8365
  handleEditorClick,
8360
8366
  handleEditorDeleteLeft: handleEditorDeleteLeft$1,
8361
8367
  handleEditorType: handleEditorType$1,
8368
+ handlePointerDown,
8369
+ handleWheel: handleWheel$1,
8362
8370
  openDetails,
8363
8371
  selectCurrent: selectCurrent$1,
8364
8372
  selectIndex: selectIndex$1,
8365
- toggleDetails: toggleDetails$1,
8366
- closeDetails: closeDetails$1,
8367
- handleWheel: handleWheel$1,
8368
- close: close$4,
8369
- handlePointerDown
8373
+ toggleDetails: toggleDetails$1
8370
8374
  } = createFns(['handleEditorType', 'focusFirst', 'focusNext', 'focusPrevious', 'focusLast', 'handleEditorDeleteLeft', 'openDetails', 'focusIndex', 'handleEditorBlur', 'handleEditorClick', 'openDetails', 'selectCurrent', 'selectIndex', 'toggleDetails', 'closeDetails', 'handleWheel', 'close', 'handlePointerDown'], 'Completions', Completion);
8371
8375
 
8372
8376
  const EditorCompletionWidget = {
@@ -8426,8 +8430,10 @@ const {
8426
8430
  focusCloseButton,
8427
8431
  focusFind,
8428
8432
  focusNext: focusNext$2,
8433
+ focusNextElement,
8429
8434
  focusNextMatchButton,
8430
8435
  focusPrevious: focusPrevious$1,
8436
+ focusPreviousElement,
8431
8437
  focusPreviousMatchButton,
8432
8438
  focusReplace,
8433
8439
  focusReplaceAllButton,
@@ -8444,11 +8450,9 @@ const {
8444
8450
  replaceAll,
8445
8451
  toggleMatchCase,
8446
8452
  toggleMatchWholeWord,
8453
+ togglePreserveCase,
8447
8454
  toggleReplace,
8448
- toggleUseRegularExpression,
8449
- focusNextElement,
8450
- focusPreviousElement,
8451
- togglePreserveCase
8455
+ toggleUseRegularExpression
8452
8456
  } = createFns(['close', 'focusCloseButton', 'focusFind', 'focusNext', 'focusNextMatchButton', 'focusPrevious', 'focusPreviousMatchButton', 'focusReplace', 'focusReplaceAllButton', 'focusReplaceButton', 'focusToggleReplace', 'handleBlur', 'handleClickButton', 'handleFocus', 'handleInput', 'handleReplaceFocus', 'handleReplaceInput', 'handleToggleReplaceFocus', 'replace', 'replaceAll', 'toggleMatchCase', 'toggleMatchWholeWord', 'toggleReplace', 'toggleUseRegularExpression', 'focusNextElement', 'focusPreviousElement', 'togglePreserveCase'], 'FindWidget', Find);
8453
8457
 
8454
8458
  const EditorFindWidget = {
@@ -8489,10 +8493,10 @@ const executeHoverProvider = async (editor, offset) => {
8489
8493
  object(editor);
8490
8494
  number(offset);
8491
8495
  return execute({
8492
- event: OnHover,
8496
+ args: [offset],
8493
8497
  editor,
8498
+ event: OnHover,
8494
8499
  method: HoverExecute,
8495
- args: [offset],
8496
8500
  noProviderFoundMessage: 'No hover provider found'
8497
8501
  });
8498
8502
  };
@@ -8532,9 +8536,9 @@ const getLineInfo = (line, tokens, TokenMap) => {
8532
8536
  const getLineInfos = (lines, tokenizer, languageId) => {
8533
8537
  const lineInfos = [];
8534
8538
  const {
8535
- tokenizeLine,
8536
- initialLineState,
8537
8539
  hasArrayReturn,
8540
+ initialLineState,
8541
+ tokenizeLine,
8538
8542
  TokenMap
8539
8543
  } = tokenizer;
8540
8544
  let currentLineState = getInitialLineState(initialLineState);
@@ -8565,8 +8569,8 @@ const getHoverPosition = (position, selections) => {
8565
8569
  const rowIndex = selections[0];
8566
8570
  const columnIndex = selections[1];
8567
8571
  return {
8568
- rowIndex,
8569
- columnIndex
8572
+ columnIndex,
8573
+ rowIndex
8570
8574
  };
8571
8575
  };
8572
8576
  const getMatchingDiagnostics = (diagnostics, rowIndex, columnIndex) => {
@@ -8595,8 +8599,8 @@ const getEditorHoverInfo = async (editorUid, position) => {
8595
8599
  selections
8596
8600
  } = editor;
8597
8601
  const {
8598
- rowIndex,
8599
- columnIndex
8602
+ columnIndex,
8603
+ rowIndex
8600
8604
  } = getHoverPosition(position, selections);
8601
8605
  const offset = offsetAt(editor, rowIndex, columnIndex);
8602
8606
  const hover = await getHover(editor, offset);
@@ -8605,8 +8609,8 @@ const getEditorHoverInfo = async (editorUid, position) => {
8605
8609
  }
8606
8610
  const {
8607
8611
  displayString,
8608
- documentation,
8609
- displayStringLanguageId
8612
+ displayStringLanguageId,
8613
+ documentation
8610
8614
  } = hover;
8611
8615
  const tokenizerPath = '';
8612
8616
  const lineInfos = await tokenizeCodeBlock(displayString, displayStringLanguageId || fallbackDisplayStringLanguageId, tokenizerPath);
@@ -8620,11 +8624,11 @@ const getEditorHoverInfo = async (editorUid, position) => {
8620
8624
  const diagnostics = editor.diagnostics || [];
8621
8625
  const matchingDiagnostics = getMatchingDiagnostics(diagnostics, rowIndex);
8622
8626
  return {
8623
- lineInfos,
8624
8627
  documentation,
8628
+ lineInfos,
8629
+ matchingDiagnostics,
8625
8630
  x,
8626
- y,
8627
- matchingDiagnostics
8631
+ y
8628
8632
  };
8629
8633
  };
8630
8634
 
@@ -8634,19 +8638,19 @@ const loadContent = async (editorUid, state, position) => {
8634
8638
  return state;
8635
8639
  }
8636
8640
  const {
8637
- lineInfos,
8638
8641
  documentation,
8642
+ lineInfos,
8643
+ matchingDiagnostics,
8639
8644
  x,
8640
- y,
8641
- matchingDiagnostics
8645
+ y
8642
8646
  } = hoverInfo;
8643
8647
  return {
8644
8648
  ...state,
8645
- lineInfos,
8649
+ diagnostics: matchingDiagnostics,
8646
8650
  documentation,
8651
+ lineInfos,
8647
8652
  x,
8648
- y,
8649
- diagnostics: matchingDiagnostics
8653
+ y
8650
8654
  };
8651
8655
  };
8652
8656
  const handleSashPointerDown = (state, eventX, eventY) => {
@@ -8710,25 +8714,25 @@ const Text = 12;
8710
8714
 
8711
8715
  const text = data => {
8712
8716
  return {
8713
- type: Text,
8717
+ childCount: 0,
8714
8718
  text: data,
8715
- childCount: 0
8719
+ type: Text
8716
8720
  };
8717
8721
  };
8718
8722
 
8719
8723
  const getLineInfoVirtualDom = lineInfo => {
8720
8724
  const dom = [{
8721
- type: Div,
8725
+ childCount: lineInfo.length / 2,
8722
8726
  className: HoverEditorRow,
8723
- childCount: lineInfo.length / 2
8727
+ type: Div
8724
8728
  }];
8725
8729
  for (let i = 0; i < lineInfo.length; i += 2) {
8726
8730
  const tokenText = lineInfo[i];
8727
8731
  const tokenClass = lineInfo[i + 1];
8728
8732
  dom.push({
8729
- type: Span,
8733
+ childCount: 1,
8730
8734
  className: tokenClass,
8731
- childCount: 1
8735
+ type: Span
8732
8736
  }, text(tokenText));
8733
8737
  }
8734
8738
  return dom;
@@ -8739,14 +8743,14 @@ const getLineInfosVirtualDom = lineInfos => {
8739
8743
  };
8740
8744
 
8741
8745
  const hoverProblemMessage = {
8742
- type: Span,
8746
+ childCount: 1,
8743
8747
  className: HoverProblemMessage,
8744
- childCount: 1
8748
+ type: Span
8745
8749
  };
8746
8750
  const hoverProblemDetail = {
8747
- type: Span,
8751
+ childCount: 1,
8748
8752
  className: HoverProblemDetail,
8749
- childCount: 1
8753
+ type: Span
8750
8754
  };
8751
8755
  const getChildCount = (lineInfos, documentation, diagnostics) => {
8752
8756
  return lineInfos.length + documentation ? 1 : 0 + (diagnostics && diagnostics.length > 0) ? 1 : 0;
@@ -8754,15 +8758,15 @@ const getChildCount = (lineInfos, documentation, diagnostics) => {
8754
8758
  const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
8755
8759
  const dom = [];
8756
8760
  dom.push({
8757
- type: Div,
8761
+ childCount: getChildCount(lineInfos, documentation, diagnostics) + 1,
8758
8762
  className: 'Viewlet EditorHover',
8759
- childCount: getChildCount(lineInfos, documentation, diagnostics) + 1
8763
+ type: Div
8760
8764
  });
8761
8765
  if (diagnostics && diagnostics.length > 0) {
8762
8766
  dom.push({
8763
- type: Div,
8767
+ childCount: diagnostics.length * 2,
8764
8768
  className: `${HoverDisplayString} ${HoverProblem}`,
8765
- childCount: diagnostics.length * 2
8769
+ type: Div
8766
8770
  });
8767
8771
  for (const diagnostic of diagnostics) {
8768
8772
  dom.push(hoverProblemMessage, text(diagnostic.message), hoverProblemDetail, text(`${diagnostic.source} (${diagnostic.code})`));
@@ -8771,48 +8775,48 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
8771
8775
  if (lineInfos.length > 0) {
8772
8776
  const lineInfosDom = getLineInfosVirtualDom(lineInfos);
8773
8777
  dom.push({
8774
- type: Div,
8778
+ childCount: lineInfos.length,
8775
8779
  className: HoverDisplayString,
8776
- childCount: lineInfos.length
8780
+ type: Div
8777
8781
  }, ...lineInfosDom);
8778
8782
  }
8779
8783
  if (documentation) {
8780
8784
  dom.push({
8781
- type: Div,
8785
+ childCount: 1,
8782
8786
  className: HoverDocumentation,
8783
- childCount: 1
8787
+ type: Div
8784
8788
  }, text(documentation));
8785
8789
  }
8786
8790
  dom.push({
8787
- type: Div,
8788
- className: 'Sash SashVertical SashResize',
8789
8791
  childCount: 0,
8790
- onPointerDown: HandleSashPointerDown
8792
+ className: 'Sash SashVertical SashResize',
8793
+ onPointerDown: HandleSashPointerDown,
8794
+ type: Div
8791
8795
  });
8792
8796
  return dom;
8793
8797
  };
8794
8798
 
8795
8799
  const renderHoverDom = {
8796
- isEqual(oldState, newState) {
8797
- return oldState.lineInfos === newState.lineInfos && oldState.documentation === newState.documentation && oldState.diagnostics === newState.diagnostics;
8798
- },
8799
8800
  apply(oldState, newState) {
8800
8801
  const dom = getHoverVirtualDom(newState.lineInfos, newState.documentation, newState.diagnostics);
8801
8802
  return [/* method */SetDom2, dom];
8803
+ },
8804
+ isEqual(oldState, newState) {
8805
+ return oldState.lineInfos === newState.lineInfos && oldState.documentation === newState.documentation && oldState.diagnostics === newState.diagnostics;
8802
8806
  }
8803
8807
  };
8804
8808
  const renderBounds$2 = {
8805
- isEqual(oldState, newState) {
8806
- return oldState.x === newState.x && oldState.y === newState.y;
8807
- },
8808
8809
  apply(oldState, newState) {
8809
8810
  const {
8810
- x,
8811
- y,
8811
+ height,
8812
8812
  width,
8813
- height
8813
+ x,
8814
+ y
8814
8815
  } = newState;
8815
8816
  return [SetBounds, x, y, width, height];
8817
+ },
8818
+ isEqual(oldState, newState) {
8819
+ return oldState.x === newState.x && oldState.y === newState.y;
8816
8820
  }
8817
8821
  };
8818
8822
  const render$9 = [renderHoverDom, renderBounds$2];
@@ -8848,9 +8852,9 @@ const remove$5 = widget => {
8848
8852
  return [['Viewlet.dispose', widget.newState.uid]];
8849
8853
  };
8850
8854
  const {
8851
- handleInput,
8855
+ accept,
8852
8856
  close: close$2,
8853
- accept
8857
+ handleInput
8854
8858
  } = createFns(['handleInput', 'close', 'accept'], 'Rename', Rename$1);
8855
8859
 
8856
8860
  const EditorRenameWidget = {
@@ -8906,18 +8910,18 @@ const add$4 = widget => {
8906
8910
  };
8907
8911
  const remove$4 = removeWidget$1;
8908
8912
  const {
8913
+ close: close$1,
8914
+ closeDetails,
8909
8915
  focusFirst,
8910
8916
  focusIndex,
8911
8917
  focusLast,
8912
8918
  focusNext,
8913
8919
  focusPrevious,
8920
+ handleWheel,
8914
8921
  selectCurrent,
8915
8922
  selectIndex,
8916
8923
  selectItem,
8917
- toggleDetails,
8918
- closeDetails,
8919
- handleWheel,
8920
- close: close$1
8924
+ toggleDetails
8921
8925
  } = createFns(['focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusPrevious', 'selectCurrent', 'selectIndex', 'selectItem', 'toggleDetails', 'closeDetails', 'handleWheel', 'close'], 'SourceActions', SourceAction$1);
8922
8926
 
8923
8927
  const EditorSourceActionWidget = {
@@ -9106,8 +9110,8 @@ const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocu
9106
9110
  const newWidgets = [...widgets.slice(0, index), ...widgets.slice(index + 1)];
9107
9111
  const newEditor = {
9108
9112
  ...editor,
9109
- widgets: newWidgets,
9110
- focused: true
9113
+ focused: true,
9114
+ widgets: newWidgets
9111
9115
  };
9112
9116
  set$6(editorUid, editor, newEditor);
9113
9117
  await setFocus(FocusEditorText);
@@ -9194,356 +9198,356 @@ const ensure = async (fontName, fontUrl) => {
9194
9198
 
9195
9199
  const getKeyBindings = () => {
9196
9200
  return [{
9197
- key: Escape,
9198
9201
  command: 'Editor.closeSourceAction',
9202
+ key: Escape,
9199
9203
  when: FocusSourceActions
9200
9204
  }, {
9201
- key: DownArrow,
9202
9205
  command: 'EditorSourceActions.focusNext',
9206
+ key: DownArrow,
9203
9207
  when: FocusSourceActions
9204
9208
  }, {
9205
- key: UpArrow,
9206
9209
  command: 'EditorSourceActions.focusPrevious',
9210
+ key: UpArrow,
9207
9211
  when: FocusSourceActions
9208
9212
  }, {
9209
- key: Home,
9210
9213
  command: 'EditorSourceActions.focusFirst',
9214
+ key: Home,
9211
9215
  when: FocusSourceActions
9212
9216
  }, {
9213
- key: End,
9214
9217
  command: 'EditorSourceActions.focusLast',
9218
+ key: End,
9215
9219
  when: FocusSourceActions
9216
9220
  }, {
9217
- key: Enter,
9218
9221
  command: 'EditorSourceActions.selectCurrent',
9222
+ key: Enter,
9219
9223
  when: FocusSourceActions
9220
9224
  }, {
9221
- key: Enter,
9222
9225
  command: 'FindWidget.focusNext',
9226
+ key: Enter,
9223
9227
  when: FocusFindWidget
9224
9228
  }, {
9225
- key: CtrlCmd | KeyF,
9226
9229
  command: 'FindWidget.preventDefaultBrowserFind',
9230
+ key: CtrlCmd | KeyF,
9227
9231
  when: FocusFindWidget
9228
9232
  }, {
9229
- key: Shift | F4,
9230
9233
  command: 'FindWidget.focusPrevious',
9234
+ key: Shift | F4,
9231
9235
  when: FocusFindWidget
9232
9236
  }, {
9233
- key: F4,
9234
9237
  command: 'FindWidget.focusNext',
9238
+ key: F4,
9235
9239
  when: FocusFindWidget
9236
9240
  }, {
9237
- key: Shift | Tab$1,
9238
9241
  command: 'FindWidget.focusToggleReplace',
9242
+ key: Shift | Tab$1,
9239
9243
  when: FocusFindWidget
9240
9244
  }, {
9241
- key: Tab$1,
9242
9245
  command: 'FindWidget.focusReplace',
9246
+ key: Tab$1,
9243
9247
  when: FocusFindWidget
9244
9248
  }, {
9245
- key: Tab$1,
9246
9249
  command: 'FindWidget.focusPreviousMatchButton',
9250
+ key: Tab$1,
9247
9251
  when: FocusFindWidgetReplace
9248
9252
  }, {
9249
- key: Alt$1 | CtrlCmd | Enter,
9250
9253
  command: 'FindWidget.replaceAll',
9254
+ key: Alt$1 | CtrlCmd | Enter,
9251
9255
  when: FocusFindWidgetReplace
9252
9256
  }, {
9253
- key: Tab$1,
9254
9257
  command: 'FindWidget.focusNextMatchButton',
9258
+ key: Tab$1,
9255
9259
  when: FocusFindWidgetPreviousMatchButton
9256
9260
  }, {
9257
- key: Shift | Tab$1,
9258
9261
  command: 'FindWidget.focusReplace',
9262
+ key: Shift | Tab$1,
9259
9263
  when: FocusFindWidgetPreviousMatchButton
9260
9264
  }, {
9261
- key: Shift | Tab$1,
9262
9265
  command: 'FindWidget.focusPreviousMatchButton',
9266
+ key: Shift | Tab$1,
9263
9267
  when: FocusFindWidgetNextMatchButton
9264
9268
  }, {
9265
- key: Tab$1,
9266
9269
  command: 'FindWidget.focusCloseButton',
9270
+ key: Tab$1,
9267
9271
  when: FocusFindWidgetNextMatchButton
9268
9272
  }, {
9269
- key: Shift | Tab$1,
9270
9273
  command: 'FindWidget.focusNextMatchButton',
9274
+ key: Shift | Tab$1,
9271
9275
  when: FocusFindWidgetCloseButton
9272
9276
  }, {
9273
- key: Tab$1,
9274
9277
  command: 'FindWidget.focusReplaceButton',
9278
+ key: Tab$1,
9275
9279
  when: FocusFindWidgetCloseButton
9276
9280
  }, {
9277
- key: Shift | Tab$1,
9278
9281
  command: 'FindWidget.focusFind',
9282
+ key: Shift | Tab$1,
9279
9283
  when: FocusFindWidgetReplace
9280
9284
  }, {
9281
- key: Tab$1,
9282
9285
  command: 'FindWidget.focusReplaceAllButton',
9286
+ key: Tab$1,
9283
9287
  when: FocusFindWidgetReplaceButton
9284
9288
  }, {
9285
- key: Shift | Tab$1,
9286
9289
  command: 'FindWidget.focusCloseButton',
9290
+ key: Shift | Tab$1,
9287
9291
  when: FocusFindWidgetReplaceButton
9288
9292
  }, {
9289
- key: Shift | Tab$1,
9290
9293
  command: 'FindWidget.focusReplaceButton',
9294
+ key: Shift | Tab$1,
9291
9295
  when: FocusFindWidgetReplaceAllButton
9292
9296
  }, {
9293
- key: DownArrow,
9294
9297
  command: 'EditorCompletion.focusNext',
9298
+ key: DownArrow,
9295
9299
  when: FocusEditorCompletions
9296
9300
  }, {
9297
- key: UpArrow,
9298
9301
  command: 'EditorCompletion.focusPrevious',
9302
+ key: UpArrow,
9299
9303
  when: FocusEditorCompletions
9300
9304
  }, {
9301
- key: Enter,
9302
9305
  command: 'EditorCompletion.selectCurrent',
9306
+ key: Enter,
9303
9307
  when: FocusEditorCompletions
9304
9308
  }, {
9305
- key: Escape,
9306
9309
  command: 'EditorCompletion.close',
9310
+ key: Escape,
9307
9311
  when: FocusEditorCompletions
9308
9312
  }, {
9309
- key: End,
9310
9313
  command: 'EditorCompletion.focusLast',
9314
+ key: End,
9311
9315
  when: FocusEditorCompletions
9312
9316
  }, {
9313
- key: Home,
9314
9317
  command: 'EditorCompletion.focusFirst',
9318
+ key: Home,
9315
9319
  when: FocusEditorCompletions
9316
9320
  }, {
9317
- key: CtrlCmd | Space$1,
9318
9321
  command: 'EditorCompletion.toggleDetails',
9322
+ key: CtrlCmd | Space$1,
9319
9323
  when: FocusEditorCompletions
9320
9324
  }, {
9321
- key: CtrlCmd | RightArrow,
9322
9325
  command: 'Editor.cursorWordRight',
9326
+ key: CtrlCmd | RightArrow,
9323
9327
  when: FocusEditorText
9324
9328
  }, {
9325
- key: CtrlCmd | LeftArrow,
9326
9329
  command: 'Editor.cursorWordLeft',
9330
+ key: CtrlCmd | LeftArrow,
9327
9331
  when: FocusEditorText
9328
9332
  }, {
9329
- key: Alt$1 | Backspace,
9330
9333
  command: 'Editor.deleteWordPartLeft',
9334
+ key: Alt$1 | Backspace,
9331
9335
  when: FocusEditorText
9332
9336
  }, {
9333
- key: Alt$1 | Delete,
9334
9337
  command: 'Editor.deleteWordPartRight',
9338
+ key: Alt$1 | Delete,
9335
9339
  when: FocusEditorText
9336
9340
  }, {
9337
- key: CtrlCmd | Backspace,
9338
9341
  command: 'Editor.deleteWordLeft',
9342
+ key: CtrlCmd | Backspace,
9339
9343
  when: FocusEditorText
9340
9344
  }, {
9341
- key: CtrlCmd | Delete,
9342
9345
  command: 'Editor.deleteWordRight',
9346
+ key: CtrlCmd | Delete,
9343
9347
  when: FocusEditorText
9344
9348
  }, {
9345
- key: CtrlCmd | KeyD,
9346
9349
  command: 'Editor.selectNextOccurrence',
9350
+ key: CtrlCmd | KeyD,
9347
9351
  when: FocusEditorText
9348
9352
  }, {
9349
- key: CtrlCmd | KeyJ,
9350
9353
  command: 'Editor.openColorPicker',
9354
+ key: CtrlCmd | KeyJ,
9351
9355
  when: FocusEditorText
9352
9356
  }, {
9353
- key: CtrlCmd | Period,
9354
9357
  command: 'Editor.showSourceActions3',
9358
+ key: CtrlCmd | Period,
9355
9359
  when: FocusEditorText
9356
9360
  }, {
9357
- key: Tab$1,
9358
9361
  command: 'Editor.handleTab',
9362
+ key: Tab$1,
9359
9363
  when: FocusEditorText
9360
9364
  }, {
9361
- key: Shift | Tab$1,
9362
9365
  command: 'Editor.unindent',
9366
+ key: Shift | Tab$1,
9363
9367
  when: FocusEditorText
9364
9368
  }, {
9365
- key: CtrlCmd | BracketLeft,
9366
9369
  command: 'Editor.indentLess',
9370
+ key: CtrlCmd | BracketLeft,
9367
9371
  when: FocusEditorText
9368
9372
  }, {
9369
- key: Escape,
9370
9373
  command: 'Editor.closeFind',
9374
+ key: Escape,
9371
9375
  when: FocusFindWidget
9372
9376
  }, {
9373
- key: CtrlCmd | KeyF,
9374
9377
  command: 'Editor.openFind2',
9378
+ key: CtrlCmd | KeyF,
9375
9379
  when: FocusEditorText
9376
9380
  }, {
9377
- key: CtrlCmd | KeyK,
9378
9381
  command: 'Editor.openCodeGenerator',
9382
+ key: CtrlCmd | KeyK,
9379
9383
  when: FocusEditorText
9380
9384
  }, {
9381
- key: Escape,
9382
9385
  command: 'Editor.closeCodeGenerator',
9386
+ key: Escape,
9383
9387
  when: FocusEditorCodeGenerator
9384
9388
  }, {
9385
- key: Enter,
9386
9389
  command: 'EditorCodeGenerator.accept',
9390
+ key: Enter,
9387
9391
  when: FocusEditorCodeGenerator
9388
9392
  }, {
9389
- key: CtrlCmd | BracketRight,
9390
9393
  command: 'Editor.indentMore',
9394
+ key: CtrlCmd | BracketRight,
9391
9395
  when: FocusEditorText
9392
9396
  }, {
9393
- key: Shift | LeftArrow,
9394
9397
  command: 'Editor.selectCharacterLeft',
9398
+ key: Shift | LeftArrow,
9395
9399
  when: FocusEditorText
9396
9400
  }, {
9397
- key: CtrlCmd | Shift | LeftArrow,
9398
9401
  command: 'Editor.selectWordLeft',
9402
+ key: CtrlCmd | Shift | LeftArrow,
9399
9403
  when: FocusEditorText
9400
9404
  }, {
9401
- key: Shift | RightArrow,
9402
9405
  command: 'Editor.selectCharacterRight',
9406
+ key: Shift | RightArrow,
9403
9407
  when: FocusEditorText
9404
9408
  }, {
9405
- key: CtrlCmd | Shift | RightArrow,
9406
9409
  command: 'Editor.selectWordRight',
9410
+ key: CtrlCmd | Shift | RightArrow,
9407
9411
  when: FocusEditorText
9408
9412
  }, {
9409
- key: CtrlCmd | KeyL,
9410
9413
  command: 'Editor.selectLine',
9414
+ key: CtrlCmd | KeyL,
9411
9415
  when: FocusEditorText
9412
9416
  }, {
9413
- key: CtrlCmd | Shift | Backspace,
9414
9417
  command: 'Editor.deleteAllLeft',
9418
+ key: CtrlCmd | Shift | Backspace,
9415
9419
  when: FocusEditorText
9416
9420
  }, {
9417
- key: CtrlCmd | Shift | Delete,
9418
9421
  command: 'Editor.deleteAllRight',
9422
+ key: CtrlCmd | Shift | Delete,
9419
9423
  when: FocusEditorText
9420
9424
  }, {
9421
- key: Escape,
9422
9425
  command: 'Editor.cancelSelection',
9426
+ key: Escape,
9423
9427
  when: FocusEditorText
9424
9428
  }, {
9425
- key: CtrlCmd | KeyZ,
9426
9429
  command: 'Editor.undo',
9430
+ key: CtrlCmd | KeyZ,
9427
9431
  when: FocusEditorText
9428
9432
  }, {
9429
- key: LeftArrow,
9430
9433
  command: 'Editor.cursorLeft',
9434
+ key: LeftArrow,
9431
9435
  when: FocusEditorText
9432
9436
  }, {
9433
- key: RightArrow,
9434
9437
  command: 'Editor.cursorRight',
9438
+ key: RightArrow,
9435
9439
  when: FocusEditorText
9436
9440
  }, {
9437
- key: UpArrow,
9438
9441
  command: 'Editor.cursorUp',
9442
+ key: UpArrow,
9439
9443
  when: FocusEditorText
9440
9444
  }, {
9441
- key: DownArrow,
9442
9445
  command: 'Editor.cursorDown',
9446
+ key: DownArrow,
9443
9447
  when: FocusEditorText
9444
9448
  }, {
9445
- key: Backspace,
9446
9449
  command: 'Editor.deleteLeft',
9450
+ key: Backspace,
9447
9451
  when: FocusEditorText
9448
9452
  }, {
9449
- key: Delete,
9450
9453
  command: 'Editor.deleteRight',
9454
+ key: Delete,
9451
9455
  when: FocusEditorText
9452
9456
  }, {
9453
- key: Enter,
9454
9457
  command: 'Editor.insertLineBreak',
9458
+ key: Enter,
9455
9459
  when: FocusEditorText
9456
9460
  }, {
9457
- key: CtrlCmd | Shift | KeyD,
9458
9461
  command: 'Editor.copyLineDown',
9462
+ key: CtrlCmd | Shift | KeyD,
9459
9463
  when: FocusEditorText
9460
9464
  }, {
9461
- key: CtrlCmd | Shift | DownArrow,
9462
9465
  command: 'Editor.moveLineDown',
9466
+ key: CtrlCmd | Shift | DownArrow,
9463
9467
  when: FocusEditorText
9464
9468
  }, {
9465
- key: CtrlCmd | Shift | UpArrow,
9466
9469
  command: 'Editor.moveLineUp',
9470
+ key: CtrlCmd | Shift | UpArrow,
9467
9471
  when: FocusEditorText
9468
9472
  }, {
9469
- key: CtrlCmd | Space$1,
9470
9473
  command: 'Editor.openCompletion',
9474
+ key: CtrlCmd | Space$1,
9471
9475
  when: FocusEditorText
9472
9476
  }, {
9473
- key: F2,
9474
9477
  command: 'Editor.openRename',
9478
+ key: F2,
9475
9479
  when: FocusEditorText
9476
9480
  }, {
9477
- key: Enter,
9478
9481
  command: 'EditorRename.accept',
9482
+ key: Enter,
9479
9483
  when: FocusEditorRename
9480
9484
  }, {
9481
- key: Escape,
9482
9485
  command: 'Editor.closeRename',
9486
+ key: Escape,
9483
9487
  when: FocusEditorRename
9484
9488
  }, {
9485
- key: Home,
9486
9489
  command: 'Editor.cursorHome',
9490
+ key: Home,
9487
9491
  when: FocusEditorText
9488
9492
  }, {
9489
- key: End,
9490
9493
  command: 'Editor.cursorEnd',
9494
+ key: End,
9491
9495
  when: FocusEditorText
9492
9496
  }, {
9493
- key: CtrlCmd | Slash$1,
9494
9497
  command: 'Editor.toggleComment',
9498
+ key: CtrlCmd | Slash$1,
9495
9499
  when: FocusEditorText
9496
9500
  }, {
9497
- key: CtrlCmd | KeyC,
9498
9501
  command: 'Editor.copy',
9502
+ key: CtrlCmd | KeyC,
9499
9503
  when: FocusEditorText
9500
9504
  }, {
9501
- key: CtrlCmd | KeyA,
9502
9505
  command: 'Editor.selectAll',
9506
+ key: CtrlCmd | KeyA,
9503
9507
  when: FocusEditorText
9504
9508
  }, {
9505
- key: CtrlCmd | KeyH,
9506
9509
  command: 'Editor.showHover2',
9510
+ key: CtrlCmd | KeyH,
9507
9511
  when: FocusEditorText
9508
9512
  }, {
9509
- key: CtrlCmd | KeyX,
9510
9513
  command: 'Editor.cut',
9514
+ key: CtrlCmd | KeyX,
9511
9515
  when: FocusEditorText
9512
9516
  }, {
9513
- key: CtrlCmd | KeyV,
9514
9517
  command: 'Editor.paste',
9518
+ key: CtrlCmd | KeyV,
9515
9519
  when: FocusEditorText
9516
9520
  }, {
9517
- key: Alt$1 | LeftArrow,
9518
9521
  command: 'Editor.cursorWordPartLeft',
9522
+ key: Alt$1 | LeftArrow,
9519
9523
  when: FocusEditorText
9520
9524
  }, {
9521
- key: Alt$1 | RightArrow,
9522
9525
  command: 'Editor.cursorWordPartRight',
9526
+ key: Alt$1 | RightArrow,
9523
9527
  when: FocusEditorText
9524
9528
  }, {
9525
- key: Alt$1 | F3,
9526
9529
  command: 'Editor.selectAllOccurrences',
9530
+ key: Alt$1 | F3,
9527
9531
  when: FocusEditorText
9528
9532
  }, {
9529
- key: Alt$1 | Shift | UpArrow,
9530
9533
  command: 'Editor.addCursorAbove',
9534
+ key: Alt$1 | Shift | UpArrow,
9531
9535
  when: FocusEditorText
9532
9536
  }, {
9533
- key: Alt$1 | Shift | DownArrow,
9534
9537
  command: 'Editor.addCursorBelow',
9538
+ key: Alt$1 | Shift | DownArrow,
9535
9539
  when: FocusEditorText
9536
9540
  }, {
9537
- key: Alt$1 | Shift | F12,
9538
9541
  command: 'Editor.findAllReferences',
9542
+ key: Alt$1 | Shift | F12,
9539
9543
  when: FocusEditorText
9540
9544
  }, {
9541
- key: Alt$1 | Shift | KeyO,
9542
9545
  command: 'Editor.organizeImports',
9546
+ key: Alt$1 | Shift | KeyO,
9543
9547
  when: FocusEditorText
9544
9548
  }, {
9545
- key: CtrlCmd | Shift | Space$1,
9546
9549
  command: 'Editor.selectionGrow',
9550
+ key: CtrlCmd | Shift | Space$1,
9547
9551
  when: FocusEditor
9548
9552
  }];
9549
9553
  };
@@ -9562,65 +9566,65 @@ const commandPalette = () => {
9562
9566
  };
9563
9567
 
9564
9568
  const menuEntrySeparator = {
9565
- id: 'separator',
9566
- label: '',
9569
+ command: '',
9567
9570
  flags: Separator,
9568
- command: ''
9571
+ id: 'separator',
9572
+ label: ''
9569
9573
  };
9570
9574
 
9571
9575
  const getMenuEntries = () => {
9572
9576
  return [{
9573
- id: 'go-to-definition',
9574
- label: goToDefinition$1(),
9577
+ command: 'Editor.goToDefinition',
9575
9578
  flags: None,
9576
- command: 'Editor.goToDefinition'
9579
+ id: 'go-to-definition',
9580
+ label: goToDefinition$1()
9577
9581
  }, {
9578
- id: 'go-to-type-definition',
9579
- label: goToTypeDefinition$1(),
9582
+ command: /* Editor.goToTypeDefinition */'Editor.goToTypeDefinition',
9580
9583
  flags: None,
9581
- command: /* Editor.goToTypeDefinition */'Editor.goToTypeDefinition'
9584
+ id: 'go-to-type-definition',
9585
+ label: goToTypeDefinition$1()
9582
9586
  }, menuEntrySeparator, {
9583
- id: 'find-all-references',
9584
- label: findAllReferences(),
9585
- flags: None,
9587
+ args: [/* id */'References', /* focus */true],
9586
9588
  command: /* ViewletSideBar.show */'SideBar.show',
9587
- args: [/* id */'References', /* focus */true]
9588
- }, {
9589
- id: 'find-all-implementations',
9590
- label: findAllImplementations(),
9591
9589
  flags: None,
9590
+ id: 'find-all-references',
9591
+ label: findAllReferences()
9592
+ }, {
9593
+ args: [/* id */'Implementations', /* focus */true],
9592
9594
  command: /* ViewletSideBar.show */'SideBar.show',
9593
- args: [/* id */'Implementations', /* focus */true]
9595
+ flags: None,
9596
+ id: 'find-all-implementations',
9597
+ label: findAllImplementations()
9594
9598
  }, menuEntrySeparator, {
9595
- id: 'format',
9596
- label: formatDocument(),
9599
+ command: 'Editor.format',
9597
9600
  flags: None,
9598
- command: 'Editor.format'
9601
+ id: 'format',
9602
+ label: formatDocument()
9599
9603
  }, {
9600
- id: SourceControl,
9601
- label: sourceAction(),
9604
+ command: 'Editor.showSourceActions2',
9602
9605
  flags: None,
9603
- command: 'Editor.showSourceActions2'
9606
+ id: SourceControl,
9607
+ label: sourceAction()
9604
9608
  }, menuEntrySeparator, {
9605
- id: 'cut',
9606
- label: cut(),
9609
+ command: /* Editor.cut */'Editor.cut',
9607
9610
  flags: None,
9608
- command: /* Editor.cut */'Editor.cut'
9611
+ id: 'cut',
9612
+ label: cut()
9609
9613
  }, {
9610
- id: 'copy',
9611
- label: copy(),
9614
+ command: /* Editor.copy */'Editor.copy',
9612
9615
  flags: None,
9613
- command: /* Editor.copy */'Editor.copy'
9616
+ id: 'copy',
9617
+ label: copy()
9614
9618
  }, {
9615
- id: 'paste',
9616
- label: paste$1(),
9619
+ command: /* Editor.paste */'Editor.paste',
9617
9620
  flags: None,
9618
- command: /* Editor.paste */'Editor.paste'
9621
+ id: 'paste',
9622
+ label: paste$1()
9619
9623
  }, menuEntrySeparator, {
9620
- id: 'commandPalette',
9621
- label: commandPalette(),
9624
+ command: 'QuickPick.showEverything',
9622
9625
  flags: None,
9623
- command: 'QuickPick.showEverything'
9626
+ id: 'commandPalette',
9627
+ label: commandPalette()
9624
9628
  }];
9625
9629
  };
9626
9630
 
@@ -9672,13 +9676,13 @@ const getQuickPickMenuEntries = () => {
9672
9676
  id: 'Editor.selectInsideString',
9673
9677
  label: editorSelectInsideString()
9674
9678
  }, {
9679
+ aliases: ['Indent More', 'DeIndent'],
9675
9680
  id: 'Editor.indent',
9676
- label: editorIndent(),
9677
- aliases: ['Indent More', 'DeIndent']
9681
+ label: editorIndent()
9678
9682
  }, {
9683
+ aliases: ['Indent Less', 'DeIndent'],
9679
9684
  id: 'Editor.unindent',
9680
- label: editorUnindent$1(),
9681
- aliases: ['Indent Less', 'DeIndent']
9685
+ label: editorUnindent$1()
9682
9686
  }, {
9683
9687
  id: 'Editor.sortLinesAscending',
9684
9688
  label: editorSortLinesAscending()
@@ -9748,8 +9752,8 @@ const handleBeforeInput = (editor, inputType, data) => {
9748
9752
 
9749
9753
  const handleMessagePort = async (port, rpcId) => {
9750
9754
  const rpc = await PlainMessagePortRpcParent.create({
9751
- messagePort: port,
9752
- commandMap: {}
9755
+ commandMap: {},
9756
+ messagePort: port
9753
9757
  });
9754
9758
  if (rpcId) {
9755
9759
  set$b(rpcId, rpc);
@@ -9991,9 +9995,9 @@ const getCursorsVirtualDom = cursors => {
9991
9995
  const dom = [];
9992
9996
  for (const translate of cursors) {
9993
9997
  dom.push({
9994
- type: Div,
9995
9998
  className: EditorCursor,
9996
- translate
9999
+ translate,
10000
+ type: Div
9997
10001
  });
9998
10002
  }
9999
10003
  return dom;
@@ -10020,21 +10024,21 @@ const mergeClassNames = (...classNames) => {
10020
10024
 
10021
10025
  const getDiagnosticVirtualDom = diagnostic => {
10022
10026
  const {
10023
- x,
10024
- y,
10025
- width,
10026
10027
  height,
10027
- type
10028
+ type,
10029
+ width,
10030
+ x,
10031
+ y
10028
10032
  } = diagnostic;
10029
10033
  const extraClassName = getDiagnosticClassName(type);
10030
10034
  return [{
10031
- type: Div,
10035
+ childCount: 0,
10032
10036
  className: mergeClassNames(Diagnostic, extraClassName),
10033
- width,
10034
10037
  height,
10035
- top: y,
10036
10038
  left: x,
10037
- childCount: 0
10039
+ top: y,
10040
+ type: Div,
10041
+ width
10038
10042
  }];
10039
10043
  };
10040
10044
 
@@ -10045,9 +10049,9 @@ const getDiagnosticsVirtualDom = diagnostics => {
10045
10049
 
10046
10050
  const getGutterInfoVirtualDom = gutterInfo => {
10047
10051
  return [{
10048
- type: Span,
10052
+ childCount: 1,
10049
10053
  className: 'LineNumber',
10050
- childCount: 1
10054
+ type: Span
10051
10055
  }, text(gutterInfo)];
10052
10056
  };
10053
10057
  const getEditorGutterVirtualDom = gutterInfos => {
@@ -10065,18 +10069,18 @@ const getEditorRowsVirtualDom = (textInfos, differences, lineNumbers = true, hig
10065
10069
  className += ' ' + EditorRowHighlighted;
10066
10070
  }
10067
10071
  dom.push({
10068
- type: Div,
10072
+ childCount: textInfo.length / 2,
10069
10073
  className,
10070
10074
  translate: px(difference),
10071
- childCount: textInfo.length / 2
10075
+ type: Div
10072
10076
  });
10073
10077
  for (let j = 0; j < textInfo.length; j += 2) {
10074
10078
  const tokenText = textInfo[j];
10075
10079
  const className = textInfo[j + 1];
10076
10080
  dom.push({
10077
- type: Span,
10081
+ childCount: 1,
10078
10082
  className,
10079
- childCount: 1
10083
+ type: Span
10080
10084
  }, text(tokenText));
10081
10085
  }
10082
10086
  }
@@ -10091,12 +10095,12 @@ const getSelectionsVirtualDom = selections => {
10091
10095
  const width = selections[i + 2];
10092
10096
  const height = selections[i + 3];
10093
10097
  dom.push({
10094
- type: Div,
10095
10098
  className: EditorSelection,
10099
+ height,
10096
10100
  left: x,
10097
10101
  top: y,
10098
- width,
10099
- height
10102
+ type: Div,
10103
+ width
10100
10104
  });
10101
10105
  }
10102
10106
  return dom;
@@ -10125,9 +10129,6 @@ const removeWidget = widget => {
10125
10129
  };
10126
10130
 
10127
10131
  const renderLines = {
10128
- isEqual(oldState, newState) {
10129
- return oldState.lines === newState.lines && oldState.tokenizerId === newState.tokenizerId && oldState.minLineY === newState.minLineY && oldState.decorations === newState.decorations && oldState.embeds === newState.embeds && oldState.deltaX === newState.deltaX && oldState.width === newState.width && oldState.highlightedLine === newState.highlightedLine && oldState.debugEnabled === newState.debugEnabled;
10130
- },
10131
10132
  apply(oldState, newState) {
10132
10133
  const {
10133
10134
  incrementalEdits
@@ -10136,8 +10137,8 @@ const renderLines = {
10136
10137
  return [/* method */'setIncrementalEdits', /* incrementalEdits */incrementalEdits];
10137
10138
  }
10138
10139
  const {
10139
- textInfos,
10140
- differences
10140
+ differences,
10141
+ textInfos
10141
10142
  } = newState;
10142
10143
  newState.differences = differences;
10143
10144
  const {
@@ -10147,12 +10148,12 @@ const renderLines = {
10147
10148
  const relativeLine = highlightedLine - minLineY;
10148
10149
  const dom = getEditorRowsVirtualDom(textInfos, differences, true, relativeLine);
10149
10150
  return [/* method */'setText', dom];
10151
+ },
10152
+ isEqual(oldState, newState) {
10153
+ return oldState.lines === newState.lines && oldState.tokenizerId === newState.tokenizerId && oldState.minLineY === newState.minLineY && oldState.decorations === newState.decorations && oldState.embeds === newState.embeds && oldState.deltaX === newState.deltaX && oldState.width === newState.width && oldState.highlightedLine === newState.highlightedLine && oldState.debugEnabled === newState.debugEnabled;
10150
10154
  }
10151
10155
  };
10152
10156
  const renderSelections = {
10153
- isEqual(oldState, newState) {
10154
- return oldState.selections === newState.selections && oldState.focused === newState.focused && oldState.minLineY === newState.minLineY && oldState.deltaX === newState.deltaX;
10155
- },
10156
10157
  apply: async (oldState, newState) => {
10157
10158
  const {
10158
10159
  cursorInfos,
@@ -10161,74 +10162,74 @@ const renderSelections = {
10161
10162
  const cursorsDom = getCursorsVirtualDom(cursorInfos);
10162
10163
  const selectionsDom = getSelectionsVirtualDom(selectionInfos);
10163
10164
  return [/* method */'setSelections', cursorsDom, selectionsDom];
10165
+ },
10166
+ isEqual(oldState, newState) {
10167
+ return oldState.selections === newState.selections && oldState.focused === newState.focused && oldState.minLineY === newState.minLineY && oldState.deltaX === newState.deltaX;
10164
10168
  }
10165
10169
  };
10166
10170
  const renderScrollBarY = {
10167
- isEqual(oldState, newState) {
10168
- return oldState.deltaY === newState.deltaY && oldState.scrollBarHeight === newState.scrollBarHeight;
10169
- },
10170
10171
  apply(oldState, newState) {
10171
10172
  const scrollBarY = getScrollBarY(newState.deltaY, newState.finalDeltaY, newState.height, newState.scrollBarHeight);
10172
10173
  const translate = `0 ${scrollBarY}px`;
10173
10174
  const heightPx = `${newState.scrollBarHeight}px`;
10174
10175
  return [/* method */'setScrollBar', translate, heightPx];
10176
+ },
10177
+ isEqual(oldState, newState) {
10178
+ return oldState.deltaY === newState.deltaY && oldState.scrollBarHeight === newState.scrollBarHeight;
10175
10179
  }
10176
10180
  };
10177
10181
  const renderScrollBarX = {
10178
- isEqual(oldState, newState) {
10179
- return oldState.longestLineWidth === newState.longestLineWidth && oldState.deltaX === newState.deltaX;
10180
- },
10181
10182
  apply(oldState, newState) {
10182
10183
  const scrollBarWidth = getScrollBarSize(newState.width, newState.longestLineWidth, newState.minimumSliderSize);
10183
10184
  const scrollBarX = newState.deltaX / newState.longestLineWidth * newState.width;
10184
10185
  return [/* method */'setScrollBarHorizontal', /* scrollBarX */scrollBarX, /* scrollBarWidth */scrollBarWidth, /* deltaX */newState.deltaX];
10186
+ },
10187
+ isEqual(oldState, newState) {
10188
+ return oldState.longestLineWidth === newState.longestLineWidth && oldState.deltaX === newState.deltaX;
10185
10189
  }
10186
10190
  };
10187
10191
  const renderFocus$1 = {
10188
- isEqual(oldState, newState) {
10189
- return oldState.focused === newState.focused;
10190
- },
10191
10192
  apply(oldState, newState) {
10192
10193
  return [/* method */'setFocused', newState.focused];
10194
+ },
10195
+ isEqual(oldState, newState) {
10196
+ return oldState.focused === newState.focused;
10193
10197
  }
10194
10198
  };
10195
10199
  const renderFocusContext = {
10196
- isEqual(oldState, newState) {
10197
- return oldState.focus === newState.focus;
10198
- },
10199
10200
  apply(oldState, newState) {
10200
10201
  return ['Viewlet.setFocusContext', newState.uid, newState.focus];
10202
+ },
10203
+ isEqual(oldState, newState) {
10204
+ return oldState.focus === newState.focus;
10201
10205
  }
10202
10206
  };
10203
10207
  const renderAdditionalFocusContext = {
10204
- isEqual(oldState, newState) {
10205
- return oldState.additionalFocus === newState.additionalFocus;
10206
- },
10207
10208
  apply(oldState, newState) {
10208
10209
  if (newState.additionalFocus) {
10209
10210
  return ['Viewlet.setAdditionalFocus', newState.uid, newState.additionalFocus];
10210
10211
  }
10211
10212
  return ['viewlet.unsetAdditionalFocus', newState.uid, newState.additionalFocus];
10213
+ },
10214
+ isEqual(oldState, newState) {
10215
+ return oldState.additionalFocus === newState.additionalFocus;
10212
10216
  }
10213
10217
  };
10214
10218
  const renderDecorations = {
10215
- isEqual(oldState, newState) {
10216
- return oldState.decorations === newState.decorations;
10217
- },
10218
10219
  apply(oldState, newState) {
10219
10220
  const dom = getDiagnosticsVirtualDom(newState.decorations);
10220
10221
  return ['setDecorationsDom', dom];
10222
+ },
10223
+ isEqual(oldState, newState) {
10224
+ return oldState.decorations === newState.decorations;
10221
10225
  }
10222
10226
  };
10223
10227
  const renderGutterInfo = {
10224
- isEqual(oldState, newState) {
10225
- return oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY;
10226
- },
10227
10228
  apply(oldState, newState) {
10228
10229
  const {
10229
- minLineY,
10230
+ lineNumbers,
10230
10231
  maxLineY,
10231
- lineNumbers
10232
+ minLineY
10232
10233
  } = newState;
10233
10234
  const gutterInfos = [];
10234
10235
  if (lineNumbers) {
@@ -10238,12 +10239,12 @@ const renderGutterInfo = {
10238
10239
  }
10239
10240
  const dom = getEditorGutterVirtualDom(gutterInfos);
10240
10241
  return ['renderGutter', dom];
10242
+ },
10243
+ isEqual(oldState, newState) {
10244
+ return oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY;
10241
10245
  }
10242
10246
  };
10243
10247
  const renderWidgets = {
10244
- isEqual(oldState, newState) {
10245
- return oldState.widgets === newState.widgets;
10246
- },
10247
10248
  apply(oldState, newState) {
10248
10249
  const addedWidgets = [];
10249
10250
  const changedWidgets = [];
@@ -10295,6 +10296,9 @@ const renderWidgets = {
10295
10296
  const filteredCommands = allCommands.filter(item => item[0] !== 'Viewlet.setFocusContext');
10296
10297
  return filteredCommands;
10297
10298
  },
10299
+ isEqual(oldState, newState) {
10300
+ return oldState.widgets === newState.widgets;
10301
+ },
10298
10302
  multiple: true
10299
10303
  };
10300
10304
  const render$6 = [renderLines, renderSelections, renderScrollBarX, renderScrollBarY, renderFocus$1, renderDecorations, renderGutterInfo, renderWidgets, renderFocusContext, renderAdditionalFocusContext];
@@ -10304,8 +10308,8 @@ const renderEditor = async id => {
10304
10308
  return [];
10305
10309
  }
10306
10310
  const {
10307
- oldState,
10308
- newState
10311
+ newState,
10312
+ oldState
10309
10313
  } = instance;
10310
10314
  const commands = [];
10311
10315
  set$6(id, newState, newState);
@@ -10386,8 +10390,8 @@ const updateDebugInfo = async debugId => {
10386
10390
  return;
10387
10391
  }
10388
10392
  const {
10389
- oldState,
10390
- newState
10393
+ newState,
10394
+ oldState
10391
10395
  } = instance;
10392
10396
  const newEditor = {
10393
10397
  ...newState,
@@ -10460,11 +10464,11 @@ const wrapCommands = commands => {
10460
10464
 
10461
10465
  const commandMap = {
10462
10466
  'ActivateByEvent.activateByEvent': activateByEvent,
10463
- 'ExtensionHostManagement.activateByEvent': activateByEvent,
10464
10467
  'CodeGenerator.accept': codeGeneratorAccept,
10465
10468
  'ColorPicker.loadContent': loadContent$2,
10466
10469
  'Editor.addCursorAbove': addCursorAbove,
10467
10470
  'Editor.addCursorBelow': addCursorBelow,
10471
+ 'Editor.applyDocumentEdits': applyDocumentEdits,
10468
10472
  'Editor.applyEdit': applyEdit,
10469
10473
  'Editor.applyEdit2': applyEdits2,
10470
10474
  'Editor.applyWorkspaceEdit': applyWorkspaceEdit,
@@ -10479,13 +10483,10 @@ const commandMap = {
10479
10483
  'Editor.compositionEnd': compositionEnd,
10480
10484
  'Editor.compositionStart': compositionStart,
10481
10485
  'Editor.compositionUpdate': compositionUpdate,
10482
- 'Editor.handleClickAtPosition': handleClickAtPosition,
10483
- 'Editor.applyDocumentEdits': applyDocumentEdits,
10484
10486
  'Editor.contextMenu': handleContextMenu,
10485
10487
  'Editor.copy': copy$1,
10486
10488
  'Editor.copyLineDown': copyLineDown,
10487
10489
  'Editor.copyLineUp': copyLineUp,
10488
- 'Editor.getMenuIds': getMenuIds,
10489
10490
  'Editor.create': createEditor,
10490
10491
  'Editor.cursorCharacterLeft': cursorCharacterLeft,
10491
10492
  'Editor.cursorCharacterRight': cursorCharacterRight,
@@ -10515,20 +10516,21 @@ const commandMap = {
10515
10516
  'Editor.executeWidgetCommand': executeWidgetCommand,
10516
10517
  'Editor.findAllReferences': findAllReferences$1,
10517
10518
  'Editor.format': format,
10519
+ 'Editor.getDiagnostics': getDiagnostics$1,
10518
10520
  'Editor.getKeyBindings': getKeyBindings,
10519
10521
  'Editor.getKeys': getKeys,
10520
10522
  'Editor.getLanguageId': getLanguageId,
10521
10523
  'Editor.getLines2': getLines2,
10522
10524
  'Editor.getMenuEntries': getMenuEntries,
10523
10525
  'Editor.getMenuEntries2': getMenuEntries,
10526
+ 'Editor.getMenuIds': getMenuIds,
10524
10527
  'Editor.getOffsetAtCursor': getOffsetAtCursor,
10525
10528
  'Editor.getPositionAtCursor': getPositionAtCursor,
10526
- 'Editor.getSourceActions': getSourceActions,
10527
10529
  'Editor.getProblems': getProblems,
10528
10530
  'Editor.getQuickPickMenuEntries': getQuickPickMenuEntries,
10529
10531
  'Editor.getSelections': getSelections,
10530
10532
  'Editor.getSelections2': getSelections2,
10531
- 'Editor.getDiagnostics': getDiagnostics$1,
10533
+ 'Editor.getSourceActions': getSourceActions,
10532
10534
  'Editor.getText': getText,
10533
10535
  'Editor.getUri': getUri,
10534
10536
  'Editor.getWordAt': getWordAt$1,
@@ -10541,6 +10543,7 @@ const commandMap = {
10541
10543
  'Editor.handleBeforeInput': handleBeforeInput,
10542
10544
  'Editor.handleBeforeInputFromContentEditable': handleBeforeInputFromContentEditable,
10543
10545
  'Editor.handleBlur': handleBlur$1,
10546
+ 'Editor.handleClickAtPosition': handleClickAtPosition,
10544
10547
  'Editor.handleContextMenu': handleContextMenu,
10545
10548
  'Editor.handleDoubleClick': handleDoubleClick,
10546
10549
  'Editor.handleFocus': handleFocus$1,
@@ -10563,6 +10566,7 @@ const commandMap = {
10563
10566
  'Editor.handleTouchMove': handleTouchMove,
10564
10567
  'Editor.handleTouchStart': handleTouchStart,
10565
10568
  'Editor.handleTripleClick': handleTripleClick,
10569
+ 'Editor.hotReload': hotReload,
10566
10570
  'Editor.indendLess': indentLess,
10567
10571
  'Editor.indentMore': indentMore,
10568
10572
  'Editor.insertLineBreak': insertLineBreak,
@@ -10621,7 +10625,6 @@ const commandMap = {
10621
10625
  'Editor.toggleComment': toggleComment,
10622
10626
  'Editor.toggleLineComment': editorToggleLineComment,
10623
10627
  'Editor.type': type,
10624
- 'Editor.hotReload': hotReload,
10625
10628
  'Editor.typeWithAutoClosing': typeWithAutoClosing,
10626
10629
  'Editor.undo': undo,
10627
10630
  'Editor.unIndent': editorUnindent,
@@ -10637,12 +10640,15 @@ const commandMap = {
10637
10640
  'EditorCompletion.handleEditorClick': handleEditorClick,
10638
10641
  'EditorCompletion.handleEditorDeleteLeft': handleEditorDeleteLeft$1,
10639
10642
  'EditorCompletion.handleEditorType': handleEditorType$1,
10643
+ 'EditorCompletion.handlePointerDown': handlePointerDown,
10640
10644
  'EditorCompletion.handleWheel': handleWheel$1,
10641
10645
  'EditorCompletion.openDetails': openDetails,
10642
10646
  'EditorCompletion.selectCurrent': selectCurrent$1,
10643
10647
  'EditorCompletion.selectIndex': selectIndex$1,
10644
10648
  'EditorCompletion.toggleDetails': toggleDetails$1,
10645
- 'EditorCompletion.handlePointerDown': handlePointerDown,
10649
+ 'EditorRename.accept': accept,
10650
+ 'EditorRename.close': close$2,
10651
+ 'EditorRename.handleInput': handleInput,
10646
10652
  'EditorSourceAction.close': close$1,
10647
10653
  'EditorSourceAction.closeDetails': closeDetails,
10648
10654
  'EditorSourceAction.focusFirst': focusFirst,
@@ -10654,38 +10660,36 @@ const commandMap = {
10654
10660
  'EditorSourceAction.selectIndex': selectIndex,
10655
10661
  'EditorSourceAction.selectItem': selectItem,
10656
10662
  'EditorSourceAction.toggleDetails': toggleDetails,
10657
- 'EditorRename.accept': accept,
10658
- 'EditorRename.close': close$2,
10659
- 'EditorRename.handleInput': handleInput,
10660
10663
  'EditorSourceActions.focusNext': focusNext$1,
10664
+ 'ExtensionHostManagement.activateByEvent': activateByEvent,
10661
10665
  'FindWidget.close': close$3,
10662
10666
  'FindWidget.focusCloseButton': focusCloseButton,
10663
10667
  'FindWidget.focusFind': focusFind,
10664
10668
  'FindWidget.focusNext': focusNext$2,
10669
+ 'FindWidget.focusNextElement': focusNextElement,
10665
10670
  'FindWidget.focusNextMatchButton': focusNextMatchButton,
10666
10671
  'FindWidget.focusPrevious': focusPrevious$1,
10672
+ 'FindWidget.focusPreviousElement': focusPreviousElement,
10667
10673
  'FindWidget.focusPreviousMatchButton': focusPreviousMatchButton,
10668
10674
  'FindWidget.focusReplace': focusReplace,
10669
10675
  'FindWidget.focusReplaceAllButton': focusReplaceAllButton,
10670
10676
  'FindWidget.focusReplaceButton': focusReplaceButton,
10671
10677
  'FindWidget.focusToggleReplace': focusToggleReplace,
10672
- 'FindWidget.replace': replace,
10673
- 'FindWidget.replaceAll': replaceAll,
10674
10678
  'FindWidget.handleBlur': handleBlur,
10675
- 'FindWidget.handleFocus': handleFocus,
10676
10679
  'FindWidget.handleClickButton': handleClickButton,
10680
+ 'FindWidget.handleFocus': handleFocus,
10677
10681
  'FindWidget.handleInput': handleInput$1,
10678
10682
  'FindWidget.handleReplaceFocus': handleReplaceFocus,
10679
10683
  'FindWidget.handleReplaceInput': handleReplaceInput,
10680
10684
  'FindWidget.handleToggleReplaceFocus': handleToggleReplaceFocus,
10685
+ 'FindWidget.loadContent': loadContent$1,
10686
+ 'FindWidget.replace': replace,
10687
+ 'FindWidget.replaceAll': replaceAll,
10681
10688
  'FindWidget.toggleMatchCase': toggleMatchCase,
10682
10689
  'FindWidget.toggleMatchWholeWord': toggleMatchWholeWord,
10683
- 'FindWidget.loadContent': loadContent$1,
10690
+ 'FindWidget.togglePreserveCase': togglePreserveCase,
10684
10691
  'FindWidget.toggleReplace': toggleReplace,
10685
10692
  'FindWidget.toggleUseRegularExpression': toggleUseRegularExpression,
10686
- 'FindWidget.focusNextElement': focusNextElement,
10687
- 'FindWidget.focusPreviousElement': focusPreviousElement,
10688
- 'FindWidget.togglePreserveCase': togglePreserveCase,
10689
10693
  'Font.ensure': ensure,
10690
10694
  'HandleMessagePort.handleMessagePort': handleMessagePort,
10691
10695
  'Hover.getHoverInfo': getEditorHoverInfo,
@@ -10729,51 +10733,51 @@ const getCodeGeneratorVirtualDom = state => {
10729
10733
  const escapeToClose$1 = escapeToClose();
10730
10734
  const enterCode$1 = enterCode();
10731
10735
  return [{
10732
- type: Div,
10736
+ childCount: 2,
10733
10737
  className: mergeClassNames(Viewlet, CodeGeneratorWidget),
10734
- childCount: 2
10738
+ type: Div
10735
10739
  }, {
10736
- type: Input,
10737
- className: mergeClassNames(CodeGeneratorInput$1, InputBox),
10738
10740
  childCount: 0,
10741
+ className: mergeClassNames(CodeGeneratorInput$1, InputBox),
10742
+ name: CodeGeneratorInput,
10739
10743
  placeholder: enterCode$1,
10740
- name: CodeGeneratorInput
10744
+ type: Input
10741
10745
  }, {
10742
- type: Div,
10746
+ childCount: 1,
10743
10747
  className: CodeGeneratorMessage,
10744
- childCount: 1
10748
+ type: Div
10745
10749
  }, text(escapeToClose$1)];
10746
10750
  };
10747
10751
 
10748
10752
  const renderContent$1 = {
10749
- isEqual(oldState, newState) {
10750
- return oldState.questions === newState.questions;
10751
- },
10752
10753
  apply(oldState, newState) {
10753
10754
  const dom = getCodeGeneratorVirtualDom();
10754
10755
  return [SetDom2, newState.uid, dom];
10756
+ },
10757
+ isEqual(oldState, newState) {
10758
+ return oldState.questions === newState.questions;
10755
10759
  }
10756
10760
  };
10757
10761
  const renderBounds$1 = {
10758
- isEqual(oldState, newState) {
10759
- return oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height;
10760
- },
10761
10762
  apply(oldState, newState) {
10762
10763
  const {
10763
- x,
10764
- y,
10764
+ height,
10765
10765
  width,
10766
- height
10766
+ x,
10767
+ y
10767
10768
  } = newState;
10768
10769
  return [/* method */SetBounds, /* x */x, /* y */y, /* width */width, /* height */height];
10770
+ },
10771
+ isEqual(oldState, newState) {
10772
+ return oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height;
10769
10773
  }
10770
10774
  };
10771
10775
  const renderFocus = {
10772
- isEqual(oldState, newState) {
10773
- return oldState.focused === newState.focused && oldState.focusSource === newState.focusSource;
10774
- },
10775
10776
  apply(oldState, newState) {
10776
10777
  return [Focus, '.CodeGeneratorInput', newState.focusSource];
10778
+ },
10779
+ isEqual(oldState, newState) {
10780
+ return oldState.focused === newState.focused && oldState.focusSource === newState.focusSource;
10777
10781
  }
10778
10782
  };
10779
10783
  const render$5 = [renderContent$1, renderBounds$1, renderFocus];
@@ -10853,22 +10857,22 @@ const EditorColorPickerWidget = {
10853
10857
 
10854
10858
  const getCompletionDetailVirtualDom = content => {
10855
10859
  const dom = [{
10856
- type: Div,
10860
+ childCount: 2,
10857
10861
  className: 'Viewlet EditorCompletionDetails',
10858
- childCount: 2
10862
+ type: Div
10859
10863
  }, {
10860
- type: Div,
10864
+ childCount: 1,
10861
10865
  className: CompletionDetailContent,
10862
- childCount: 1
10866
+ type: Div
10863
10867
  }, text(content), {
10864
- type: Div,
10868
+ childCount: 1,
10865
10869
  className: CompletionDetailCloseButton,
10866
10870
  onClick: HandleClose,
10867
- childCount: 1
10871
+ type: Div
10868
10872
  }, {
10869
- type: Div,
10873
+ childCount: 0,
10870
10874
  className: `${MaskIcon} ${IconClose}`,
10871
- childCount: 0
10875
+ type: Div
10872
10876
  }];
10873
10877
  return dom;
10874
10878
  };
@@ -10884,26 +10888,26 @@ const renderParts = (render, oldState, newState) => {
10884
10888
  };
10885
10889
 
10886
10890
  const renderContent = {
10887
- isEqual(oldState, newState) {
10888
- return oldState.content === newState.content;
10889
- },
10890
10891
  apply(oldState, newState) {
10891
10892
  const dom = getCompletionDetailVirtualDom(newState.content);
10892
10893
  return [SetDom2, newState.uid, dom];
10894
+ },
10895
+ isEqual(oldState, newState) {
10896
+ return oldState.content === newState.content;
10893
10897
  }
10894
10898
  };
10895
10899
  const renderBounds = {
10896
- isEqual(oldState, newState) {
10897
- return oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height;
10898
- },
10899
10900
  apply(oldState, newState) {
10900
10901
  const {
10901
- x,
10902
- y,
10902
+ height,
10903
10903
  width,
10904
- height
10904
+ x,
10905
+ y
10905
10906
  } = newState;
10906
10907
  return [/* method */SetBounds, /* x */x, /* y */y, /* width */width, /* height */height];
10908
+ },
10909
+ isEqual(oldState, newState) {
10910
+ return oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height;
10907
10911
  }
10908
10912
  };
10909
10913
  const render$2 = [renderContent, renderBounds];