@lvce-editor/editor-worker 14.0.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.
- package/dist/editorWorkerMain.js +1006 -1005
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -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
|
-
|
|
1315
|
+
url
|
|
1316
1316
|
});
|
|
1317
1317
|
const rpc = await MessagePortRpcParent.create({
|
|
1318
1318
|
commandMap: {},
|
|
1319
|
-
|
|
1320
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1437
|
-
|
|
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
|
-
|
|
1587
|
-
|
|
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
|
-
|
|
1615
|
-
|
|
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
|
-
|
|
1639
|
-
|
|
1638
|
+
invoke: invoke$8,
|
|
1639
|
+
set: set$5
|
|
1640
|
+
} = SyntaxHighlightingWorker;
|
|
1640
1641
|
|
|
1641
1642
|
const state$6 = {
|
|
1642
|
-
|
|
1643
|
-
|
|
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
|
-
|
|
1725
|
-
|
|
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
|
-
|
|
1764
|
-
|
|
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
|
-
|
|
1780
|
+
tokenizerId
|
|
1779
1781
|
} = editor;
|
|
1780
1782
|
const tokenizer = get$2(tokenizerId);
|
|
1781
1783
|
const {
|
|
1782
1784
|
hasArrayReturn,
|
|
1783
|
-
|
|
1784
|
-
|
|
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
|
-
|
|
1806
|
-
|
|
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
|
-
|
|
1813
|
+
embeddedResults,
|
|
1812
1814
|
tokenizersToLoad,
|
|
1813
|
-
|
|
1815
|
+
tokens: visibleLines
|
|
1814
1816
|
};
|
|
1815
1817
|
}
|
|
1816
1818
|
editor.invalidStartIndex = Math.max(invalidStartIndex, tokenizeEndIndex);
|
|
1817
1819
|
return {
|
|
1818
|
-
|
|
1820
|
+
embeddedResults,
|
|
1819
1821
|
tokenizersToLoad,
|
|
1820
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1846
|
-
|
|
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
|
-
|
|
2064
|
-
|
|
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
|
-
|
|
2133
|
+
end,
|
|
2132
2134
|
start,
|
|
2133
|
-
|
|
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
|
-
|
|
2151
|
-
|
|
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
|
-
|
|
2160
|
-
|
|
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
|
-
|
|
2167
|
-
|
|
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
|
-
|
|
2190
|
+
end,
|
|
2189
2191
|
start,
|
|
2190
|
-
|
|
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
|
-
|
|
2224
|
-
|
|
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
|
-
|
|
2230
|
-
|
|
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
|
-
|
|
2258
|
-
|
|
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
|
-
|
|
2266
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2288
|
+
embeddedResults,
|
|
2287
2289
|
tokenizersToLoad,
|
|
2288
|
-
|
|
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
|
-
|
|
2294
|
-
|
|
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
|
-
|
|
2301
|
-
|
|
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
|
-
|
|
2331
|
-
|
|
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
|
-
|
|
2338
|
-
|
|
2339
|
+
handleOffset: halfScrollBarHeight,
|
|
2340
|
+
percent: (relativeY - halfScrollBarHeight) / (height - scrollBarHeight)
|
|
2339
2341
|
};
|
|
2340
2342
|
}
|
|
2341
2343
|
// clicked at bottom
|
|
2342
2344
|
return {
|
|
2343
|
-
|
|
2344
|
-
|
|
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
|
-
|
|
2364
|
+
finalDeltaY,
|
|
2364
2365
|
height,
|
|
2365
|
-
|
|
2366
|
-
|
|
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
|
-
|
|
2385
|
-
|
|
2386
|
+
differences,
|
|
2387
|
+
textInfos
|
|
2386
2388
|
} = await getVisible$1(newEditor1, syncIncremental);
|
|
2387
2389
|
const newEditor2 = {
|
|
2388
2390
|
...newEditor1,
|
|
2389
|
-
|
|
2390
|
-
|
|
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
|
-
|
|
2582
|
-
|
|
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
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2720
|
-
|
|
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
|
-
|
|
2728
|
-
|
|
2729
|
+
columnIndex: inserted.at(-1).length + startColumnIndex,
|
|
2730
|
+
rowIndex: startRowIndex + insertedLength - 1
|
|
2729
2731
|
};
|
|
2730
2732
|
return {
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
+
end: newPosition,
|
|
2734
|
+
start: newPosition
|
|
2733
2735
|
};
|
|
2734
2736
|
}
|
|
2735
2737
|
const newPosition = {
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
+
columnIndex: startColumnIndex,
|
|
2739
|
+
rowIndex: startRowIndex + insertedLength - 1
|
|
2738
2740
|
};
|
|
2739
2741
|
return {
|
|
2740
|
-
|
|
2741
|
-
|
|
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
|
-
|
|
2859
|
-
|
|
2860
|
+
differences,
|
|
2861
|
+
textInfos
|
|
2860
2862
|
} = await getVisible$1(newEditor2, syncIncremental);
|
|
2861
2863
|
return {
|
|
2862
2864
|
...newEditor2,
|
|
2863
|
-
|
|
2864
|
-
|
|
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
|
-
|
|
2901
|
-
|
|
2902
|
+
differences,
|
|
2903
|
+
textInfos
|
|
2902
2904
|
} = await getVisible$1(finalEditor, syncIncremental);
|
|
2903
2905
|
return {
|
|
2904
2906
|
...finalEditor,
|
|
2905
|
-
|
|
2906
|
-
|
|
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
|
-
|
|
2930
|
+
invalidStartIndex,
|
|
2929
2931
|
lines: newLines,
|
|
2930
|
-
|
|
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
|
-
|
|
2945
|
-
|
|
2946
|
+
differences,
|
|
2947
|
+
textInfos
|
|
2946
2948
|
} = await getVisible$1(finalEditor, syncIncremental);
|
|
2947
2949
|
return {
|
|
2948
2950
|
...finalEditor,
|
|
2949
|
-
|
|
2950
|
-
|
|
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
|
-
|
|
2984
|
-
maxLineY,
|
|
2981
|
+
finalDeltaY,
|
|
2985
2982
|
finalY,
|
|
2986
|
-
|
|
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
|
-
|
|
2994
|
-
|
|
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
|
-
|
|
3015
|
+
debugEnabled: false,
|
|
3016
|
+
decorations: [],
|
|
3017
|
+
deltaX: 0,
|
|
3018
|
+
deltaY: 0,
|
|
3019
|
+
diagnostics: [],
|
|
3014
3020
|
differences: [],
|
|
3015
|
-
|
|
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
|
-
|
|
3034
|
-
|
|
3032
|
+
minLineY: 0,
|
|
3033
|
+
scrollBarHeight: 0,
|
|
3035
3034
|
selections: new Uint32Array(),
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
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
|
-
|
|
3048
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3218
|
-
|
|
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
|
-
|
|
3238
|
+
columnToReveal,
|
|
3239
|
+
completionTriggerCharacters,
|
|
3236
3240
|
content,
|
|
3237
|
-
|
|
3238
|
-
|
|
3241
|
+
diagnosticsEnabled,
|
|
3242
|
+
fontFamily,
|
|
3239
3243
|
fontSize,
|
|
3240
|
-
|
|
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
|
-
|
|
3254
|
-
|
|
3255
|
-
width,
|
|
3256
|
-
height,
|
|
3257
|
-
fontWeight,
|
|
3258
|
-
fontFamily,
|
|
3259
|
-
isMonospaceFont,
|
|
3260
|
-
uri,
|
|
3261
|
-
diagnosticsEnabled,
|
|
3255
|
+
letterSpacing,
|
|
3256
|
+
lineNumbers,
|
|
3262
3257
|
lineToReveal,
|
|
3263
|
-
|
|
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
|
-
|
|
3346
|
-
|
|
3348
|
+
differences,
|
|
3349
|
+
textInfos
|
|
3347
3350
|
} = await getVisible$1(newEditor3, syncIncremental);
|
|
3348
3351
|
const newEditor4 = {
|
|
3349
3352
|
...newEditor3,
|
|
3350
|
-
|
|
3353
|
+
differences,
|
|
3351
3354
|
focus: FocusEditorText$1,
|
|
3352
|
-
|
|
3353
|
-
|
|
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
|
-
|
|
3422
|
-
|
|
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
|
-
|
|
3438
|
-
|
|
3440
|
+
end,
|
|
3441
|
+
start
|
|
3439
3442
|
});
|
|
3440
3443
|
const documentEdit = {
|
|
3441
|
-
|
|
3444
|
+
deleted,
|
|
3442
3445
|
end,
|
|
3443
3446
|
inserted: splitLines(edit.inserted),
|
|
3444
|
-
|
|
3445
|
-
|
|
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
|
-
|
|
3491
|
-
|
|
3493
|
+
end: endPosition,
|
|
3494
|
+
start: startPosition
|
|
3492
3495
|
});
|
|
3493
3496
|
const textChange = {
|
|
3494
|
-
|
|
3497
|
+
deleted,
|
|
3495
3498
|
end: endPosition,
|
|
3496
3499
|
inserted: [edit.inserted],
|
|
3497
|
-
|
|
3498
|
-
|
|
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
|
-
|
|
3540
|
-
|
|
3542
|
+
columnIndex: selectionStartColumn,
|
|
3543
|
+
rowIndex: selectionStartRow
|
|
3541
3544
|
};
|
|
3542
3545
|
const end = {
|
|
3543
|
-
|
|
3544
|
-
|
|
3546
|
+
columnIndex: selectionEndColumn,
|
|
3547
|
+
rowIndex: selectionEndRow
|
|
3545
3548
|
};
|
|
3546
3549
|
const selection = {
|
|
3547
|
-
|
|
3548
|
-
|
|
3550
|
+
end,
|
|
3551
|
+
start
|
|
3549
3552
|
};
|
|
3550
3553
|
changes.push({
|
|
3551
|
-
|
|
3554
|
+
deleted: getSelectionText(editor, selection),
|
|
3552
3555
|
end: end,
|
|
3553
3556
|
inserted: replacement,
|
|
3554
|
-
|
|
3555
|
-
|
|
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
|
-
|
|
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 (
|
|
3594
|
-
return
|
|
3599
|
+
if (currentVisualIndex >= visualIndex) {
|
|
3600
|
+
return segment.index;
|
|
3595
3601
|
}
|
|
3596
3602
|
currentVisualIndex++;
|
|
3597
3603
|
}
|
|
3598
|
-
return
|
|
3604
|
+
return line.length;
|
|
3599
3605
|
},
|
|
3600
|
-
|
|
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 (
|
|
3605
|
-
return
|
|
3610
|
+
if (segment.index >= index) {
|
|
3611
|
+
return currentVisualIndex;
|
|
3606
3612
|
}
|
|
3607
3613
|
currentVisualIndex++;
|
|
3608
3614
|
}
|
|
3609
|
-
return
|
|
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
|
-
|
|
3679
|
+
charWidth,
|
|
3677
3680
|
deltaY,
|
|
3678
|
-
|
|
3681
|
+
fontFamily,
|
|
3679
3682
|
fontSize,
|
|
3680
3683
|
fontWeight,
|
|
3681
|
-
|
|
3684
|
+
isMonospaceFont,
|
|
3682
3685
|
letterSpacing,
|
|
3683
3686
|
lines,
|
|
3687
|
+
rowHeight,
|
|
3684
3688
|
tabSize,
|
|
3685
|
-
|
|
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
|
-
|
|
3692
|
-
|
|
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
|
-
|
|
3700
|
-
|
|
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
|
-
|
|
3869
|
-
|
|
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
|
-
|
|
3888
|
-
|
|
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
|
-
|
|
3919
|
-
|
|
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
|
-
|
|
3983
|
-
focused: newFocus,
|
|
3985
|
+
additionalFocus: fullFocus ? 0 : focusKey,
|
|
3984
3986
|
focus: fullFocus ? focusKey : FocusEditorText$1,
|
|
3985
|
-
|
|
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
|
-
|
|
4001
|
+
newState: {
|
|
4002
|
+
commands: [],
|
|
4003
|
+
height: 0,
|
|
3999
4004
|
uid: completionUid,
|
|
4000
|
-
x: 0,
|
|
4001
|
-
y: 0,
|
|
4002
4005
|
width: 0,
|
|
4003
|
-
|
|
4004
|
-
|
|
4006
|
+
x: 0,
|
|
4007
|
+
y: 0
|
|
4005
4008
|
},
|
|
4006
|
-
|
|
4009
|
+
oldState: {
|
|
4010
|
+
commands: [],
|
|
4011
|
+
height: 0,
|
|
4007
4012
|
uid: completionUid,
|
|
4008
|
-
x: 0,
|
|
4009
|
-
y: 0,
|
|
4010
4013
|
width: 0,
|
|
4011
|
-
|
|
4012
|
-
|
|
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
|
-
|
|
4027
|
-
|
|
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
|
-
|
|
4043
|
-
rowIndex: selectionStartRow,
|
|
4044
|
-
columnIndex: startColumnIndex
|
|
4045
|
-
},
|
|
4045
|
+
deleted: [state$4.compositionText],
|
|
4046
4046
|
end: {
|
|
4047
|
-
|
|
4048
|
-
|
|
4047
|
+
columnIndex: selectionEndColumn,
|
|
4048
|
+
rowIndex: selectionEndRow
|
|
4049
4049
|
},
|
|
4050
4050
|
inserted: [data],
|
|
4051
|
-
|
|
4052
|
-
|
|
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
|
-
|
|
4095
|
-
|
|
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
|
-
|
|
4106
|
-
|
|
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
|
-
|
|
4150
|
-
|
|
4152
|
+
columnIndex: 0,
|
|
4153
|
+
rowIndex
|
|
4151
4154
|
};
|
|
4152
4155
|
const changes = [{
|
|
4153
|
-
|
|
4156
|
+
deleted: [''],
|
|
4154
4157
|
end: position,
|
|
4155
4158
|
inserted: [getLine(editor, rowIndex), ''],
|
|
4156
|
-
|
|
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
|
-
|
|
4168
|
-
|
|
4170
|
+
columnIndex: 0,
|
|
4171
|
+
rowIndex: rowIndex
|
|
4169
4172
|
};
|
|
4170
4173
|
const changes = [{
|
|
4171
|
-
|
|
4174
|
+
deleted: [''],
|
|
4172
4175
|
end: position,
|
|
4173
4176
|
inserted: [getLine(editor, rowIndex), ''],
|
|
4174
|
-
|
|
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
|
-
|
|
4185
|
-
|
|
4187
|
+
columnIndex: 0,
|
|
4188
|
+
rowIndex: 0
|
|
4186
4189
|
};
|
|
4187
4190
|
}
|
|
4188
4191
|
return {
|
|
4189
|
-
|
|
4190
|
-
|
|
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
|
-
|
|
4196
|
-
|
|
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
|
-
|
|
4383
|
-
|
|
4385
|
+
columnIndex: 0,
|
|
4386
|
+
rowIndex: rowIndex + 1
|
|
4384
4387
|
};
|
|
4385
4388
|
}
|
|
4386
4389
|
const delta = getDelta(lines[rowIndex], columnIndex);
|
|
4387
4390
|
return {
|
|
4388
|
-
|
|
4389
|
-
|
|
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
|
-
|
|
4559
|
-
|
|
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
|
-
|
|
4569
|
-
|
|
4568
|
+
end: selectionEnd,
|
|
4569
|
+
start: positionLeft
|
|
4570
4570
|
}),
|
|
4571
|
-
|
|
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
|
-
|
|
4610
|
-
|
|
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
|
-
|
|
4623
|
-
|
|
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
|
-
|
|
4658
|
-
|
|
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
|
-
|
|
4667
|
-
|
|
4666
|
+
end: positionRight,
|
|
4667
|
+
start: start
|
|
4668
4668
|
}),
|
|
4669
|
-
|
|
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
|
-
|
|
5007
|
-
startColumnIndex: definition.startColumnIndex,
|
|
5009
|
+
endColumnIndex: definition.endColumnIndex,
|
|
5008
5010
|
endRowIndex: definition.endRowIndex,
|
|
5009
|
-
|
|
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
|
-
|
|
5148
|
-
|
|
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
|
-
|
|
5165
|
-
|
|
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
|
-
|
|
5236
|
-
|
|
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
|
-
|
|
5292
|
+
additionalFocus: 0,
|
|
5290
5293
|
focus: FocusEditorText$1,
|
|
5291
|
-
|
|
5294
|
+
focused: true
|
|
5292
5295
|
};
|
|
5293
5296
|
};
|
|
5294
5297
|
|
|
@@ -5330,18 +5333,15 @@ const handleTripleClick = (editor, modifier, x, y) => {
|
|
|
5330
5333
|
object(editor);
|
|
5331
5334
|
number(x);
|
|
5332
5335
|
number(y);
|
|
5333
|
-
return
|
|
5334
|
-
newState: selectLine(editor),
|
|
5335
|
-
commands: []
|
|
5336
|
-
};
|
|
5336
|
+
return selectLine(editor);
|
|
5337
5337
|
};
|
|
5338
5338
|
|
|
5339
5339
|
const handleMouseDown = (state, modifier, x, y, detail) => {
|
|
5340
5340
|
switch (detail) {
|
|
5341
|
-
case Single:
|
|
5342
|
-
return handleSingleClick(state, modifier, x, y);
|
|
5343
5341
|
case Double:
|
|
5344
5342
|
return handleDoubleClick(state, modifier, x, y);
|
|
5343
|
+
case Single:
|
|
5344
|
+
return handleSingleClick(state, modifier, x, y);
|
|
5345
5345
|
case Triple:
|
|
5346
5346
|
return handleTripleClick(state, modifier, x, y);
|
|
5347
5347
|
default:
|
|
@@ -5350,10 +5350,10 @@ const handleMouseDown = (state, modifier, x, y, detail) => {
|
|
|
5350
5350
|
};
|
|
5351
5351
|
|
|
5352
5352
|
const state$2 = {
|
|
5353
|
+
editor: undefined,
|
|
5353
5354
|
timeout: -1,
|
|
5354
5355
|
x: 0,
|
|
5355
|
-
y: 0
|
|
5356
|
-
editor: undefined
|
|
5356
|
+
y: 0
|
|
5357
5357
|
};
|
|
5358
5358
|
const get = () => {
|
|
5359
5359
|
return state$2;
|
|
@@ -5381,9 +5381,9 @@ const showHover$1 = async (editor, position) => {
|
|
|
5381
5381
|
|
|
5382
5382
|
const onHoverIdle = async () => {
|
|
5383
5383
|
const {
|
|
5384
|
+
editor,
|
|
5384
5385
|
x,
|
|
5385
|
-
y
|
|
5386
|
-
editor
|
|
5386
|
+
y
|
|
5387
5387
|
} = get();
|
|
5388
5388
|
await at(editor, x, y);
|
|
5389
5389
|
await showHover$1();
|
|
@@ -5476,21 +5476,21 @@ const getSelectionFromNativeRange = (editor, range) => {
|
|
|
5476
5476
|
const getChanges$3 = (editor, data, range) => {
|
|
5477
5477
|
const selection = getSelectionFromNativeRange(editor, range);
|
|
5478
5478
|
const selectionRange = {
|
|
5479
|
-
start: {
|
|
5480
|
-
rowIndex: selection[0],
|
|
5481
|
-
columnIndex: selection[1]
|
|
5482
|
-
},
|
|
5483
5479
|
end: {
|
|
5484
|
-
|
|
5485
|
-
|
|
5480
|
+
columnIndex: selection[3],
|
|
5481
|
+
rowIndex: selection[2]
|
|
5482
|
+
},
|
|
5483
|
+
start: {
|
|
5484
|
+
columnIndex: selection[1],
|
|
5485
|
+
rowIndex: selection[0]
|
|
5486
5486
|
}
|
|
5487
5487
|
};
|
|
5488
5488
|
const changes = [{
|
|
5489
|
-
|
|
5489
|
+
deleted: getSelectionText(editor, selectionRange),
|
|
5490
5490
|
end: selectionRange.end,
|
|
5491
5491
|
inserted: [data],
|
|
5492
|
-
|
|
5493
|
-
|
|
5492
|
+
origin: ContentEditableInput,
|
|
5493
|
+
start: selectionRange.start
|
|
5494
5494
|
}];
|
|
5495
5495
|
return changes;
|
|
5496
5496
|
};
|
|
@@ -5514,8 +5514,8 @@ const state$1 = {
|
|
|
5514
5514
|
currentEditor: undefined,
|
|
5515
5515
|
hasListener: false,
|
|
5516
5516
|
position: {
|
|
5517
|
-
|
|
5518
|
-
|
|
5517
|
+
columnIndex: 0,
|
|
5518
|
+
rowIndex: 0
|
|
5519
5519
|
}
|
|
5520
5520
|
};
|
|
5521
5521
|
|
|
@@ -5571,10 +5571,10 @@ const getNewPercent$1 = (size, scrollBarSize, relativeX) => {
|
|
|
5571
5571
|
// @ts-ignore
|
|
5572
5572
|
const handleScrollBarHorizontalMove = (state, eventX) => {
|
|
5573
5573
|
const {
|
|
5574
|
-
|
|
5575
|
-
width,
|
|
5574
|
+
handleOffsetX,
|
|
5576
5575
|
longestLineWidth,
|
|
5577
|
-
|
|
5576
|
+
width,
|
|
5577
|
+
x
|
|
5578
5578
|
} = state;
|
|
5579
5579
|
const spaceRight = 20; // TODO make this configurable
|
|
5580
5580
|
const normalizedEventX = clamp(eventX, x, x + width);
|
|
@@ -5605,10 +5605,10 @@ const handleScrollBarHorizontalMove = (state, eventX) => {
|
|
|
5605
5605
|
const handleScrollBarHorizontalPointerDown = (state, eventX) => {
|
|
5606
5606
|
// @ts-ignore
|
|
5607
5607
|
const {
|
|
5608
|
-
x,
|
|
5609
5608
|
deltaX,
|
|
5609
|
+
longestLineWidth,
|
|
5610
5610
|
width,
|
|
5611
|
-
|
|
5611
|
+
x
|
|
5612
5612
|
} = state;
|
|
5613
5613
|
const relativeX = eventX - x;
|
|
5614
5614
|
const scrollBarWidth = getScrollBarWidth(width, longestLineWidth);
|
|
@@ -5622,14 +5622,14 @@ const handleScrollBarHorizontalPointerDown = (state, eventX) => {
|
|
|
5622
5622
|
};
|
|
5623
5623
|
}
|
|
5624
5624
|
const {
|
|
5625
|
-
|
|
5626
|
-
|
|
5625
|
+
handleOffset,
|
|
5626
|
+
percent
|
|
5627
5627
|
} = getNewDeltaPercent(width, scrollBarWidth, relativeX);
|
|
5628
5628
|
const newDeltaX = percent * finalDeltaX;
|
|
5629
5629
|
return {
|
|
5630
5630
|
...state,
|
|
5631
|
-
|
|
5632
|
-
|
|
5631
|
+
deltaX: newDeltaX,
|
|
5632
|
+
handleOffsetX: handleOffset
|
|
5633
5633
|
};
|
|
5634
5634
|
};
|
|
5635
5635
|
|
|
@@ -5656,9 +5656,9 @@ const getNewPercent = (state, relativeY) => {
|
|
|
5656
5656
|
// @ts-ignore
|
|
5657
5657
|
const handleScrollBarMove = (state, eventY) => {
|
|
5658
5658
|
const {
|
|
5659
|
-
y,
|
|
5660
5659
|
finalDeltaY,
|
|
5661
|
-
handleOffset
|
|
5660
|
+
handleOffset,
|
|
5661
|
+
y
|
|
5662
5662
|
} = state;
|
|
5663
5663
|
const relativeY = eventY - y - handleOffset;
|
|
5664
5664
|
const newPercent = getNewPercent(state, relativeY);
|
|
@@ -5675,11 +5675,11 @@ const handleScrollBarVerticalPointerMove = handleScrollBarMove;
|
|
|
5675
5675
|
|
|
5676
5676
|
const handleScrollBarPointerDown = (state, eventY) => {
|
|
5677
5677
|
const {
|
|
5678
|
-
y,
|
|
5679
5678
|
deltaY,
|
|
5680
5679
|
finalDeltaY,
|
|
5681
5680
|
height,
|
|
5682
|
-
scrollBarHeight
|
|
5681
|
+
scrollBarHeight,
|
|
5682
|
+
y
|
|
5683
5683
|
} = state;
|
|
5684
5684
|
const relativeY = eventY - y;
|
|
5685
5685
|
const currentScrollBarY = getScrollBarY(deltaY, finalDeltaY, height, scrollBarHeight);
|
|
@@ -5691,8 +5691,8 @@ const handleScrollBarPointerDown = (state, eventY) => {
|
|
|
5691
5691
|
};
|
|
5692
5692
|
}
|
|
5693
5693
|
const {
|
|
5694
|
-
|
|
5695
|
-
|
|
5694
|
+
handleOffset,
|
|
5695
|
+
percent
|
|
5696
5696
|
} = getNewDeltaPercent(height, scrollBarHeight, relativeY);
|
|
5697
5697
|
const newDeltaY = percent * finalDeltaY;
|
|
5698
5698
|
return {
|
|
@@ -5724,8 +5724,8 @@ const handleTouchEnd = (editor, touchEvent) => {
|
|
|
5724
5724
|
};
|
|
5725
5725
|
|
|
5726
5726
|
const state = {
|
|
5727
|
-
|
|
5728
|
-
|
|
5727
|
+
deltaY: 0,
|
|
5728
|
+
touchOffsetY: 0
|
|
5729
5729
|
};
|
|
5730
5730
|
|
|
5731
5731
|
// @ts-ignore
|
|
@@ -5792,17 +5792,17 @@ const getChanges$2 = selections => {
|
|
|
5792
5792
|
}
|
|
5793
5793
|
for (const rowToIndent of rowsToIndentLess) {
|
|
5794
5794
|
changes.push({
|
|
5795
|
-
|
|
5796
|
-
rowIndex: rowToIndent,
|
|
5797
|
-
columnIndex: 0
|
|
5798
|
-
},
|
|
5795
|
+
deleted: [' '],
|
|
5799
5796
|
end: {
|
|
5800
|
-
|
|
5801
|
-
|
|
5797
|
+
columnIndex: 2,
|
|
5798
|
+
rowIndex: rowToIndent
|
|
5802
5799
|
},
|
|
5803
5800
|
inserted: [''],
|
|
5804
|
-
|
|
5805
|
-
|
|
5801
|
+
origin: IndentLess,
|
|
5802
|
+
start: {
|
|
5803
|
+
columnIndex: 0,
|
|
5804
|
+
rowIndex: rowToIndent
|
|
5805
|
+
}
|
|
5806
5806
|
});
|
|
5807
5807
|
}
|
|
5808
5808
|
return changes;
|
|
@@ -5829,17 +5829,17 @@ const getChanges$1 = selections => {
|
|
|
5829
5829
|
const changes = [];
|
|
5830
5830
|
for (const rowToIndent of rowsToIndent) {
|
|
5831
5831
|
changes.push({
|
|
5832
|
-
|
|
5833
|
-
rowIndex: rowToIndent,
|
|
5834
|
-
columnIndex: 0
|
|
5835
|
-
},
|
|
5832
|
+
deleted: [''],
|
|
5836
5833
|
end: {
|
|
5837
|
-
|
|
5838
|
-
|
|
5834
|
+
columnIndex: 0,
|
|
5835
|
+
rowIndex: rowToIndent
|
|
5839
5836
|
},
|
|
5840
5837
|
inserted: [' '],
|
|
5841
|
-
|
|
5842
|
-
|
|
5838
|
+
origin: IndentMore,
|
|
5839
|
+
start: {
|
|
5840
|
+
columnIndex: 0,
|
|
5841
|
+
rowIndex: rowToIndent
|
|
5842
|
+
}
|
|
5843
5843
|
});
|
|
5844
5844
|
}
|
|
5845
5845
|
return changes;
|
|
@@ -5855,8 +5855,8 @@ const indentMore = editor => {
|
|
|
5855
5855
|
const getLanguageConfiguration = async editor => {
|
|
5856
5856
|
// @ts-ignore
|
|
5857
5857
|
return invoke$b('Languages.getLanguageConfiguration', {
|
|
5858
|
-
|
|
5859
|
-
|
|
5858
|
+
languageId: editor.languageId,
|
|
5859
|
+
uri: editor.uri
|
|
5860
5860
|
});
|
|
5861
5861
|
};
|
|
5862
5862
|
|
|
@@ -5880,16 +5880,16 @@ const getChanges = (lines, selections, languageConfiguration) => {
|
|
|
5880
5880
|
for (let i = 0; i < selections.length; i += 4) {
|
|
5881
5881
|
const [selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn] = getSelectionPairs(selections, i);
|
|
5882
5882
|
const start = {
|
|
5883
|
-
|
|
5884
|
-
|
|
5883
|
+
columnIndex: selectionStartColumn,
|
|
5884
|
+
rowIndex: selectionStartRow
|
|
5885
5885
|
};
|
|
5886
5886
|
const end = {
|
|
5887
|
-
|
|
5888
|
-
|
|
5887
|
+
columnIndex: selectionEndColumn,
|
|
5888
|
+
rowIndex: selectionEndRow
|
|
5889
5889
|
};
|
|
5890
5890
|
const range = {
|
|
5891
|
-
|
|
5892
|
-
|
|
5891
|
+
end,
|
|
5892
|
+
start
|
|
5893
5893
|
};
|
|
5894
5894
|
if (isEmpty(selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn)) {
|
|
5895
5895
|
const line = lines[selectionStartRow];
|
|
@@ -5897,36 +5897,36 @@ const getChanges = (lines, selections, languageConfiguration) => {
|
|
|
5897
5897
|
const indent = getIndent(before);
|
|
5898
5898
|
if (shouldIncreaseIndent(before, increaseIndentRegex)) {
|
|
5899
5899
|
changes.push({
|
|
5900
|
-
start: start,
|
|
5901
|
-
end: end,
|
|
5902
|
-
inserted: ['', indent + ' ', indent],
|
|
5903
5900
|
deleted: getSelectionText({
|
|
5904
5901
|
lines
|
|
5905
5902
|
}, range),
|
|
5906
|
-
|
|
5903
|
+
end: end,
|
|
5904
|
+
inserted: ['', indent + ' ', indent],
|
|
5905
|
+
origin: InsertLineBreak,
|
|
5906
|
+
start: start
|
|
5907
5907
|
});
|
|
5908
5908
|
selectionChanges.push(selectionStartRow + 1, indent.length + 2, selectionStartRow + 1, indent.length + 2);
|
|
5909
5909
|
} else {
|
|
5910
5910
|
changes.push({
|
|
5911
|
-
start: start,
|
|
5912
|
-
end: end,
|
|
5913
|
-
inserted: ['', indent],
|
|
5914
5911
|
deleted: getSelectionText({
|
|
5915
5912
|
lines
|
|
5916
5913
|
}, range),
|
|
5917
|
-
|
|
5914
|
+
end: end,
|
|
5915
|
+
inserted: ['', indent],
|
|
5916
|
+
origin: InsertLineBreak,
|
|
5917
|
+
start: start
|
|
5918
5918
|
});
|
|
5919
5919
|
selectionChanges.push(selectionStartRow + 1, indent.length, selectionStartRow + 1, indent.length);
|
|
5920
5920
|
}
|
|
5921
5921
|
} else {
|
|
5922
5922
|
changes.push({
|
|
5923
|
-
start: start,
|
|
5924
|
-
end: end,
|
|
5925
|
-
inserted: ['', ''],
|
|
5926
5923
|
deleted: getSelectionText({
|
|
5927
5924
|
lines
|
|
5928
5925
|
}, range),
|
|
5929
|
-
|
|
5926
|
+
end: end,
|
|
5927
|
+
inserted: ['', ''],
|
|
5928
|
+
origin: InsertLineBreak,
|
|
5929
|
+
start: start
|
|
5930
5930
|
});
|
|
5931
5931
|
selectionChanges.push(selectionStartRow + 1, 0, selectionStartRow + 1, 0);
|
|
5932
5932
|
}
|
|
@@ -6022,12 +6022,12 @@ const editorMoveSelectionForwards = (anchor, position) => {
|
|
|
6022
6022
|
// @ts-ignore
|
|
6023
6023
|
const getNewSelections$5 = (anchor, position) => {
|
|
6024
6024
|
switch (compare(position, anchor)) {
|
|
6025
|
-
case LessThan:
|
|
6026
|
-
return editorMoveSelectionBackwards(anchor, position);
|
|
6027
6025
|
case Equal:
|
|
6028
6026
|
return editorMoveSelectionEqual(anchor, position);
|
|
6029
6027
|
case GreaterThan:
|
|
6030
6028
|
return editorMoveSelectionForwards(anchor, position);
|
|
6029
|
+
case LessThan:
|
|
6030
|
+
return editorMoveSelectionBackwards(anchor, position);
|
|
6031
6031
|
default:
|
|
6032
6032
|
throw new Error('unexpected comparison result');
|
|
6033
6033
|
}
|
|
@@ -6048,8 +6048,8 @@ const requestAnimationFrame = fn => {
|
|
|
6048
6048
|
// @ts-ignore
|
|
6049
6049
|
const getNewEditor$1 = (editor, position) => {
|
|
6050
6050
|
const {
|
|
6051
|
-
minLineY,
|
|
6052
6051
|
maxLineY,
|
|
6052
|
+
minLineY,
|
|
6053
6053
|
rowHeight
|
|
6054
6054
|
} = editor;
|
|
6055
6055
|
const diff = maxLineY - minLineY;
|
|
@@ -6061,9 +6061,9 @@ const getNewEditor$1 = (editor, position) => {
|
|
|
6061
6061
|
const newSelections = new Uint32Array([position.rowIndex - 1, position.columnIndex, anchor.rowIndex, anchor.columnIndex]);
|
|
6062
6062
|
return {
|
|
6063
6063
|
...editor,
|
|
6064
|
-
minLineY: newMinLineY,
|
|
6065
|
-
maxLineY: newMaxLineY,
|
|
6066
6064
|
deltaY: newDeltaY,
|
|
6065
|
+
maxLineY: newMaxLineY,
|
|
6066
|
+
minLineY: newMinLineY,
|
|
6067
6067
|
selections: newSelections
|
|
6068
6068
|
};
|
|
6069
6069
|
}
|
|
@@ -6076,9 +6076,9 @@ const getNewEditor$1 = (editor, position) => {
|
|
|
6076
6076
|
const newSelections = new Uint32Array([anchor.rowIndex, anchor.columnIndex, position.rowIndex + 1, position.columnIndex]);
|
|
6077
6077
|
return {
|
|
6078
6078
|
...editor,
|
|
6079
|
-
minLineY: newMinLineY,
|
|
6080
|
-
maxLineY: newMaxLineY,
|
|
6081
6079
|
deltaY: newDeltaY,
|
|
6080
|
+
maxLineY: newMaxLineY,
|
|
6081
|
+
minLineY: newMinLineY,
|
|
6082
6082
|
selections: newSelections
|
|
6083
6083
|
};
|
|
6084
6084
|
}
|
|
@@ -6102,8 +6102,8 @@ const continueScrollingAndMovingSelection = async () => {
|
|
|
6102
6102
|
// @ts-ignore
|
|
6103
6103
|
const delta = position.rowIndex < editor.minLineY ? -1 : 1;
|
|
6104
6104
|
setPosition({
|
|
6105
|
-
|
|
6106
|
-
|
|
6105
|
+
columnIndex: position.columnIndex,
|
|
6106
|
+
rowIndex: position.rowIndex + delta
|
|
6107
6107
|
});
|
|
6108
6108
|
requestAnimationFrame(continueScrollingAndMovingSelection);
|
|
6109
6109
|
// TODO get editor state
|
|
@@ -6133,25 +6133,25 @@ const create$5 = () => {
|
|
|
6133
6133
|
const completionUid = create$7();
|
|
6134
6134
|
const widget = {
|
|
6135
6135
|
id: CodeGenerator,
|
|
6136
|
-
|
|
6137
|
-
|
|
6136
|
+
newState: {
|
|
6137
|
+
focused: true,
|
|
6138
|
+
focusSource: Script,
|
|
6139
|
+
height: 0,
|
|
6138
6140
|
questions: [],
|
|
6139
|
-
|
|
6140
|
-
y: 0,
|
|
6141
|
+
uid: completionUid,
|
|
6141
6142
|
width: 0,
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
focusSource: Unknown$1
|
|
6143
|
+
x: 0,
|
|
6144
|
+
y: 0
|
|
6145
6145
|
},
|
|
6146
|
-
|
|
6147
|
-
|
|
6146
|
+
oldState: {
|
|
6147
|
+
focused: false,
|
|
6148
|
+
focusSource: Unknown$1,
|
|
6149
|
+
height: 0,
|
|
6148
6150
|
questions: [],
|
|
6149
|
-
|
|
6150
|
-
y: 0,
|
|
6151
|
+
uid: completionUid,
|
|
6151
6152
|
width: 0,
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
focusSource: Script
|
|
6153
|
+
x: 0,
|
|
6154
|
+
y: 0
|
|
6155
6155
|
}
|
|
6156
6156
|
};
|
|
6157
6157
|
return widget;
|
|
@@ -6160,10 +6160,10 @@ const create$5 = () => {
|
|
|
6160
6160
|
const newStateGenerator$5 = async state => {
|
|
6161
6161
|
const latestState = {
|
|
6162
6162
|
...state,
|
|
6163
|
-
|
|
6164
|
-
y: 100,
|
|
6163
|
+
height: 45,
|
|
6165
6164
|
width: 150,
|
|
6166
|
-
|
|
6165
|
+
x: 100,
|
|
6166
|
+
y: 100
|
|
6167
6167
|
};
|
|
6168
6168
|
return latestState;
|
|
6169
6169
|
};
|
|
@@ -6176,38 +6176,38 @@ const create$4 = () => {
|
|
|
6176
6176
|
const completionUid = create$7();
|
|
6177
6177
|
const completionWidget = {
|
|
6178
6178
|
id: Completion,
|
|
6179
|
-
|
|
6179
|
+
newState: {
|
|
6180
|
+
commands: [],
|
|
6181
|
+
height: 0,
|
|
6180
6182
|
uid: completionUid,
|
|
6181
|
-
x: 0,
|
|
6182
|
-
y: 0,
|
|
6183
6183
|
width: 0,
|
|
6184
|
-
|
|
6185
|
-
|
|
6184
|
+
x: 0,
|
|
6185
|
+
y: 0
|
|
6186
6186
|
},
|
|
6187
|
-
|
|
6187
|
+
oldState: {
|
|
6188
|
+
commands: [],
|
|
6189
|
+
height: 0,
|
|
6188
6190
|
uid: completionUid,
|
|
6189
|
-
x: 0,
|
|
6190
|
-
y: 0,
|
|
6191
6191
|
width: 0,
|
|
6192
|
-
|
|
6193
|
-
|
|
6192
|
+
x: 0,
|
|
6193
|
+
y: 0
|
|
6194
6194
|
}
|
|
6195
6195
|
};
|
|
6196
6196
|
return completionWidget;
|
|
6197
6197
|
};
|
|
6198
6198
|
|
|
6199
6199
|
const {
|
|
6200
|
-
|
|
6201
|
-
|
|
6200
|
+
invoke: invoke$4,
|
|
6201
|
+
setFactory
|
|
6202
6202
|
} = createLazyRpc(CompletionWorker);
|
|
6203
6203
|
|
|
6204
6204
|
const newStateGenerator$4 = async (state, parentUid) => {
|
|
6205
6205
|
const {
|
|
6206
|
+
height,
|
|
6206
6207
|
uid,
|
|
6207
|
-
x,
|
|
6208
|
-
y,
|
|
6209
6208
|
width,
|
|
6210
|
-
|
|
6209
|
+
x,
|
|
6210
|
+
y
|
|
6211
6211
|
} = state;
|
|
6212
6212
|
const {
|
|
6213
6213
|
newState
|
|
@@ -6233,23 +6233,23 @@ const create$3 = () => {
|
|
|
6233
6233
|
const uid = create$7();
|
|
6234
6234
|
const widget = {
|
|
6235
6235
|
id: Find,
|
|
6236
|
-
|
|
6236
|
+
newState: {
|
|
6237
|
+
commands: [],
|
|
6238
|
+
editorUid: 0,
|
|
6239
|
+
height: 0,
|
|
6237
6240
|
uid,
|
|
6238
|
-
x: 0,
|
|
6239
|
-
y: 0,
|
|
6240
6241
|
width: 0,
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
editorUid: 0
|
|
6242
|
+
x: 0,
|
|
6243
|
+
y: 0
|
|
6244
6244
|
},
|
|
6245
|
-
|
|
6245
|
+
oldState: {
|
|
6246
|
+
commands: [],
|
|
6247
|
+
editorUid: 0,
|
|
6248
|
+
height: 0,
|
|
6246
6249
|
uid,
|
|
6247
|
-
x: 0,
|
|
6248
|
-
y: 0,
|
|
6249
6250
|
width: 0,
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
editorUid: 0
|
|
6251
|
+
x: 0,
|
|
6252
|
+
y: 0
|
|
6253
6253
|
}
|
|
6254
6254
|
};
|
|
6255
6255
|
return widget;
|
|
@@ -6303,10 +6303,10 @@ const loadContent$1 = async (state, parentUid) => {
|
|
|
6303
6303
|
} = state;
|
|
6304
6304
|
const editor = getEditor(parentUid);
|
|
6305
6305
|
const {
|
|
6306
|
-
|
|
6307
|
-
y,
|
|
6306
|
+
height,
|
|
6308
6307
|
width,
|
|
6309
|
-
|
|
6308
|
+
x,
|
|
6309
|
+
y
|
|
6310
6310
|
} = editor;
|
|
6311
6311
|
await launch();
|
|
6312
6312
|
await invoke$3('FindWidget.create', uid, x, y, width, height, parentUid);
|
|
@@ -6340,10 +6340,10 @@ const getPositionAtCursor$1 = editor => {
|
|
|
6340
6340
|
const x$1 = x(editor, rowIndex, columnIndex);
|
|
6341
6341
|
const y$1 = y(editor, rowIndex);
|
|
6342
6342
|
return {
|
|
6343
|
-
|
|
6344
|
-
y: y$1,
|
|
6343
|
+
columnIndex,
|
|
6345
6344
|
rowIndex,
|
|
6346
|
-
|
|
6345
|
+
x: x$1,
|
|
6346
|
+
y: y$1
|
|
6347
6347
|
};
|
|
6348
6348
|
};
|
|
6349
6349
|
|
|
@@ -6351,21 +6351,21 @@ const create$2 = () => {
|
|
|
6351
6351
|
const completionUid = create$7();
|
|
6352
6352
|
const renameWidget = {
|
|
6353
6353
|
id: Rename$1,
|
|
6354
|
-
oldState: {
|
|
6355
|
-
uid: completionUid,
|
|
6356
|
-
x: 0,
|
|
6357
|
-
y: 0,
|
|
6358
|
-
width: 0,
|
|
6359
|
-
height: 0,
|
|
6360
|
-
commands: []
|
|
6361
|
-
},
|
|
6362
6354
|
newState: {
|
|
6355
|
+
commands: [],
|
|
6356
|
+
height: 0,
|
|
6363
6357
|
uid: completionUid,
|
|
6364
|
-
x: 0,
|
|
6365
|
-
y: 0,
|
|
6366
6358
|
width: 0,
|
|
6359
|
+
x: 0,
|
|
6360
|
+
y: 0
|
|
6361
|
+
},
|
|
6362
|
+
oldState: {
|
|
6363
|
+
commands: [],
|
|
6367
6364
|
height: 0,
|
|
6368
|
-
|
|
6365
|
+
uid: completionUid,
|
|
6366
|
+
width: 0,
|
|
6367
|
+
x: 0,
|
|
6368
|
+
y: 0
|
|
6369
6369
|
}
|
|
6370
6370
|
};
|
|
6371
6371
|
return renameWidget;
|
|
@@ -6373,11 +6373,11 @@ const create$2 = () => {
|
|
|
6373
6373
|
|
|
6374
6374
|
const newStateGenerator$2 = async (state, parentUid) => {
|
|
6375
6375
|
const {
|
|
6376
|
+
height,
|
|
6376
6377
|
uid,
|
|
6377
|
-
x,
|
|
6378
|
-
y,
|
|
6379
6378
|
width,
|
|
6380
|
-
|
|
6379
|
+
x,
|
|
6380
|
+
y
|
|
6381
6381
|
} = state;
|
|
6382
6382
|
const {
|
|
6383
6383
|
newState
|
|
@@ -6396,8 +6396,8 @@ const newStateGenerator$2 = async (state, parentUid) => {
|
|
|
6396
6396
|
};
|
|
6397
6397
|
const openRename = async editor => {
|
|
6398
6398
|
const {
|
|
6399
|
-
|
|
6400
|
-
|
|
6399
|
+
columnIndex,
|
|
6400
|
+
rowIndex
|
|
6401
6401
|
} = getPositionAtCursor$1(editor);
|
|
6402
6402
|
const {
|
|
6403
6403
|
word
|
|
@@ -6411,10 +6411,10 @@ const openRename = async editor => {
|
|
|
6411
6411
|
|
|
6412
6412
|
const getOrganizeImportEdits = async editor => {
|
|
6413
6413
|
const edits = await execute({
|
|
6414
|
+
args: [],
|
|
6414
6415
|
editor,
|
|
6415
6416
|
event: 'onLanguage',
|
|
6416
|
-
method: 'ExtensionHostOrganizeImports.execute'
|
|
6417
|
-
args: []
|
|
6417
|
+
method: 'ExtensionHostOrganizeImports.execute'
|
|
6418
6418
|
});
|
|
6419
6419
|
return edits;
|
|
6420
6420
|
};
|
|
@@ -6456,26 +6456,26 @@ const getErrorMessage$1 = error => {
|
|
|
6456
6456
|
const prepareErrorMessageWithCodeFrame = error => {
|
|
6457
6457
|
if (!error) {
|
|
6458
6458
|
return {
|
|
6459
|
+
codeFrame: undefined,
|
|
6459
6460
|
message: error,
|
|
6460
6461
|
stack: undefined,
|
|
6461
|
-
codeFrame: undefined,
|
|
6462
6462
|
type: 'Error'
|
|
6463
6463
|
};
|
|
6464
6464
|
}
|
|
6465
6465
|
const message = getErrorMessage$1(error);
|
|
6466
6466
|
if (error.codeFrame) {
|
|
6467
6467
|
return {
|
|
6468
|
+
codeFrame: error.codeFrame,
|
|
6468
6469
|
message,
|
|
6469
6470
|
stack: error.stack,
|
|
6470
|
-
codeFrame: error.codeFrame,
|
|
6471
6471
|
type: error.constructor.name
|
|
6472
6472
|
};
|
|
6473
6473
|
}
|
|
6474
6474
|
return {
|
|
6475
|
+
category: error.category,
|
|
6476
|
+
codeFrame: error.originalCodeFrame,
|
|
6475
6477
|
message,
|
|
6476
6478
|
stack: error.originalStack,
|
|
6477
|
-
codeFrame: error.originalCodeFrame,
|
|
6478
|
-
category: error.category,
|
|
6479
6479
|
stderr: error.stderr
|
|
6480
6480
|
};
|
|
6481
6481
|
};
|
|
@@ -6674,8 +6674,8 @@ const getWordMatchAtPosition = (lines, rowIndex, columnIndex) => {
|
|
|
6674
6674
|
const end = getWordEndIndex(line, columnIndex);
|
|
6675
6675
|
const word = line.slice(start, end);
|
|
6676
6676
|
return {
|
|
6677
|
-
start,
|
|
6678
6677
|
end,
|
|
6678
|
+
start,
|
|
6679
6679
|
word
|
|
6680
6680
|
};
|
|
6681
6681
|
};
|
|
@@ -7025,8 +7025,9 @@ const getSelectNextOccurrenceResult = editor => {
|
|
|
7025
7025
|
}
|
|
7026
7026
|
}
|
|
7027
7027
|
return {
|
|
7028
|
-
|
|
7029
|
-
|
|
7028
|
+
revealRange: newSelections.length - 4,
|
|
7029
|
+
// TODO should be primary selection
|
|
7030
|
+
selectionEdits: newSelections
|
|
7030
7031
|
};
|
|
7031
7032
|
}
|
|
7032
7033
|
if (isEverySelectionSingleLine(editor.selections)) {
|
|
@@ -7152,8 +7153,8 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
|
|
|
7152
7153
|
}
|
|
7153
7154
|
const syncIncremental = getEnabled();
|
|
7154
7155
|
const {
|
|
7155
|
-
|
|
7156
|
-
|
|
7156
|
+
differences,
|
|
7157
|
+
textInfos
|
|
7157
7158
|
} = await getVisible$1(editor, syncIncremental);
|
|
7158
7159
|
const latest2 = getEditor(editor.uid);
|
|
7159
7160
|
if (!latest2) {
|
|
@@ -7161,9 +7162,9 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
|
|
|
7161
7162
|
}
|
|
7162
7163
|
const newEditor4 = {
|
|
7163
7164
|
...latest2,
|
|
7165
|
+
differences,
|
|
7164
7166
|
focused: true,
|
|
7165
|
-
textInfos
|
|
7166
|
-
differences
|
|
7167
|
+
textInfos
|
|
7167
7168
|
};
|
|
7168
7169
|
|
|
7169
7170
|
// TODO don't update editor if tokenizer was already loaded
|
|
@@ -7172,16 +7173,16 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
|
|
|
7172
7173
|
|
|
7173
7174
|
return {
|
|
7174
7175
|
...newEditor4,
|
|
7175
|
-
languageId,
|
|
7176
7176
|
invalidStartIndex: 0,
|
|
7177
|
+
languageId,
|
|
7177
7178
|
tokenizerId: newTokenizerId
|
|
7178
7179
|
};
|
|
7179
7180
|
};
|
|
7180
7181
|
|
|
7181
7182
|
const setSelections = (editor, selections) => {
|
|
7182
7183
|
const {
|
|
7183
|
-
minLineY,
|
|
7184
7184
|
maxLineY,
|
|
7185
|
+
minLineY,
|
|
7185
7186
|
rowHeight
|
|
7186
7187
|
} = editor;
|
|
7187
7188
|
const startRowIndex = selections[0];
|
|
@@ -7189,20 +7190,20 @@ const setSelections = (editor, selections) => {
|
|
|
7189
7190
|
const deltaY = startRowIndex * rowHeight;
|
|
7190
7191
|
return {
|
|
7191
7192
|
...editor,
|
|
7192
|
-
|
|
7193
|
+
deltaY,
|
|
7193
7194
|
maxLineY: startRowIndex + 1,
|
|
7194
|
-
|
|
7195
|
-
|
|
7195
|
+
minLineY: startRowIndex,
|
|
7196
|
+
selections
|
|
7196
7197
|
};
|
|
7197
7198
|
}
|
|
7198
7199
|
if (startRowIndex > maxLineY) {
|
|
7199
7200
|
const deltaY = startRowIndex * rowHeight;
|
|
7200
7201
|
return {
|
|
7201
7202
|
...editor,
|
|
7202
|
-
|
|
7203
|
+
deltaY,
|
|
7203
7204
|
maxLineY: startRowIndex + 1,
|
|
7204
|
-
|
|
7205
|
-
|
|
7205
|
+
minLineY: startRowIndex,
|
|
7206
|
+
selections
|
|
7206
7207
|
};
|
|
7207
7208
|
}
|
|
7208
7209
|
return {
|
|
@@ -7215,31 +7216,31 @@ const create$1 = () => {
|
|
|
7215
7216
|
const uid = create$7();
|
|
7216
7217
|
const widget = {
|
|
7217
7218
|
id: Hover,
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
x: 0,
|
|
7221
|
-
y: 0,
|
|
7222
|
-
width: 0,
|
|
7223
|
-
height: 0,
|
|
7219
|
+
newState: {
|
|
7220
|
+
commands: [],
|
|
7224
7221
|
content: '',
|
|
7225
7222
|
diagnostics: [],
|
|
7226
7223
|
documentation: '',
|
|
7227
7224
|
editorUid: 0,
|
|
7225
|
+
height: 0,
|
|
7228
7226
|
lineInfos: [],
|
|
7229
|
-
commands: []
|
|
7230
|
-
},
|
|
7231
|
-
newState: {
|
|
7232
7227
|
uid: uid,
|
|
7233
|
-
x: 0,
|
|
7234
|
-
y: 0,
|
|
7235
7228
|
width: 0,
|
|
7236
|
-
|
|
7229
|
+
x: 0,
|
|
7230
|
+
y: 0
|
|
7231
|
+
},
|
|
7232
|
+
oldState: {
|
|
7233
|
+
commands: [],
|
|
7237
7234
|
content: '',
|
|
7238
7235
|
diagnostics: [],
|
|
7239
7236
|
documentation: '',
|
|
7240
7237
|
editorUid: 0,
|
|
7238
|
+
height: 0,
|
|
7241
7239
|
lineInfos: [],
|
|
7242
|
-
|
|
7240
|
+
uid: uid,
|
|
7241
|
+
width: 0,
|
|
7242
|
+
x: 0,
|
|
7243
|
+
y: 0
|
|
7243
7244
|
}
|
|
7244
7245
|
};
|
|
7245
7246
|
return widget;
|
|
@@ -7267,11 +7268,11 @@ const invoke$2 = async (method, ...params) => {
|
|
|
7267
7268
|
|
|
7268
7269
|
const newStateGenerator$1 = async (state, parentUid) => {
|
|
7269
7270
|
const {
|
|
7271
|
+
height,
|
|
7270
7272
|
uid,
|
|
7271
|
-
x,
|
|
7272
|
-
y,
|
|
7273
7273
|
width,
|
|
7274
|
-
|
|
7274
|
+
x,
|
|
7275
|
+
y
|
|
7275
7276
|
} = state;
|
|
7276
7277
|
const {
|
|
7277
7278
|
newState
|
|
@@ -7303,27 +7304,27 @@ const create = () => {
|
|
|
7303
7304
|
const completionUid = create$7();
|
|
7304
7305
|
const widget = {
|
|
7305
7306
|
id: SourceAction$1,
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
x: 0,
|
|
7309
|
-
y: 0,
|
|
7310
|
-
width: 0,
|
|
7311
|
-
height: 0,
|
|
7307
|
+
newState: {
|
|
7308
|
+
commands: [],
|
|
7312
7309
|
focusedIndex: 0,
|
|
7313
|
-
|
|
7310
|
+
height: 0,
|
|
7314
7311
|
maxHeight: 0,
|
|
7315
|
-
|
|
7316
|
-
},
|
|
7317
|
-
newState: {
|
|
7312
|
+
sourceActions: [],
|
|
7318
7313
|
uid: completionUid,
|
|
7319
|
-
x: 0,
|
|
7320
|
-
y: 0,
|
|
7321
7314
|
width: 0,
|
|
7322
|
-
|
|
7315
|
+
x: 0,
|
|
7316
|
+
y: 0
|
|
7317
|
+
},
|
|
7318
|
+
oldState: {
|
|
7319
|
+
commands: [],
|
|
7323
7320
|
focusedIndex: 0,
|
|
7324
|
-
|
|
7321
|
+
height: 0,
|
|
7325
7322
|
maxHeight: 0,
|
|
7326
|
-
|
|
7323
|
+
sourceActions: [],
|
|
7324
|
+
uid: completionUid,
|
|
7325
|
+
width: 0,
|
|
7326
|
+
x: 0,
|
|
7327
|
+
y: 0
|
|
7327
7328
|
}
|
|
7328
7329
|
};
|
|
7329
7330
|
return widget;
|
|
@@ -7351,11 +7352,11 @@ const invoke$1 = async (method, ...params) => {
|
|
|
7351
7352
|
|
|
7352
7353
|
const newStateGenerator = async (state, parentUid) => {
|
|
7353
7354
|
const {
|
|
7355
|
+
height,
|
|
7354
7356
|
uid,
|
|
7355
|
-
x,
|
|
7356
|
-
y,
|
|
7357
7357
|
width,
|
|
7358
|
-
|
|
7358
|
+
x,
|
|
7359
|
+
y
|
|
7359
7360
|
} = state;
|
|
7360
7361
|
const {
|
|
7361
7362
|
newState
|
|
@@ -7399,27 +7400,27 @@ const getSortLinesAscendingChanges = (lines, selections) => {
|
|
|
7399
7400
|
const selectionEndRow = selections[i + 2];
|
|
7400
7401
|
const selectionEndColumn = selections[i + 3];
|
|
7401
7402
|
const start = {
|
|
7402
|
-
|
|
7403
|
-
|
|
7403
|
+
columnIndex: selectionStartColumn,
|
|
7404
|
+
rowIndex: selectionStartRow
|
|
7404
7405
|
};
|
|
7405
7406
|
const end = {
|
|
7406
|
-
|
|
7407
|
-
|
|
7407
|
+
columnIndex: selectionEndColumn,
|
|
7408
|
+
rowIndex: selectionEndRow
|
|
7408
7409
|
};
|
|
7409
7410
|
const selection = {
|
|
7410
|
-
|
|
7411
|
-
|
|
7411
|
+
end,
|
|
7412
|
+
start
|
|
7412
7413
|
};
|
|
7413
7414
|
const selectionLines = lines.slice(startRowIndex, endRowIndex + 1);
|
|
7414
7415
|
const sortedSelectionLines = getSortedLines(selectionLines);
|
|
7415
7416
|
changes.push({
|
|
7416
|
-
start: start,
|
|
7417
|
-
end: end,
|
|
7418
|
-
inserted: sortedSelectionLines,
|
|
7419
7417
|
deleted: getSelectionText({
|
|
7420
7418
|
lines
|
|
7421
7419
|
}, selection),
|
|
7422
|
-
|
|
7420
|
+
end: end,
|
|
7421
|
+
inserted: sortedSelectionLines,
|
|
7422
|
+
origin,
|
|
7423
|
+
start: start
|
|
7423
7424
|
});
|
|
7424
7425
|
}
|
|
7425
7426
|
return changes;
|
|
@@ -7437,10 +7438,10 @@ const sortLinesAscending = editor => {
|
|
|
7437
7438
|
|
|
7438
7439
|
const executeTabCompletionProvider = async (editor, offset) => {
|
|
7439
7440
|
return execute({
|
|
7441
|
+
args: [offset],
|
|
7440
7442
|
editor,
|
|
7441
7443
|
event: OnTabCompletion,
|
|
7442
7444
|
method: TabCompletionExecuteTabCompletionProvider,
|
|
7443
|
-
args: [offset],
|
|
7444
7445
|
noProviderFoundMessage: 'No tab completion provider found',
|
|
7445
7446
|
noProviderFoundResult: undefined
|
|
7446
7447
|
});
|
|
@@ -7477,17 +7478,17 @@ const getSnippetChanges = (lines, selections, snippet) => {
|
|
|
7477
7478
|
const insertedLinesHere = [insertedLines[0], ...insertedLines.slice(1).map(line => indent + line)];
|
|
7478
7479
|
const deleted = [''];
|
|
7479
7480
|
changes.push({
|
|
7480
|
-
|
|
7481
|
-
rowIndex: selectionStartRow,
|
|
7482
|
-
columnIndex: selectionStartColumn - snippet.deleted
|
|
7483
|
-
},
|
|
7481
|
+
deleted,
|
|
7484
7482
|
end: {
|
|
7485
|
-
|
|
7486
|
-
|
|
7483
|
+
columnIndex: selectionEndColumn,
|
|
7484
|
+
rowIndex: selectionEndRow
|
|
7487
7485
|
},
|
|
7488
7486
|
inserted: insertedLinesHere,
|
|
7489
|
-
|
|
7490
|
-
|
|
7487
|
+
origin: EditorSnippet,
|
|
7488
|
+
start: {
|
|
7489
|
+
columnIndex: selectionStartColumn - snippet.deleted,
|
|
7490
|
+
rowIndex: selectionStartRow
|
|
7491
|
+
}
|
|
7491
7492
|
});
|
|
7492
7493
|
const lastInsertedLine = insertedLines.at(-1);
|
|
7493
7494
|
selectionChanges.push(selectionEndRow + insertedLines.length - deleted.length,
|
|
@@ -7504,34 +7505,34 @@ const getSnippetChanges = (lines, selections, snippet) => {
|
|
|
7504
7505
|
selectionChanges.push(selectionStartRow, cursorColumnIndex, selectionStartRow, cursorColumnIndex);
|
|
7505
7506
|
// @ts-ignore
|
|
7506
7507
|
changes.push({
|
|
7507
|
-
|
|
7508
|
-
rowIndex: selectionStartRow,
|
|
7509
|
-
columnIndex: selectionStartColumn - snippet.deleted
|
|
7510
|
-
},
|
|
7508
|
+
deleted: [''],
|
|
7511
7509
|
end: {
|
|
7512
|
-
|
|
7513
|
-
|
|
7510
|
+
columnIndex: selectionEndColumn,
|
|
7511
|
+
rowIndex: selectionEndRow
|
|
7514
7512
|
},
|
|
7515
7513
|
inserted: insertedLines,
|
|
7516
|
-
|
|
7517
|
-
|
|
7514
|
+
origin: EditorSnippet,
|
|
7515
|
+
start: {
|
|
7516
|
+
columnIndex: selectionStartColumn - snippet.deleted,
|
|
7517
|
+
rowIndex: selectionStartRow
|
|
7518
|
+
}
|
|
7518
7519
|
});
|
|
7519
7520
|
} else {
|
|
7520
7521
|
const inserted = line.replace('$0', '');
|
|
7521
7522
|
const cursorColumnIndex = selectionEndColumn + 2;
|
|
7522
7523
|
selectionChanges.push(selectionStartRow, cursorColumnIndex, selectionStartRow, cursorColumnIndex);
|
|
7523
7524
|
changes.push({
|
|
7524
|
-
|
|
7525
|
-
rowIndex: selectionStartRow,
|
|
7526
|
-
columnIndex: selectionStartColumn - snippet.deleted
|
|
7527
|
-
},
|
|
7525
|
+
deleted: [''],
|
|
7528
7526
|
end: {
|
|
7529
|
-
|
|
7530
|
-
|
|
7527
|
+
columnIndex: selectionEndColumn,
|
|
7528
|
+
rowIndex: selectionEndRow
|
|
7531
7529
|
},
|
|
7532
7530
|
inserted: [inserted],
|
|
7533
|
-
|
|
7534
|
-
|
|
7531
|
+
origin: EditorSnippet,
|
|
7532
|
+
start: {
|
|
7533
|
+
columnIndex: selectionStartColumn - snippet.deleted,
|
|
7534
|
+
rowIndex: selectionStartRow
|
|
7535
|
+
}
|
|
7535
7536
|
});
|
|
7536
7537
|
}
|
|
7537
7538
|
}
|
|
@@ -7636,58 +7637,58 @@ const getBlockCommentEdits = (editor, blockComment) => {
|
|
|
7636
7637
|
if (startColumnIndex !== -1 && endColumnIndex !== -1) {
|
|
7637
7638
|
if (startRowIndex === endRowIndex) {
|
|
7638
7639
|
const change1 = {
|
|
7639
|
-
|
|
7640
|
-
rowIndex,
|
|
7641
|
-
columnIndex: startColumnIndex
|
|
7642
|
-
},
|
|
7640
|
+
deleted: [blockCommentStart],
|
|
7643
7641
|
end: {
|
|
7644
|
-
|
|
7645
|
-
|
|
7642
|
+
columnIndex: startColumnIndex + blockCommentStart.length,
|
|
7643
|
+
rowIndex
|
|
7646
7644
|
},
|
|
7647
7645
|
inserted: [],
|
|
7648
|
-
|
|
7649
|
-
|
|
7646
|
+
origin: ToggleBlockComment$1,
|
|
7647
|
+
start: {
|
|
7648
|
+
columnIndex: startColumnIndex,
|
|
7649
|
+
rowIndex
|
|
7650
|
+
}
|
|
7650
7651
|
};
|
|
7651
7652
|
const change2 = {
|
|
7652
|
-
|
|
7653
|
-
rowIndex,
|
|
7654
|
-
columnIndex: endColumnIndex - blockCommentStart.length
|
|
7655
|
-
},
|
|
7653
|
+
deleted: [blockCommentEnd],
|
|
7656
7654
|
end: {
|
|
7657
|
-
|
|
7658
|
-
|
|
7655
|
+
columnIndex: endColumnIndex - blockCommentStart.length + blockCommentEnd.length,
|
|
7656
|
+
rowIndex
|
|
7659
7657
|
},
|
|
7660
7658
|
inserted: [],
|
|
7661
|
-
|
|
7662
|
-
|
|
7659
|
+
origin: ToggleBlockComment$1,
|
|
7660
|
+
start: {
|
|
7661
|
+
columnIndex: endColumnIndex - blockCommentStart.length,
|
|
7662
|
+
rowIndex
|
|
7663
|
+
}
|
|
7663
7664
|
};
|
|
7664
7665
|
changes.push(change1, change2);
|
|
7665
7666
|
} else {
|
|
7666
7667
|
const change1 = {
|
|
7667
|
-
|
|
7668
|
-
rowIndex: startRowIndex,
|
|
7669
|
-
columnIndex: startColumnIndex
|
|
7670
|
-
},
|
|
7668
|
+
deleted: [blockCommentStart],
|
|
7671
7669
|
end: {
|
|
7672
|
-
|
|
7673
|
-
|
|
7670
|
+
columnIndex: startColumnIndex + blockCommentStart.length,
|
|
7671
|
+
rowIndex: startRowIndex
|
|
7674
7672
|
},
|
|
7675
7673
|
inserted: [],
|
|
7676
|
-
|
|
7677
|
-
|
|
7674
|
+
origin: ToggleBlockComment$1,
|
|
7675
|
+
start: {
|
|
7676
|
+
columnIndex: startColumnIndex,
|
|
7677
|
+
rowIndex: startRowIndex
|
|
7678
|
+
}
|
|
7678
7679
|
};
|
|
7679
7680
|
const change2 = {
|
|
7680
|
-
|
|
7681
|
-
rowIndex: endRowIndex,
|
|
7682
|
-
columnIndex: endColumnIndex
|
|
7683
|
-
},
|
|
7681
|
+
deleted: [blockCommentEnd],
|
|
7684
7682
|
end: {
|
|
7685
|
-
|
|
7686
|
-
|
|
7683
|
+
columnIndex: endColumnIndex + blockCommentEnd.length,
|
|
7684
|
+
rowIndex: endRowIndex
|
|
7687
7685
|
},
|
|
7688
7686
|
inserted: [],
|
|
7689
|
-
|
|
7690
|
-
|
|
7687
|
+
origin: ToggleBlockComment$1,
|
|
7688
|
+
start: {
|
|
7689
|
+
columnIndex: endColumnIndex,
|
|
7690
|
+
rowIndex: endRowIndex
|
|
7691
|
+
}
|
|
7691
7692
|
};
|
|
7692
7693
|
changes.push(change1, change2);
|
|
7693
7694
|
|
|
@@ -7716,30 +7717,30 @@ const getBlockCommentEdits = (editor, blockComment) => {
|
|
|
7716
7717
|
endColumnIndex -= whitespaceAtEnd[0].length;
|
|
7717
7718
|
}
|
|
7718
7719
|
const change1 = {
|
|
7719
|
-
|
|
7720
|
-
rowIndex,
|
|
7721
|
-
columnIndex: startColumnIndex
|
|
7722
|
-
},
|
|
7720
|
+
deleted: [],
|
|
7723
7721
|
end: {
|
|
7724
|
-
|
|
7725
|
-
|
|
7722
|
+
columnIndex: startColumnIndex,
|
|
7723
|
+
rowIndex
|
|
7726
7724
|
},
|
|
7727
7725
|
inserted: [blockCommentStart],
|
|
7728
|
-
|
|
7729
|
-
|
|
7726
|
+
origin: ToggleBlockComment$1,
|
|
7727
|
+
start: {
|
|
7728
|
+
columnIndex: startColumnIndex,
|
|
7729
|
+
rowIndex
|
|
7730
|
+
}
|
|
7730
7731
|
};
|
|
7731
7732
|
const change2 = {
|
|
7732
|
-
|
|
7733
|
-
rowIndex,
|
|
7734
|
-
columnIndex: endColumnIndex + blockCommentStart.length
|
|
7735
|
-
},
|
|
7733
|
+
deleted: [],
|
|
7736
7734
|
end: {
|
|
7737
|
-
|
|
7738
|
-
|
|
7735
|
+
columnIndex: endColumnIndex + blockCommentStart.length,
|
|
7736
|
+
rowIndex
|
|
7739
7737
|
},
|
|
7740
7738
|
inserted: [blockCommentEnd],
|
|
7741
|
-
|
|
7742
|
-
|
|
7739
|
+
origin: ToggleBlockComment$1,
|
|
7740
|
+
start: {
|
|
7741
|
+
columnIndex: endColumnIndex + blockCommentStart.length,
|
|
7742
|
+
rowIndex
|
|
7743
|
+
}
|
|
7743
7744
|
};
|
|
7744
7745
|
changes.push(change1, change2);
|
|
7745
7746
|
// TextDocument.setLine(
|
|
@@ -7813,45 +7814,45 @@ const getLineCommentEdit = (rowIndex, line, lineComment) => {
|
|
|
7813
7814
|
// TODO also check tab character
|
|
7814
7815
|
if (line[index + lineComment.length] === ' ') {
|
|
7815
7816
|
return {
|
|
7816
|
-
inserted: [''],
|
|
7817
7817
|
deleted: [lineComment + ' '],
|
|
7818
|
-
start: {
|
|
7819
|
-
rowIndex,
|
|
7820
|
-
columnIndex: index
|
|
7821
|
-
},
|
|
7822
7818
|
end: {
|
|
7823
|
-
|
|
7824
|
-
|
|
7819
|
+
columnIndex: index + lineComment.length + 1,
|
|
7820
|
+
rowIndex
|
|
7825
7821
|
},
|
|
7826
|
-
|
|
7822
|
+
inserted: [''],
|
|
7823
|
+
origin: LineComment,
|
|
7824
|
+
start: {
|
|
7825
|
+
columnIndex: index,
|
|
7826
|
+
rowIndex
|
|
7827
|
+
}
|
|
7827
7828
|
};
|
|
7828
7829
|
}
|
|
7829
7830
|
return {
|
|
7830
|
-
inserted: [''],
|
|
7831
7831
|
deleted: [lineComment],
|
|
7832
|
-
start: {
|
|
7833
|
-
rowIndex,
|
|
7834
|
-
columnIndex: index
|
|
7835
|
-
},
|
|
7836
7832
|
end: {
|
|
7837
|
-
|
|
7838
|
-
|
|
7833
|
+
columnIndex: index + lineComment.length,
|
|
7834
|
+
rowIndex
|
|
7839
7835
|
},
|
|
7840
|
-
|
|
7836
|
+
inserted: [''],
|
|
7837
|
+
origin: LineComment,
|
|
7838
|
+
start: {
|
|
7839
|
+
columnIndex: index,
|
|
7840
|
+
rowIndex
|
|
7841
|
+
}
|
|
7841
7842
|
};
|
|
7842
7843
|
}
|
|
7843
7844
|
return {
|
|
7844
|
-
inserted: [`${lineComment} `],
|
|
7845
7845
|
deleted: [],
|
|
7846
|
-
start: {
|
|
7847
|
-
rowIndex,
|
|
7848
|
-
columnIndex: index
|
|
7849
|
-
},
|
|
7850
7846
|
end: {
|
|
7851
|
-
|
|
7852
|
-
|
|
7847
|
+
columnIndex: index,
|
|
7848
|
+
rowIndex
|
|
7853
7849
|
},
|
|
7854
|
-
|
|
7850
|
+
inserted: [`${lineComment} `],
|
|
7851
|
+
origin: LineComment,
|
|
7852
|
+
start: {
|
|
7853
|
+
columnIndex: index,
|
|
7854
|
+
rowIndex
|
|
7855
|
+
}
|
|
7855
7856
|
};
|
|
7856
7857
|
};
|
|
7857
7858
|
|
|
@@ -7989,11 +7990,10 @@ const typeWithAutoClosing = async (editor, text) => {
|
|
|
7989
7990
|
isAutoClosingTagsEnabled
|
|
7990
7991
|
} = editor;
|
|
7991
7992
|
switch (text) {
|
|
7992
|
-
case
|
|
7993
|
-
case
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
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);
|
|
7997
7997
|
}
|
|
7998
7998
|
break;
|
|
7999
7999
|
case CurlyClose:
|
|
@@ -8003,19 +8003,20 @@ const typeWithAutoClosing = async (editor, text) => {
|
|
|
8003
8003
|
return typeWithAutoClosingEndBracket(editor, text);
|
|
8004
8004
|
}
|
|
8005
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:
|
|
8006
8014
|
case DoubleQuote:
|
|
8007
8015
|
case SingleQuote:
|
|
8008
|
-
case BackTick:
|
|
8009
8016
|
if (isAutoClosingQuotesEnabled) {
|
|
8010
8017
|
return typeWithAutoClosingQuote(editor, text);
|
|
8011
8018
|
}
|
|
8012
8019
|
break;
|
|
8013
|
-
// case AutoClosing.ClosingAngleBracket: // TODO support auto closing when typing closing angle bracket of start tag
|
|
8014
|
-
case Slash:
|
|
8015
|
-
if (isAutoClosingTagsEnabled) {
|
|
8016
|
-
return typeWithAutoClosingTag(editor, text);
|
|
8017
|
-
}
|
|
8018
|
-
break;
|
|
8019
8020
|
}
|
|
8020
8021
|
const newEditor = type(editor, text);
|
|
8021
8022
|
// const extraCommands: any[] = []
|
|
@@ -8045,13 +8046,13 @@ const typeWithAutoClosing = async (editor, text) => {
|
|
|
8045
8046
|
const inverseChange = edit => {
|
|
8046
8047
|
const endColumnIndex = edit.end.columnIndex - edit.deleted[0].length + edit.inserted[0].length;
|
|
8047
8048
|
return {
|
|
8048
|
-
|
|
8049
|
+
deleted: edit.inserted,
|
|
8049
8050
|
end: {
|
|
8050
|
-
|
|
8051
|
-
|
|
8051
|
+
columnIndex: endColumnIndex,
|
|
8052
|
+
rowIndex: edit.end.rowIndex
|
|
8052
8053
|
},
|
|
8053
8054
|
inserted: edit.deleted,
|
|
8054
|
-
|
|
8055
|
+
start: edit.start
|
|
8055
8056
|
};
|
|
8056
8057
|
};
|
|
8057
8058
|
|
|
@@ -8191,11 +8192,11 @@ const editorUnindent = editor => {
|
|
|
8191
8192
|
const isFunctional = widgetId => {
|
|
8192
8193
|
switch (widgetId) {
|
|
8193
8194
|
case ColorPicker$1:
|
|
8194
|
-
case Rename$1:
|
|
8195
8195
|
case Completion:
|
|
8196
8196
|
case Find:
|
|
8197
|
-
case SourceAction$1:
|
|
8198
8197
|
case Hover:
|
|
8198
|
+
case Rename$1:
|
|
8199
|
+
case SourceAction$1:
|
|
8199
8200
|
return true;
|
|
8200
8201
|
default:
|
|
8201
8202
|
return false;
|
|
@@ -8241,12 +8242,12 @@ const getWidgetInvoke = widgetId => {
|
|
|
8241
8242
|
return invoke$4;
|
|
8242
8243
|
case Find:
|
|
8243
8244
|
return invoke$3;
|
|
8245
|
+
case Hover:
|
|
8246
|
+
return invoke$2;
|
|
8244
8247
|
case Rename$1:
|
|
8245
8248
|
return invoke$5;
|
|
8246
8249
|
case SourceAction$1:
|
|
8247
8250
|
return invoke$1;
|
|
8248
|
-
case Hover:
|
|
8249
|
-
return invoke$2;
|
|
8250
8251
|
default:
|
|
8251
8252
|
return undefined;
|
|
8252
8253
|
}
|
|
@@ -8265,8 +8266,8 @@ const updateWidget = (editor, widgetId, newState) => {
|
|
|
8265
8266
|
const childWidget = editor.widgets[childIndex];
|
|
8266
8267
|
const newWidget = {
|
|
8267
8268
|
...childWidget,
|
|
8268
|
-
|
|
8269
|
-
newState
|
|
8269
|
+
newState,
|
|
8270
|
+
oldState: childWidget.newState
|
|
8270
8271
|
};
|
|
8271
8272
|
const newWidgets = [...editor.widgets.slice(0, childIndex), newWidget, ...editor.widgets.slice(childIndex + 1)];
|
|
8272
8273
|
return {
|
|
@@ -8353,6 +8354,8 @@ const remove$7 = widget => {
|
|
|
8353
8354
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
8354
8355
|
};
|
|
8355
8356
|
const {
|
|
8357
|
+
close: close$4,
|
|
8358
|
+
closeDetails: closeDetails$1,
|
|
8356
8359
|
focusFirst: focusFirst$1,
|
|
8357
8360
|
focusIndex: focusIndex$2,
|
|
8358
8361
|
focusLast: focusLast$1,
|
|
@@ -8362,14 +8365,12 @@ const {
|
|
|
8362
8365
|
handleEditorClick,
|
|
8363
8366
|
handleEditorDeleteLeft: handleEditorDeleteLeft$1,
|
|
8364
8367
|
handleEditorType: handleEditorType$1,
|
|
8368
|
+
handlePointerDown,
|
|
8369
|
+
handleWheel: handleWheel$1,
|
|
8365
8370
|
openDetails,
|
|
8366
8371
|
selectCurrent: selectCurrent$1,
|
|
8367
8372
|
selectIndex: selectIndex$1,
|
|
8368
|
-
toggleDetails: toggleDetails$1
|
|
8369
|
-
closeDetails: closeDetails$1,
|
|
8370
|
-
handleWheel: handleWheel$1,
|
|
8371
|
-
close: close$4,
|
|
8372
|
-
handlePointerDown
|
|
8373
|
+
toggleDetails: toggleDetails$1
|
|
8373
8374
|
} = createFns(['handleEditorType', 'focusFirst', 'focusNext', 'focusPrevious', 'focusLast', 'handleEditorDeleteLeft', 'openDetails', 'focusIndex', 'handleEditorBlur', 'handleEditorClick', 'openDetails', 'selectCurrent', 'selectIndex', 'toggleDetails', 'closeDetails', 'handleWheel', 'close', 'handlePointerDown'], 'Completions', Completion);
|
|
8374
8375
|
|
|
8375
8376
|
const EditorCompletionWidget = {
|
|
@@ -8429,8 +8430,10 @@ const {
|
|
|
8429
8430
|
focusCloseButton,
|
|
8430
8431
|
focusFind,
|
|
8431
8432
|
focusNext: focusNext$2,
|
|
8433
|
+
focusNextElement,
|
|
8432
8434
|
focusNextMatchButton,
|
|
8433
8435
|
focusPrevious: focusPrevious$1,
|
|
8436
|
+
focusPreviousElement,
|
|
8434
8437
|
focusPreviousMatchButton,
|
|
8435
8438
|
focusReplace,
|
|
8436
8439
|
focusReplaceAllButton,
|
|
@@ -8447,11 +8450,9 @@ const {
|
|
|
8447
8450
|
replaceAll,
|
|
8448
8451
|
toggleMatchCase,
|
|
8449
8452
|
toggleMatchWholeWord,
|
|
8453
|
+
togglePreserveCase,
|
|
8450
8454
|
toggleReplace,
|
|
8451
|
-
toggleUseRegularExpression
|
|
8452
|
-
focusNextElement,
|
|
8453
|
-
focusPreviousElement,
|
|
8454
|
-
togglePreserveCase
|
|
8455
|
+
toggleUseRegularExpression
|
|
8455
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);
|
|
8456
8457
|
|
|
8457
8458
|
const EditorFindWidget = {
|
|
@@ -8492,10 +8493,10 @@ const executeHoverProvider = async (editor, offset) => {
|
|
|
8492
8493
|
object(editor);
|
|
8493
8494
|
number(offset);
|
|
8494
8495
|
return execute({
|
|
8495
|
-
|
|
8496
|
+
args: [offset],
|
|
8496
8497
|
editor,
|
|
8498
|
+
event: OnHover,
|
|
8497
8499
|
method: HoverExecute,
|
|
8498
|
-
args: [offset],
|
|
8499
8500
|
noProviderFoundMessage: 'No hover provider found'
|
|
8500
8501
|
});
|
|
8501
8502
|
};
|
|
@@ -8535,9 +8536,9 @@ const getLineInfo = (line, tokens, TokenMap) => {
|
|
|
8535
8536
|
const getLineInfos = (lines, tokenizer, languageId) => {
|
|
8536
8537
|
const lineInfos = [];
|
|
8537
8538
|
const {
|
|
8538
|
-
tokenizeLine,
|
|
8539
|
-
initialLineState,
|
|
8540
8539
|
hasArrayReturn,
|
|
8540
|
+
initialLineState,
|
|
8541
|
+
tokenizeLine,
|
|
8541
8542
|
TokenMap
|
|
8542
8543
|
} = tokenizer;
|
|
8543
8544
|
let currentLineState = getInitialLineState(initialLineState);
|
|
@@ -8568,8 +8569,8 @@ const getHoverPosition = (position, selections) => {
|
|
|
8568
8569
|
const rowIndex = selections[0];
|
|
8569
8570
|
const columnIndex = selections[1];
|
|
8570
8571
|
return {
|
|
8571
|
-
|
|
8572
|
-
|
|
8572
|
+
columnIndex,
|
|
8573
|
+
rowIndex
|
|
8573
8574
|
};
|
|
8574
8575
|
};
|
|
8575
8576
|
const getMatchingDiagnostics = (diagnostics, rowIndex, columnIndex) => {
|
|
@@ -8598,8 +8599,8 @@ const getEditorHoverInfo = async (editorUid, position) => {
|
|
|
8598
8599
|
selections
|
|
8599
8600
|
} = editor;
|
|
8600
8601
|
const {
|
|
8601
|
-
|
|
8602
|
-
|
|
8602
|
+
columnIndex,
|
|
8603
|
+
rowIndex
|
|
8603
8604
|
} = getHoverPosition(position, selections);
|
|
8604
8605
|
const offset = offsetAt(editor, rowIndex, columnIndex);
|
|
8605
8606
|
const hover = await getHover(editor, offset);
|
|
@@ -8608,8 +8609,8 @@ const getEditorHoverInfo = async (editorUid, position) => {
|
|
|
8608
8609
|
}
|
|
8609
8610
|
const {
|
|
8610
8611
|
displayString,
|
|
8611
|
-
|
|
8612
|
-
|
|
8612
|
+
displayStringLanguageId,
|
|
8613
|
+
documentation
|
|
8613
8614
|
} = hover;
|
|
8614
8615
|
const tokenizerPath = '';
|
|
8615
8616
|
const lineInfos = await tokenizeCodeBlock(displayString, displayStringLanguageId || fallbackDisplayStringLanguageId, tokenizerPath);
|
|
@@ -8623,11 +8624,11 @@ const getEditorHoverInfo = async (editorUid, position) => {
|
|
|
8623
8624
|
const diagnostics = editor.diagnostics || [];
|
|
8624
8625
|
const matchingDiagnostics = getMatchingDiagnostics(diagnostics, rowIndex);
|
|
8625
8626
|
return {
|
|
8626
|
-
lineInfos,
|
|
8627
8627
|
documentation,
|
|
8628
|
+
lineInfos,
|
|
8629
|
+
matchingDiagnostics,
|
|
8628
8630
|
x,
|
|
8629
|
-
y
|
|
8630
|
-
matchingDiagnostics
|
|
8631
|
+
y
|
|
8631
8632
|
};
|
|
8632
8633
|
};
|
|
8633
8634
|
|
|
@@ -8637,19 +8638,19 @@ const loadContent = async (editorUid, state, position) => {
|
|
|
8637
8638
|
return state;
|
|
8638
8639
|
}
|
|
8639
8640
|
const {
|
|
8640
|
-
lineInfos,
|
|
8641
8641
|
documentation,
|
|
8642
|
+
lineInfos,
|
|
8643
|
+
matchingDiagnostics,
|
|
8642
8644
|
x,
|
|
8643
|
-
y
|
|
8644
|
-
matchingDiagnostics
|
|
8645
|
+
y
|
|
8645
8646
|
} = hoverInfo;
|
|
8646
8647
|
return {
|
|
8647
8648
|
...state,
|
|
8648
|
-
|
|
8649
|
+
diagnostics: matchingDiagnostics,
|
|
8649
8650
|
documentation,
|
|
8651
|
+
lineInfos,
|
|
8650
8652
|
x,
|
|
8651
|
-
y
|
|
8652
|
-
diagnostics: matchingDiagnostics
|
|
8653
|
+
y
|
|
8653
8654
|
};
|
|
8654
8655
|
};
|
|
8655
8656
|
const handleSashPointerDown = (state, eventX, eventY) => {
|
|
@@ -8713,25 +8714,25 @@ const Text = 12;
|
|
|
8713
8714
|
|
|
8714
8715
|
const text = data => {
|
|
8715
8716
|
return {
|
|
8716
|
-
|
|
8717
|
+
childCount: 0,
|
|
8717
8718
|
text: data,
|
|
8718
|
-
|
|
8719
|
+
type: Text
|
|
8719
8720
|
};
|
|
8720
8721
|
};
|
|
8721
8722
|
|
|
8722
8723
|
const getLineInfoVirtualDom = lineInfo => {
|
|
8723
8724
|
const dom = [{
|
|
8724
|
-
|
|
8725
|
+
childCount: lineInfo.length / 2,
|
|
8725
8726
|
className: HoverEditorRow,
|
|
8726
|
-
|
|
8727
|
+
type: Div
|
|
8727
8728
|
}];
|
|
8728
8729
|
for (let i = 0; i < lineInfo.length; i += 2) {
|
|
8729
8730
|
const tokenText = lineInfo[i];
|
|
8730
8731
|
const tokenClass = lineInfo[i + 1];
|
|
8731
8732
|
dom.push({
|
|
8732
|
-
|
|
8733
|
+
childCount: 1,
|
|
8733
8734
|
className: tokenClass,
|
|
8734
|
-
|
|
8735
|
+
type: Span
|
|
8735
8736
|
}, text(tokenText));
|
|
8736
8737
|
}
|
|
8737
8738
|
return dom;
|
|
@@ -8742,14 +8743,14 @@ const getLineInfosVirtualDom = lineInfos => {
|
|
|
8742
8743
|
};
|
|
8743
8744
|
|
|
8744
8745
|
const hoverProblemMessage = {
|
|
8745
|
-
|
|
8746
|
+
childCount: 1,
|
|
8746
8747
|
className: HoverProblemMessage,
|
|
8747
|
-
|
|
8748
|
+
type: Span
|
|
8748
8749
|
};
|
|
8749
8750
|
const hoverProblemDetail = {
|
|
8750
|
-
|
|
8751
|
+
childCount: 1,
|
|
8751
8752
|
className: HoverProblemDetail,
|
|
8752
|
-
|
|
8753
|
+
type: Span
|
|
8753
8754
|
};
|
|
8754
8755
|
const getChildCount = (lineInfos, documentation, diagnostics) => {
|
|
8755
8756
|
return lineInfos.length + documentation ? 1 : 0 + (diagnostics && diagnostics.length > 0) ? 1 : 0;
|
|
@@ -8757,15 +8758,15 @@ const getChildCount = (lineInfos, documentation, diagnostics) => {
|
|
|
8757
8758
|
const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
|
|
8758
8759
|
const dom = [];
|
|
8759
8760
|
dom.push({
|
|
8760
|
-
|
|
8761
|
+
childCount: getChildCount(lineInfos, documentation, diagnostics) + 1,
|
|
8761
8762
|
className: 'Viewlet EditorHover',
|
|
8762
|
-
|
|
8763
|
+
type: Div
|
|
8763
8764
|
});
|
|
8764
8765
|
if (diagnostics && diagnostics.length > 0) {
|
|
8765
8766
|
dom.push({
|
|
8766
|
-
|
|
8767
|
+
childCount: diagnostics.length * 2,
|
|
8767
8768
|
className: `${HoverDisplayString} ${HoverProblem}`,
|
|
8768
|
-
|
|
8769
|
+
type: Div
|
|
8769
8770
|
});
|
|
8770
8771
|
for (const diagnostic of diagnostics) {
|
|
8771
8772
|
dom.push(hoverProblemMessage, text(diagnostic.message), hoverProblemDetail, text(`${diagnostic.source} (${diagnostic.code})`));
|
|
@@ -8774,48 +8775,48 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
|
|
|
8774
8775
|
if (lineInfos.length > 0) {
|
|
8775
8776
|
const lineInfosDom = getLineInfosVirtualDom(lineInfos);
|
|
8776
8777
|
dom.push({
|
|
8777
|
-
|
|
8778
|
+
childCount: lineInfos.length,
|
|
8778
8779
|
className: HoverDisplayString,
|
|
8779
|
-
|
|
8780
|
+
type: Div
|
|
8780
8781
|
}, ...lineInfosDom);
|
|
8781
8782
|
}
|
|
8782
8783
|
if (documentation) {
|
|
8783
8784
|
dom.push({
|
|
8784
|
-
|
|
8785
|
+
childCount: 1,
|
|
8785
8786
|
className: HoverDocumentation,
|
|
8786
|
-
|
|
8787
|
+
type: Div
|
|
8787
8788
|
}, text(documentation));
|
|
8788
8789
|
}
|
|
8789
8790
|
dom.push({
|
|
8790
|
-
type: Div,
|
|
8791
|
-
className: 'Sash SashVertical SashResize',
|
|
8792
8791
|
childCount: 0,
|
|
8793
|
-
|
|
8792
|
+
className: 'Sash SashVertical SashResize',
|
|
8793
|
+
onPointerDown: HandleSashPointerDown,
|
|
8794
|
+
type: Div
|
|
8794
8795
|
});
|
|
8795
8796
|
return dom;
|
|
8796
8797
|
};
|
|
8797
8798
|
|
|
8798
8799
|
const renderHoverDom = {
|
|
8799
|
-
isEqual(oldState, newState) {
|
|
8800
|
-
return oldState.lineInfos === newState.lineInfos && oldState.documentation === newState.documentation && oldState.diagnostics === newState.diagnostics;
|
|
8801
|
-
},
|
|
8802
8800
|
apply(oldState, newState) {
|
|
8803
8801
|
const dom = getHoverVirtualDom(newState.lineInfos, newState.documentation, newState.diagnostics);
|
|
8804
8802
|
return [/* method */SetDom2, dom];
|
|
8803
|
+
},
|
|
8804
|
+
isEqual(oldState, newState) {
|
|
8805
|
+
return oldState.lineInfos === newState.lineInfos && oldState.documentation === newState.documentation && oldState.diagnostics === newState.diagnostics;
|
|
8805
8806
|
}
|
|
8806
8807
|
};
|
|
8807
8808
|
const renderBounds$2 = {
|
|
8808
|
-
isEqual(oldState, newState) {
|
|
8809
|
-
return oldState.x === newState.x && oldState.y === newState.y;
|
|
8810
|
-
},
|
|
8811
8809
|
apply(oldState, newState) {
|
|
8812
8810
|
const {
|
|
8813
|
-
|
|
8814
|
-
y,
|
|
8811
|
+
height,
|
|
8815
8812
|
width,
|
|
8816
|
-
|
|
8813
|
+
x,
|
|
8814
|
+
y
|
|
8817
8815
|
} = newState;
|
|
8818
8816
|
return [SetBounds, x, y, width, height];
|
|
8817
|
+
},
|
|
8818
|
+
isEqual(oldState, newState) {
|
|
8819
|
+
return oldState.x === newState.x && oldState.y === newState.y;
|
|
8819
8820
|
}
|
|
8820
8821
|
};
|
|
8821
8822
|
const render$9 = [renderHoverDom, renderBounds$2];
|
|
@@ -8851,9 +8852,9 @@ const remove$5 = widget => {
|
|
|
8851
8852
|
return [['Viewlet.dispose', widget.newState.uid]];
|
|
8852
8853
|
};
|
|
8853
8854
|
const {
|
|
8854
|
-
|
|
8855
|
+
accept,
|
|
8855
8856
|
close: close$2,
|
|
8856
|
-
|
|
8857
|
+
handleInput
|
|
8857
8858
|
} = createFns(['handleInput', 'close', 'accept'], 'Rename', Rename$1);
|
|
8858
8859
|
|
|
8859
8860
|
const EditorRenameWidget = {
|
|
@@ -8909,18 +8910,18 @@ const add$4 = widget => {
|
|
|
8909
8910
|
};
|
|
8910
8911
|
const remove$4 = removeWidget$1;
|
|
8911
8912
|
const {
|
|
8913
|
+
close: close$1,
|
|
8914
|
+
closeDetails,
|
|
8912
8915
|
focusFirst,
|
|
8913
8916
|
focusIndex,
|
|
8914
8917
|
focusLast,
|
|
8915
8918
|
focusNext,
|
|
8916
8919
|
focusPrevious,
|
|
8920
|
+
handleWheel,
|
|
8917
8921
|
selectCurrent,
|
|
8918
8922
|
selectIndex,
|
|
8919
8923
|
selectItem,
|
|
8920
|
-
toggleDetails
|
|
8921
|
-
closeDetails,
|
|
8922
|
-
handleWheel,
|
|
8923
|
-
close: close$1
|
|
8924
|
+
toggleDetails
|
|
8924
8925
|
} = createFns(['focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusPrevious', 'selectCurrent', 'selectIndex', 'selectItem', 'toggleDetails', 'closeDetails', 'handleWheel', 'close'], 'SourceActions', SourceAction$1);
|
|
8925
8926
|
|
|
8926
8927
|
const EditorSourceActionWidget = {
|
|
@@ -9109,8 +9110,8 @@ const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocu
|
|
|
9109
9110
|
const newWidgets = [...widgets.slice(0, index), ...widgets.slice(index + 1)];
|
|
9110
9111
|
const newEditor = {
|
|
9111
9112
|
...editor,
|
|
9112
|
-
|
|
9113
|
-
|
|
9113
|
+
focused: true,
|
|
9114
|
+
widgets: newWidgets
|
|
9114
9115
|
};
|
|
9115
9116
|
set$6(editorUid, editor, newEditor);
|
|
9116
9117
|
await setFocus(FocusEditorText);
|
|
@@ -9197,356 +9198,356 @@ const ensure = async (fontName, fontUrl) => {
|
|
|
9197
9198
|
|
|
9198
9199
|
const getKeyBindings = () => {
|
|
9199
9200
|
return [{
|
|
9200
|
-
key: Escape,
|
|
9201
9201
|
command: 'Editor.closeSourceAction',
|
|
9202
|
+
key: Escape,
|
|
9202
9203
|
when: FocusSourceActions
|
|
9203
9204
|
}, {
|
|
9204
|
-
key: DownArrow,
|
|
9205
9205
|
command: 'EditorSourceActions.focusNext',
|
|
9206
|
+
key: DownArrow,
|
|
9206
9207
|
when: FocusSourceActions
|
|
9207
9208
|
}, {
|
|
9208
|
-
key: UpArrow,
|
|
9209
9209
|
command: 'EditorSourceActions.focusPrevious',
|
|
9210
|
+
key: UpArrow,
|
|
9210
9211
|
when: FocusSourceActions
|
|
9211
9212
|
}, {
|
|
9212
|
-
key: Home,
|
|
9213
9213
|
command: 'EditorSourceActions.focusFirst',
|
|
9214
|
+
key: Home,
|
|
9214
9215
|
when: FocusSourceActions
|
|
9215
9216
|
}, {
|
|
9216
|
-
key: End,
|
|
9217
9217
|
command: 'EditorSourceActions.focusLast',
|
|
9218
|
+
key: End,
|
|
9218
9219
|
when: FocusSourceActions
|
|
9219
9220
|
}, {
|
|
9220
|
-
key: Enter,
|
|
9221
9221
|
command: 'EditorSourceActions.selectCurrent',
|
|
9222
|
+
key: Enter,
|
|
9222
9223
|
when: FocusSourceActions
|
|
9223
9224
|
}, {
|
|
9224
|
-
key: Enter,
|
|
9225
9225
|
command: 'FindWidget.focusNext',
|
|
9226
|
+
key: Enter,
|
|
9226
9227
|
when: FocusFindWidget
|
|
9227
9228
|
}, {
|
|
9228
|
-
key: CtrlCmd | KeyF,
|
|
9229
9229
|
command: 'FindWidget.preventDefaultBrowserFind',
|
|
9230
|
+
key: CtrlCmd | KeyF,
|
|
9230
9231
|
when: FocusFindWidget
|
|
9231
9232
|
}, {
|
|
9232
|
-
key: Shift | F4,
|
|
9233
9233
|
command: 'FindWidget.focusPrevious',
|
|
9234
|
+
key: Shift | F4,
|
|
9234
9235
|
when: FocusFindWidget
|
|
9235
9236
|
}, {
|
|
9236
|
-
key: F4,
|
|
9237
9237
|
command: 'FindWidget.focusNext',
|
|
9238
|
+
key: F4,
|
|
9238
9239
|
when: FocusFindWidget
|
|
9239
9240
|
}, {
|
|
9240
|
-
key: Shift | Tab$1,
|
|
9241
9241
|
command: 'FindWidget.focusToggleReplace',
|
|
9242
|
+
key: Shift | Tab$1,
|
|
9242
9243
|
when: FocusFindWidget
|
|
9243
9244
|
}, {
|
|
9244
|
-
key: Tab$1,
|
|
9245
9245
|
command: 'FindWidget.focusReplace',
|
|
9246
|
+
key: Tab$1,
|
|
9246
9247
|
when: FocusFindWidget
|
|
9247
9248
|
}, {
|
|
9248
|
-
key: Tab$1,
|
|
9249
9249
|
command: 'FindWidget.focusPreviousMatchButton',
|
|
9250
|
+
key: Tab$1,
|
|
9250
9251
|
when: FocusFindWidgetReplace
|
|
9251
9252
|
}, {
|
|
9252
|
-
key: Alt$1 | CtrlCmd | Enter,
|
|
9253
9253
|
command: 'FindWidget.replaceAll',
|
|
9254
|
+
key: Alt$1 | CtrlCmd | Enter,
|
|
9254
9255
|
when: FocusFindWidgetReplace
|
|
9255
9256
|
}, {
|
|
9256
|
-
key: Tab$1,
|
|
9257
9257
|
command: 'FindWidget.focusNextMatchButton',
|
|
9258
|
+
key: Tab$1,
|
|
9258
9259
|
when: FocusFindWidgetPreviousMatchButton
|
|
9259
9260
|
}, {
|
|
9260
|
-
key: Shift | Tab$1,
|
|
9261
9261
|
command: 'FindWidget.focusReplace',
|
|
9262
|
+
key: Shift | Tab$1,
|
|
9262
9263
|
when: FocusFindWidgetPreviousMatchButton
|
|
9263
9264
|
}, {
|
|
9264
|
-
key: Shift | Tab$1,
|
|
9265
9265
|
command: 'FindWidget.focusPreviousMatchButton',
|
|
9266
|
+
key: Shift | Tab$1,
|
|
9266
9267
|
when: FocusFindWidgetNextMatchButton
|
|
9267
9268
|
}, {
|
|
9268
|
-
key: Tab$1,
|
|
9269
9269
|
command: 'FindWidget.focusCloseButton',
|
|
9270
|
+
key: Tab$1,
|
|
9270
9271
|
when: FocusFindWidgetNextMatchButton
|
|
9271
9272
|
}, {
|
|
9272
|
-
key: Shift | Tab$1,
|
|
9273
9273
|
command: 'FindWidget.focusNextMatchButton',
|
|
9274
|
+
key: Shift | Tab$1,
|
|
9274
9275
|
when: FocusFindWidgetCloseButton
|
|
9275
9276
|
}, {
|
|
9276
|
-
key: Tab$1,
|
|
9277
9277
|
command: 'FindWidget.focusReplaceButton',
|
|
9278
|
+
key: Tab$1,
|
|
9278
9279
|
when: FocusFindWidgetCloseButton
|
|
9279
9280
|
}, {
|
|
9280
|
-
key: Shift | Tab$1,
|
|
9281
9281
|
command: 'FindWidget.focusFind',
|
|
9282
|
+
key: Shift | Tab$1,
|
|
9282
9283
|
when: FocusFindWidgetReplace
|
|
9283
9284
|
}, {
|
|
9284
|
-
key: Tab$1,
|
|
9285
9285
|
command: 'FindWidget.focusReplaceAllButton',
|
|
9286
|
+
key: Tab$1,
|
|
9286
9287
|
when: FocusFindWidgetReplaceButton
|
|
9287
9288
|
}, {
|
|
9288
|
-
key: Shift | Tab$1,
|
|
9289
9289
|
command: 'FindWidget.focusCloseButton',
|
|
9290
|
+
key: Shift | Tab$1,
|
|
9290
9291
|
when: FocusFindWidgetReplaceButton
|
|
9291
9292
|
}, {
|
|
9292
|
-
key: Shift | Tab$1,
|
|
9293
9293
|
command: 'FindWidget.focusReplaceButton',
|
|
9294
|
+
key: Shift | Tab$1,
|
|
9294
9295
|
when: FocusFindWidgetReplaceAllButton
|
|
9295
9296
|
}, {
|
|
9296
|
-
key: DownArrow,
|
|
9297
9297
|
command: 'EditorCompletion.focusNext',
|
|
9298
|
+
key: DownArrow,
|
|
9298
9299
|
when: FocusEditorCompletions
|
|
9299
9300
|
}, {
|
|
9300
|
-
key: UpArrow,
|
|
9301
9301
|
command: 'EditorCompletion.focusPrevious',
|
|
9302
|
+
key: UpArrow,
|
|
9302
9303
|
when: FocusEditorCompletions
|
|
9303
9304
|
}, {
|
|
9304
|
-
key: Enter,
|
|
9305
9305
|
command: 'EditorCompletion.selectCurrent',
|
|
9306
|
+
key: Enter,
|
|
9306
9307
|
when: FocusEditorCompletions
|
|
9307
9308
|
}, {
|
|
9308
|
-
key: Escape,
|
|
9309
9309
|
command: 'EditorCompletion.close',
|
|
9310
|
+
key: Escape,
|
|
9310
9311
|
when: FocusEditorCompletions
|
|
9311
9312
|
}, {
|
|
9312
|
-
key: End,
|
|
9313
9313
|
command: 'EditorCompletion.focusLast',
|
|
9314
|
+
key: End,
|
|
9314
9315
|
when: FocusEditorCompletions
|
|
9315
9316
|
}, {
|
|
9316
|
-
key: Home,
|
|
9317
9317
|
command: 'EditorCompletion.focusFirst',
|
|
9318
|
+
key: Home,
|
|
9318
9319
|
when: FocusEditorCompletions
|
|
9319
9320
|
}, {
|
|
9320
|
-
key: CtrlCmd | Space$1,
|
|
9321
9321
|
command: 'EditorCompletion.toggleDetails',
|
|
9322
|
+
key: CtrlCmd | Space$1,
|
|
9322
9323
|
when: FocusEditorCompletions
|
|
9323
9324
|
}, {
|
|
9324
|
-
key: CtrlCmd | RightArrow,
|
|
9325
9325
|
command: 'Editor.cursorWordRight',
|
|
9326
|
+
key: CtrlCmd | RightArrow,
|
|
9326
9327
|
when: FocusEditorText
|
|
9327
9328
|
}, {
|
|
9328
|
-
key: CtrlCmd | LeftArrow,
|
|
9329
9329
|
command: 'Editor.cursorWordLeft',
|
|
9330
|
+
key: CtrlCmd | LeftArrow,
|
|
9330
9331
|
when: FocusEditorText
|
|
9331
9332
|
}, {
|
|
9332
|
-
key: Alt$1 | Backspace,
|
|
9333
9333
|
command: 'Editor.deleteWordPartLeft',
|
|
9334
|
+
key: Alt$1 | Backspace,
|
|
9334
9335
|
when: FocusEditorText
|
|
9335
9336
|
}, {
|
|
9336
|
-
key: Alt$1 | Delete,
|
|
9337
9337
|
command: 'Editor.deleteWordPartRight',
|
|
9338
|
+
key: Alt$1 | Delete,
|
|
9338
9339
|
when: FocusEditorText
|
|
9339
9340
|
}, {
|
|
9340
|
-
key: CtrlCmd | Backspace,
|
|
9341
9341
|
command: 'Editor.deleteWordLeft',
|
|
9342
|
+
key: CtrlCmd | Backspace,
|
|
9342
9343
|
when: FocusEditorText
|
|
9343
9344
|
}, {
|
|
9344
|
-
key: CtrlCmd | Delete,
|
|
9345
9345
|
command: 'Editor.deleteWordRight',
|
|
9346
|
+
key: CtrlCmd | Delete,
|
|
9346
9347
|
when: FocusEditorText
|
|
9347
9348
|
}, {
|
|
9348
|
-
key: CtrlCmd | KeyD,
|
|
9349
9349
|
command: 'Editor.selectNextOccurrence',
|
|
9350
|
+
key: CtrlCmd | KeyD,
|
|
9350
9351
|
when: FocusEditorText
|
|
9351
9352
|
}, {
|
|
9352
|
-
key: CtrlCmd | KeyJ,
|
|
9353
9353
|
command: 'Editor.openColorPicker',
|
|
9354
|
+
key: CtrlCmd | KeyJ,
|
|
9354
9355
|
when: FocusEditorText
|
|
9355
9356
|
}, {
|
|
9356
|
-
key: CtrlCmd | Period,
|
|
9357
9357
|
command: 'Editor.showSourceActions3',
|
|
9358
|
+
key: CtrlCmd | Period,
|
|
9358
9359
|
when: FocusEditorText
|
|
9359
9360
|
}, {
|
|
9360
|
-
key: Tab$1,
|
|
9361
9361
|
command: 'Editor.handleTab',
|
|
9362
|
+
key: Tab$1,
|
|
9362
9363
|
when: FocusEditorText
|
|
9363
9364
|
}, {
|
|
9364
|
-
key: Shift | Tab$1,
|
|
9365
9365
|
command: 'Editor.unindent',
|
|
9366
|
+
key: Shift | Tab$1,
|
|
9366
9367
|
when: FocusEditorText
|
|
9367
9368
|
}, {
|
|
9368
|
-
key: CtrlCmd | BracketLeft,
|
|
9369
9369
|
command: 'Editor.indentLess',
|
|
9370
|
+
key: CtrlCmd | BracketLeft,
|
|
9370
9371
|
when: FocusEditorText
|
|
9371
9372
|
}, {
|
|
9372
|
-
key: Escape,
|
|
9373
9373
|
command: 'Editor.closeFind',
|
|
9374
|
+
key: Escape,
|
|
9374
9375
|
when: FocusFindWidget
|
|
9375
9376
|
}, {
|
|
9376
|
-
key: CtrlCmd | KeyF,
|
|
9377
9377
|
command: 'Editor.openFind2',
|
|
9378
|
+
key: CtrlCmd | KeyF,
|
|
9378
9379
|
when: FocusEditorText
|
|
9379
9380
|
}, {
|
|
9380
|
-
key: CtrlCmd | KeyK,
|
|
9381
9381
|
command: 'Editor.openCodeGenerator',
|
|
9382
|
+
key: CtrlCmd | KeyK,
|
|
9382
9383
|
when: FocusEditorText
|
|
9383
9384
|
}, {
|
|
9384
|
-
key: Escape,
|
|
9385
9385
|
command: 'Editor.closeCodeGenerator',
|
|
9386
|
+
key: Escape,
|
|
9386
9387
|
when: FocusEditorCodeGenerator
|
|
9387
9388
|
}, {
|
|
9388
|
-
key: Enter,
|
|
9389
9389
|
command: 'EditorCodeGenerator.accept',
|
|
9390
|
+
key: Enter,
|
|
9390
9391
|
when: FocusEditorCodeGenerator
|
|
9391
9392
|
}, {
|
|
9392
|
-
key: CtrlCmd | BracketRight,
|
|
9393
9393
|
command: 'Editor.indentMore',
|
|
9394
|
+
key: CtrlCmd | BracketRight,
|
|
9394
9395
|
when: FocusEditorText
|
|
9395
9396
|
}, {
|
|
9396
|
-
key: Shift | LeftArrow,
|
|
9397
9397
|
command: 'Editor.selectCharacterLeft',
|
|
9398
|
+
key: Shift | LeftArrow,
|
|
9398
9399
|
when: FocusEditorText
|
|
9399
9400
|
}, {
|
|
9400
|
-
key: CtrlCmd | Shift | LeftArrow,
|
|
9401
9401
|
command: 'Editor.selectWordLeft',
|
|
9402
|
+
key: CtrlCmd | Shift | LeftArrow,
|
|
9402
9403
|
when: FocusEditorText
|
|
9403
9404
|
}, {
|
|
9404
|
-
key: Shift | RightArrow,
|
|
9405
9405
|
command: 'Editor.selectCharacterRight',
|
|
9406
|
+
key: Shift | RightArrow,
|
|
9406
9407
|
when: FocusEditorText
|
|
9407
9408
|
}, {
|
|
9408
|
-
key: CtrlCmd | Shift | RightArrow,
|
|
9409
9409
|
command: 'Editor.selectWordRight',
|
|
9410
|
+
key: CtrlCmd | Shift | RightArrow,
|
|
9410
9411
|
when: FocusEditorText
|
|
9411
9412
|
}, {
|
|
9412
|
-
key: CtrlCmd | KeyL,
|
|
9413
9413
|
command: 'Editor.selectLine',
|
|
9414
|
+
key: CtrlCmd | KeyL,
|
|
9414
9415
|
when: FocusEditorText
|
|
9415
9416
|
}, {
|
|
9416
|
-
key: CtrlCmd | Shift | Backspace,
|
|
9417
9417
|
command: 'Editor.deleteAllLeft',
|
|
9418
|
+
key: CtrlCmd | Shift | Backspace,
|
|
9418
9419
|
when: FocusEditorText
|
|
9419
9420
|
}, {
|
|
9420
|
-
key: CtrlCmd | Shift | Delete,
|
|
9421
9421
|
command: 'Editor.deleteAllRight',
|
|
9422
|
+
key: CtrlCmd | Shift | Delete,
|
|
9422
9423
|
when: FocusEditorText
|
|
9423
9424
|
}, {
|
|
9424
|
-
key: Escape,
|
|
9425
9425
|
command: 'Editor.cancelSelection',
|
|
9426
|
+
key: Escape,
|
|
9426
9427
|
when: FocusEditorText
|
|
9427
9428
|
}, {
|
|
9428
|
-
key: CtrlCmd | KeyZ,
|
|
9429
9429
|
command: 'Editor.undo',
|
|
9430
|
+
key: CtrlCmd | KeyZ,
|
|
9430
9431
|
when: FocusEditorText
|
|
9431
9432
|
}, {
|
|
9432
|
-
key: LeftArrow,
|
|
9433
9433
|
command: 'Editor.cursorLeft',
|
|
9434
|
+
key: LeftArrow,
|
|
9434
9435
|
when: FocusEditorText
|
|
9435
9436
|
}, {
|
|
9436
|
-
key: RightArrow,
|
|
9437
9437
|
command: 'Editor.cursorRight',
|
|
9438
|
+
key: RightArrow,
|
|
9438
9439
|
when: FocusEditorText
|
|
9439
9440
|
}, {
|
|
9440
|
-
key: UpArrow,
|
|
9441
9441
|
command: 'Editor.cursorUp',
|
|
9442
|
+
key: UpArrow,
|
|
9442
9443
|
when: FocusEditorText
|
|
9443
9444
|
}, {
|
|
9444
|
-
key: DownArrow,
|
|
9445
9445
|
command: 'Editor.cursorDown',
|
|
9446
|
+
key: DownArrow,
|
|
9446
9447
|
when: FocusEditorText
|
|
9447
9448
|
}, {
|
|
9448
|
-
key: Backspace,
|
|
9449
9449
|
command: 'Editor.deleteLeft',
|
|
9450
|
+
key: Backspace,
|
|
9450
9451
|
when: FocusEditorText
|
|
9451
9452
|
}, {
|
|
9452
|
-
key: Delete,
|
|
9453
9453
|
command: 'Editor.deleteRight',
|
|
9454
|
+
key: Delete,
|
|
9454
9455
|
when: FocusEditorText
|
|
9455
9456
|
}, {
|
|
9456
|
-
key: Enter,
|
|
9457
9457
|
command: 'Editor.insertLineBreak',
|
|
9458
|
+
key: Enter,
|
|
9458
9459
|
when: FocusEditorText
|
|
9459
9460
|
}, {
|
|
9460
|
-
key: CtrlCmd | Shift | KeyD,
|
|
9461
9461
|
command: 'Editor.copyLineDown',
|
|
9462
|
+
key: CtrlCmd | Shift | KeyD,
|
|
9462
9463
|
when: FocusEditorText
|
|
9463
9464
|
}, {
|
|
9464
|
-
key: CtrlCmd | Shift | DownArrow,
|
|
9465
9465
|
command: 'Editor.moveLineDown',
|
|
9466
|
+
key: CtrlCmd | Shift | DownArrow,
|
|
9466
9467
|
when: FocusEditorText
|
|
9467
9468
|
}, {
|
|
9468
|
-
key: CtrlCmd | Shift | UpArrow,
|
|
9469
9469
|
command: 'Editor.moveLineUp',
|
|
9470
|
+
key: CtrlCmd | Shift | UpArrow,
|
|
9470
9471
|
when: FocusEditorText
|
|
9471
9472
|
}, {
|
|
9472
|
-
key: CtrlCmd | Space$1,
|
|
9473
9473
|
command: 'Editor.openCompletion',
|
|
9474
|
+
key: CtrlCmd | Space$1,
|
|
9474
9475
|
when: FocusEditorText
|
|
9475
9476
|
}, {
|
|
9476
|
-
key: F2,
|
|
9477
9477
|
command: 'Editor.openRename',
|
|
9478
|
+
key: F2,
|
|
9478
9479
|
when: FocusEditorText
|
|
9479
9480
|
}, {
|
|
9480
|
-
key: Enter,
|
|
9481
9481
|
command: 'EditorRename.accept',
|
|
9482
|
+
key: Enter,
|
|
9482
9483
|
when: FocusEditorRename
|
|
9483
9484
|
}, {
|
|
9484
|
-
key: Escape,
|
|
9485
9485
|
command: 'Editor.closeRename',
|
|
9486
|
+
key: Escape,
|
|
9486
9487
|
when: FocusEditorRename
|
|
9487
9488
|
}, {
|
|
9488
|
-
key: Home,
|
|
9489
9489
|
command: 'Editor.cursorHome',
|
|
9490
|
+
key: Home,
|
|
9490
9491
|
when: FocusEditorText
|
|
9491
9492
|
}, {
|
|
9492
|
-
key: End,
|
|
9493
9493
|
command: 'Editor.cursorEnd',
|
|
9494
|
+
key: End,
|
|
9494
9495
|
when: FocusEditorText
|
|
9495
9496
|
}, {
|
|
9496
|
-
key: CtrlCmd | Slash$1,
|
|
9497
9497
|
command: 'Editor.toggleComment',
|
|
9498
|
+
key: CtrlCmd | Slash$1,
|
|
9498
9499
|
when: FocusEditorText
|
|
9499
9500
|
}, {
|
|
9500
|
-
key: CtrlCmd | KeyC,
|
|
9501
9501
|
command: 'Editor.copy',
|
|
9502
|
+
key: CtrlCmd | KeyC,
|
|
9502
9503
|
when: FocusEditorText
|
|
9503
9504
|
}, {
|
|
9504
|
-
key: CtrlCmd | KeyA,
|
|
9505
9505
|
command: 'Editor.selectAll',
|
|
9506
|
+
key: CtrlCmd | KeyA,
|
|
9506
9507
|
when: FocusEditorText
|
|
9507
9508
|
}, {
|
|
9508
|
-
key: CtrlCmd | KeyH,
|
|
9509
9509
|
command: 'Editor.showHover2',
|
|
9510
|
+
key: CtrlCmd | KeyH,
|
|
9510
9511
|
when: FocusEditorText
|
|
9511
9512
|
}, {
|
|
9512
|
-
key: CtrlCmd | KeyX,
|
|
9513
9513
|
command: 'Editor.cut',
|
|
9514
|
+
key: CtrlCmd | KeyX,
|
|
9514
9515
|
when: FocusEditorText
|
|
9515
9516
|
}, {
|
|
9516
|
-
key: CtrlCmd | KeyV,
|
|
9517
9517
|
command: 'Editor.paste',
|
|
9518
|
+
key: CtrlCmd | KeyV,
|
|
9518
9519
|
when: FocusEditorText
|
|
9519
9520
|
}, {
|
|
9520
|
-
key: Alt$1 | LeftArrow,
|
|
9521
9521
|
command: 'Editor.cursorWordPartLeft',
|
|
9522
|
+
key: Alt$1 | LeftArrow,
|
|
9522
9523
|
when: FocusEditorText
|
|
9523
9524
|
}, {
|
|
9524
|
-
key: Alt$1 | RightArrow,
|
|
9525
9525
|
command: 'Editor.cursorWordPartRight',
|
|
9526
|
+
key: Alt$1 | RightArrow,
|
|
9526
9527
|
when: FocusEditorText
|
|
9527
9528
|
}, {
|
|
9528
|
-
key: Alt$1 | F3,
|
|
9529
9529
|
command: 'Editor.selectAllOccurrences',
|
|
9530
|
+
key: Alt$1 | F3,
|
|
9530
9531
|
when: FocusEditorText
|
|
9531
9532
|
}, {
|
|
9532
|
-
key: Alt$1 | Shift | UpArrow,
|
|
9533
9533
|
command: 'Editor.addCursorAbove',
|
|
9534
|
+
key: Alt$1 | Shift | UpArrow,
|
|
9534
9535
|
when: FocusEditorText
|
|
9535
9536
|
}, {
|
|
9536
|
-
key: Alt$1 | Shift | DownArrow,
|
|
9537
9537
|
command: 'Editor.addCursorBelow',
|
|
9538
|
+
key: Alt$1 | Shift | DownArrow,
|
|
9538
9539
|
when: FocusEditorText
|
|
9539
9540
|
}, {
|
|
9540
|
-
key: Alt$1 | Shift | F12,
|
|
9541
9541
|
command: 'Editor.findAllReferences',
|
|
9542
|
+
key: Alt$1 | Shift | F12,
|
|
9542
9543
|
when: FocusEditorText
|
|
9543
9544
|
}, {
|
|
9544
|
-
key: Alt$1 | Shift | KeyO,
|
|
9545
9545
|
command: 'Editor.organizeImports',
|
|
9546
|
+
key: Alt$1 | Shift | KeyO,
|
|
9546
9547
|
when: FocusEditorText
|
|
9547
9548
|
}, {
|
|
9548
|
-
key: CtrlCmd | Shift | Space$1,
|
|
9549
9549
|
command: 'Editor.selectionGrow',
|
|
9550
|
+
key: CtrlCmd | Shift | Space$1,
|
|
9550
9551
|
when: FocusEditor
|
|
9551
9552
|
}];
|
|
9552
9553
|
};
|
|
@@ -9565,65 +9566,65 @@ const commandPalette = () => {
|
|
|
9565
9566
|
};
|
|
9566
9567
|
|
|
9567
9568
|
const menuEntrySeparator = {
|
|
9568
|
-
|
|
9569
|
-
label: '',
|
|
9569
|
+
command: '',
|
|
9570
9570
|
flags: Separator,
|
|
9571
|
-
|
|
9571
|
+
id: 'separator',
|
|
9572
|
+
label: ''
|
|
9572
9573
|
};
|
|
9573
9574
|
|
|
9574
9575
|
const getMenuEntries = () => {
|
|
9575
9576
|
return [{
|
|
9576
|
-
|
|
9577
|
-
label: goToDefinition$1(),
|
|
9577
|
+
command: 'Editor.goToDefinition',
|
|
9578
9578
|
flags: None,
|
|
9579
|
-
|
|
9579
|
+
id: 'go-to-definition',
|
|
9580
|
+
label: goToDefinition$1()
|
|
9580
9581
|
}, {
|
|
9581
|
-
|
|
9582
|
-
label: goToTypeDefinition$1(),
|
|
9582
|
+
command: /* Editor.goToTypeDefinition */'Editor.goToTypeDefinition',
|
|
9583
9583
|
flags: None,
|
|
9584
|
-
|
|
9584
|
+
id: 'go-to-type-definition',
|
|
9585
|
+
label: goToTypeDefinition$1()
|
|
9585
9586
|
}, menuEntrySeparator, {
|
|
9586
|
-
|
|
9587
|
-
label: findAllReferences(),
|
|
9588
|
-
flags: None,
|
|
9587
|
+
args: [/* id */'References', /* focus */true],
|
|
9589
9588
|
command: /* ViewletSideBar.show */'SideBar.show',
|
|
9590
|
-
args: [/* id */'References', /* focus */true]
|
|
9591
|
-
}, {
|
|
9592
|
-
id: 'find-all-implementations',
|
|
9593
|
-
label: findAllImplementations(),
|
|
9594
9589
|
flags: None,
|
|
9590
|
+
id: 'find-all-references',
|
|
9591
|
+
label: findAllReferences()
|
|
9592
|
+
}, {
|
|
9593
|
+
args: [/* id */'Implementations', /* focus */true],
|
|
9595
9594
|
command: /* ViewletSideBar.show */'SideBar.show',
|
|
9596
|
-
|
|
9595
|
+
flags: None,
|
|
9596
|
+
id: 'find-all-implementations',
|
|
9597
|
+
label: findAllImplementations()
|
|
9597
9598
|
}, menuEntrySeparator, {
|
|
9598
|
-
|
|
9599
|
-
label: formatDocument(),
|
|
9599
|
+
command: 'Editor.format',
|
|
9600
9600
|
flags: None,
|
|
9601
|
-
|
|
9601
|
+
id: 'format',
|
|
9602
|
+
label: formatDocument()
|
|
9602
9603
|
}, {
|
|
9603
|
-
|
|
9604
|
-
label: sourceAction(),
|
|
9604
|
+
command: 'Editor.showSourceActions2',
|
|
9605
9605
|
flags: None,
|
|
9606
|
-
|
|
9606
|
+
id: SourceControl,
|
|
9607
|
+
label: sourceAction()
|
|
9607
9608
|
}, menuEntrySeparator, {
|
|
9608
|
-
|
|
9609
|
-
label: cut(),
|
|
9609
|
+
command: /* Editor.cut */'Editor.cut',
|
|
9610
9610
|
flags: None,
|
|
9611
|
-
|
|
9611
|
+
id: 'cut',
|
|
9612
|
+
label: cut()
|
|
9612
9613
|
}, {
|
|
9613
|
-
|
|
9614
|
-
label: copy(),
|
|
9614
|
+
command: /* Editor.copy */'Editor.copy',
|
|
9615
9615
|
flags: None,
|
|
9616
|
-
|
|
9616
|
+
id: 'copy',
|
|
9617
|
+
label: copy()
|
|
9617
9618
|
}, {
|
|
9618
|
-
|
|
9619
|
-
label: paste$1(),
|
|
9619
|
+
command: /* Editor.paste */'Editor.paste',
|
|
9620
9620
|
flags: None,
|
|
9621
|
-
|
|
9621
|
+
id: 'paste',
|
|
9622
|
+
label: paste$1()
|
|
9622
9623
|
}, menuEntrySeparator, {
|
|
9623
|
-
|
|
9624
|
-
label: commandPalette(),
|
|
9624
|
+
command: 'QuickPick.showEverything',
|
|
9625
9625
|
flags: None,
|
|
9626
|
-
|
|
9626
|
+
id: 'commandPalette',
|
|
9627
|
+
label: commandPalette()
|
|
9627
9628
|
}];
|
|
9628
9629
|
};
|
|
9629
9630
|
|
|
@@ -9675,13 +9676,13 @@ const getQuickPickMenuEntries = () => {
|
|
|
9675
9676
|
id: 'Editor.selectInsideString',
|
|
9676
9677
|
label: editorSelectInsideString()
|
|
9677
9678
|
}, {
|
|
9679
|
+
aliases: ['Indent More', 'DeIndent'],
|
|
9678
9680
|
id: 'Editor.indent',
|
|
9679
|
-
label: editorIndent()
|
|
9680
|
-
aliases: ['Indent More', 'DeIndent']
|
|
9681
|
+
label: editorIndent()
|
|
9681
9682
|
}, {
|
|
9683
|
+
aliases: ['Indent Less', 'DeIndent'],
|
|
9682
9684
|
id: 'Editor.unindent',
|
|
9683
|
-
label: editorUnindent$1()
|
|
9684
|
-
aliases: ['Indent Less', 'DeIndent']
|
|
9685
|
+
label: editorUnindent$1()
|
|
9685
9686
|
}, {
|
|
9686
9687
|
id: 'Editor.sortLinesAscending',
|
|
9687
9688
|
label: editorSortLinesAscending()
|
|
@@ -9751,8 +9752,8 @@ const handleBeforeInput = (editor, inputType, data) => {
|
|
|
9751
9752
|
|
|
9752
9753
|
const handleMessagePort = async (port, rpcId) => {
|
|
9753
9754
|
const rpc = await PlainMessagePortRpcParent.create({
|
|
9754
|
-
|
|
9755
|
-
|
|
9755
|
+
commandMap: {},
|
|
9756
|
+
messagePort: port
|
|
9756
9757
|
});
|
|
9757
9758
|
if (rpcId) {
|
|
9758
9759
|
set$b(rpcId, rpc);
|
|
@@ -9994,9 +9995,9 @@ const getCursorsVirtualDom = cursors => {
|
|
|
9994
9995
|
const dom = [];
|
|
9995
9996
|
for (const translate of cursors) {
|
|
9996
9997
|
dom.push({
|
|
9997
|
-
type: Div,
|
|
9998
9998
|
className: EditorCursor,
|
|
9999
|
-
translate
|
|
9999
|
+
translate,
|
|
10000
|
+
type: Div
|
|
10000
10001
|
});
|
|
10001
10002
|
}
|
|
10002
10003
|
return dom;
|
|
@@ -10023,21 +10024,21 @@ const mergeClassNames = (...classNames) => {
|
|
|
10023
10024
|
|
|
10024
10025
|
const getDiagnosticVirtualDom = diagnostic => {
|
|
10025
10026
|
const {
|
|
10026
|
-
x,
|
|
10027
|
-
y,
|
|
10028
|
-
width,
|
|
10029
10027
|
height,
|
|
10030
|
-
type
|
|
10028
|
+
type,
|
|
10029
|
+
width,
|
|
10030
|
+
x,
|
|
10031
|
+
y
|
|
10031
10032
|
} = diagnostic;
|
|
10032
10033
|
const extraClassName = getDiagnosticClassName(type);
|
|
10033
10034
|
return [{
|
|
10034
|
-
|
|
10035
|
+
childCount: 0,
|
|
10035
10036
|
className: mergeClassNames(Diagnostic, extraClassName),
|
|
10036
|
-
width,
|
|
10037
10037
|
height,
|
|
10038
|
-
top: y,
|
|
10039
10038
|
left: x,
|
|
10040
|
-
|
|
10039
|
+
top: y,
|
|
10040
|
+
type: Div,
|
|
10041
|
+
width
|
|
10041
10042
|
}];
|
|
10042
10043
|
};
|
|
10043
10044
|
|
|
@@ -10048,9 +10049,9 @@ const getDiagnosticsVirtualDom = diagnostics => {
|
|
|
10048
10049
|
|
|
10049
10050
|
const getGutterInfoVirtualDom = gutterInfo => {
|
|
10050
10051
|
return [{
|
|
10051
|
-
|
|
10052
|
+
childCount: 1,
|
|
10052
10053
|
className: 'LineNumber',
|
|
10053
|
-
|
|
10054
|
+
type: Span
|
|
10054
10055
|
}, text(gutterInfo)];
|
|
10055
10056
|
};
|
|
10056
10057
|
const getEditorGutterVirtualDom = gutterInfos => {
|
|
@@ -10068,18 +10069,18 @@ const getEditorRowsVirtualDom = (textInfos, differences, lineNumbers = true, hig
|
|
|
10068
10069
|
className += ' ' + EditorRowHighlighted;
|
|
10069
10070
|
}
|
|
10070
10071
|
dom.push({
|
|
10071
|
-
|
|
10072
|
+
childCount: textInfo.length / 2,
|
|
10072
10073
|
className,
|
|
10073
10074
|
translate: px(difference),
|
|
10074
|
-
|
|
10075
|
+
type: Div
|
|
10075
10076
|
});
|
|
10076
10077
|
for (let j = 0; j < textInfo.length; j += 2) {
|
|
10077
10078
|
const tokenText = textInfo[j];
|
|
10078
10079
|
const className = textInfo[j + 1];
|
|
10079
10080
|
dom.push({
|
|
10080
|
-
|
|
10081
|
+
childCount: 1,
|
|
10081
10082
|
className,
|
|
10082
|
-
|
|
10083
|
+
type: Span
|
|
10083
10084
|
}, text(tokenText));
|
|
10084
10085
|
}
|
|
10085
10086
|
}
|
|
@@ -10094,12 +10095,12 @@ const getSelectionsVirtualDom = selections => {
|
|
|
10094
10095
|
const width = selections[i + 2];
|
|
10095
10096
|
const height = selections[i + 3];
|
|
10096
10097
|
dom.push({
|
|
10097
|
-
type: Div,
|
|
10098
10098
|
className: EditorSelection,
|
|
10099
|
+
height,
|
|
10099
10100
|
left: x,
|
|
10100
10101
|
top: y,
|
|
10101
|
-
|
|
10102
|
-
|
|
10102
|
+
type: Div,
|
|
10103
|
+
width
|
|
10103
10104
|
});
|
|
10104
10105
|
}
|
|
10105
10106
|
return dom;
|
|
@@ -10128,9 +10129,6 @@ const removeWidget = widget => {
|
|
|
10128
10129
|
};
|
|
10129
10130
|
|
|
10130
10131
|
const renderLines = {
|
|
10131
|
-
isEqual(oldState, newState) {
|
|
10132
|
-
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;
|
|
10133
|
-
},
|
|
10134
10132
|
apply(oldState, newState) {
|
|
10135
10133
|
const {
|
|
10136
10134
|
incrementalEdits
|
|
@@ -10139,8 +10137,8 @@ const renderLines = {
|
|
|
10139
10137
|
return [/* method */'setIncrementalEdits', /* incrementalEdits */incrementalEdits];
|
|
10140
10138
|
}
|
|
10141
10139
|
const {
|
|
10142
|
-
|
|
10143
|
-
|
|
10140
|
+
differences,
|
|
10141
|
+
textInfos
|
|
10144
10142
|
} = newState;
|
|
10145
10143
|
newState.differences = differences;
|
|
10146
10144
|
const {
|
|
@@ -10150,12 +10148,12 @@ const renderLines = {
|
|
|
10150
10148
|
const relativeLine = highlightedLine - minLineY;
|
|
10151
10149
|
const dom = getEditorRowsVirtualDom(textInfos, differences, true, relativeLine);
|
|
10152
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;
|
|
10153
10154
|
}
|
|
10154
10155
|
};
|
|
10155
10156
|
const renderSelections = {
|
|
10156
|
-
isEqual(oldState, newState) {
|
|
10157
|
-
return oldState.selections === newState.selections && oldState.focused === newState.focused && oldState.minLineY === newState.minLineY && oldState.deltaX === newState.deltaX;
|
|
10158
|
-
},
|
|
10159
10157
|
apply: async (oldState, newState) => {
|
|
10160
10158
|
const {
|
|
10161
10159
|
cursorInfos,
|
|
@@ -10164,74 +10162,74 @@ const renderSelections = {
|
|
|
10164
10162
|
const cursorsDom = getCursorsVirtualDom(cursorInfos);
|
|
10165
10163
|
const selectionsDom = getSelectionsVirtualDom(selectionInfos);
|
|
10166
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;
|
|
10167
10168
|
}
|
|
10168
10169
|
};
|
|
10169
10170
|
const renderScrollBarY = {
|
|
10170
|
-
isEqual(oldState, newState) {
|
|
10171
|
-
return oldState.deltaY === newState.deltaY && oldState.scrollBarHeight === newState.scrollBarHeight;
|
|
10172
|
-
},
|
|
10173
10171
|
apply(oldState, newState) {
|
|
10174
10172
|
const scrollBarY = getScrollBarY(newState.deltaY, newState.finalDeltaY, newState.height, newState.scrollBarHeight);
|
|
10175
10173
|
const translate = `0 ${scrollBarY}px`;
|
|
10176
10174
|
const heightPx = `${newState.scrollBarHeight}px`;
|
|
10177
10175
|
return [/* method */'setScrollBar', translate, heightPx];
|
|
10176
|
+
},
|
|
10177
|
+
isEqual(oldState, newState) {
|
|
10178
|
+
return oldState.deltaY === newState.deltaY && oldState.scrollBarHeight === newState.scrollBarHeight;
|
|
10178
10179
|
}
|
|
10179
10180
|
};
|
|
10180
10181
|
const renderScrollBarX = {
|
|
10181
|
-
isEqual(oldState, newState) {
|
|
10182
|
-
return oldState.longestLineWidth === newState.longestLineWidth && oldState.deltaX === newState.deltaX;
|
|
10183
|
-
},
|
|
10184
10182
|
apply(oldState, newState) {
|
|
10185
10183
|
const scrollBarWidth = getScrollBarSize(newState.width, newState.longestLineWidth, newState.minimumSliderSize);
|
|
10186
10184
|
const scrollBarX = newState.deltaX / newState.longestLineWidth * newState.width;
|
|
10187
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;
|
|
10188
10189
|
}
|
|
10189
10190
|
};
|
|
10190
10191
|
const renderFocus$1 = {
|
|
10191
|
-
isEqual(oldState, newState) {
|
|
10192
|
-
return oldState.focused === newState.focused;
|
|
10193
|
-
},
|
|
10194
10192
|
apply(oldState, newState) {
|
|
10195
10193
|
return [/* method */'setFocused', newState.focused];
|
|
10194
|
+
},
|
|
10195
|
+
isEqual(oldState, newState) {
|
|
10196
|
+
return oldState.focused === newState.focused;
|
|
10196
10197
|
}
|
|
10197
10198
|
};
|
|
10198
10199
|
const renderFocusContext = {
|
|
10199
|
-
isEqual(oldState, newState) {
|
|
10200
|
-
return oldState.focus === newState.focus;
|
|
10201
|
-
},
|
|
10202
10200
|
apply(oldState, newState) {
|
|
10203
10201
|
return ['Viewlet.setFocusContext', newState.uid, newState.focus];
|
|
10202
|
+
},
|
|
10203
|
+
isEqual(oldState, newState) {
|
|
10204
|
+
return oldState.focus === newState.focus;
|
|
10204
10205
|
}
|
|
10205
10206
|
};
|
|
10206
10207
|
const renderAdditionalFocusContext = {
|
|
10207
|
-
isEqual(oldState, newState) {
|
|
10208
|
-
return oldState.additionalFocus === newState.additionalFocus;
|
|
10209
|
-
},
|
|
10210
10208
|
apply(oldState, newState) {
|
|
10211
10209
|
if (newState.additionalFocus) {
|
|
10212
10210
|
return ['Viewlet.setAdditionalFocus', newState.uid, newState.additionalFocus];
|
|
10213
10211
|
}
|
|
10214
10212
|
return ['viewlet.unsetAdditionalFocus', newState.uid, newState.additionalFocus];
|
|
10213
|
+
},
|
|
10214
|
+
isEqual(oldState, newState) {
|
|
10215
|
+
return oldState.additionalFocus === newState.additionalFocus;
|
|
10215
10216
|
}
|
|
10216
10217
|
};
|
|
10217
10218
|
const renderDecorations = {
|
|
10218
|
-
isEqual(oldState, newState) {
|
|
10219
|
-
return oldState.decorations === newState.decorations;
|
|
10220
|
-
},
|
|
10221
10219
|
apply(oldState, newState) {
|
|
10222
10220
|
const dom = getDiagnosticsVirtualDom(newState.decorations);
|
|
10223
10221
|
return ['setDecorationsDom', dom];
|
|
10222
|
+
},
|
|
10223
|
+
isEqual(oldState, newState) {
|
|
10224
|
+
return oldState.decorations === newState.decorations;
|
|
10224
10225
|
}
|
|
10225
10226
|
};
|
|
10226
10227
|
const renderGutterInfo = {
|
|
10227
|
-
isEqual(oldState, newState) {
|
|
10228
|
-
return oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY;
|
|
10229
|
-
},
|
|
10230
10228
|
apply(oldState, newState) {
|
|
10231
10229
|
const {
|
|
10232
|
-
|
|
10230
|
+
lineNumbers,
|
|
10233
10231
|
maxLineY,
|
|
10234
|
-
|
|
10232
|
+
minLineY
|
|
10235
10233
|
} = newState;
|
|
10236
10234
|
const gutterInfos = [];
|
|
10237
10235
|
if (lineNumbers) {
|
|
@@ -10241,12 +10239,12 @@ const renderGutterInfo = {
|
|
|
10241
10239
|
}
|
|
10242
10240
|
const dom = getEditorGutterVirtualDom(gutterInfos);
|
|
10243
10241
|
return ['renderGutter', dom];
|
|
10242
|
+
},
|
|
10243
|
+
isEqual(oldState, newState) {
|
|
10244
|
+
return oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY;
|
|
10244
10245
|
}
|
|
10245
10246
|
};
|
|
10246
10247
|
const renderWidgets = {
|
|
10247
|
-
isEqual(oldState, newState) {
|
|
10248
|
-
return oldState.widgets === newState.widgets;
|
|
10249
|
-
},
|
|
10250
10248
|
apply(oldState, newState) {
|
|
10251
10249
|
const addedWidgets = [];
|
|
10252
10250
|
const changedWidgets = [];
|
|
@@ -10298,6 +10296,9 @@ const renderWidgets = {
|
|
|
10298
10296
|
const filteredCommands = allCommands.filter(item => item[0] !== 'Viewlet.setFocusContext');
|
|
10299
10297
|
return filteredCommands;
|
|
10300
10298
|
},
|
|
10299
|
+
isEqual(oldState, newState) {
|
|
10300
|
+
return oldState.widgets === newState.widgets;
|
|
10301
|
+
},
|
|
10301
10302
|
multiple: true
|
|
10302
10303
|
};
|
|
10303
10304
|
const render$6 = [renderLines, renderSelections, renderScrollBarX, renderScrollBarY, renderFocus$1, renderDecorations, renderGutterInfo, renderWidgets, renderFocusContext, renderAdditionalFocusContext];
|
|
@@ -10307,8 +10308,8 @@ const renderEditor = async id => {
|
|
|
10307
10308
|
return [];
|
|
10308
10309
|
}
|
|
10309
10310
|
const {
|
|
10310
|
-
|
|
10311
|
-
|
|
10311
|
+
newState,
|
|
10312
|
+
oldState
|
|
10312
10313
|
} = instance;
|
|
10313
10314
|
const commands = [];
|
|
10314
10315
|
set$6(id, newState, newState);
|
|
@@ -10389,8 +10390,8 @@ const updateDebugInfo = async debugId => {
|
|
|
10389
10390
|
return;
|
|
10390
10391
|
}
|
|
10391
10392
|
const {
|
|
10392
|
-
|
|
10393
|
-
|
|
10393
|
+
newState,
|
|
10394
|
+
oldState
|
|
10394
10395
|
} = instance;
|
|
10395
10396
|
const newEditor = {
|
|
10396
10397
|
...newState,
|
|
@@ -10463,11 +10464,11 @@ const wrapCommands = commands => {
|
|
|
10463
10464
|
|
|
10464
10465
|
const commandMap = {
|
|
10465
10466
|
'ActivateByEvent.activateByEvent': activateByEvent,
|
|
10466
|
-
'ExtensionHostManagement.activateByEvent': activateByEvent,
|
|
10467
10467
|
'CodeGenerator.accept': codeGeneratorAccept,
|
|
10468
10468
|
'ColorPicker.loadContent': loadContent$2,
|
|
10469
10469
|
'Editor.addCursorAbove': addCursorAbove,
|
|
10470
10470
|
'Editor.addCursorBelow': addCursorBelow,
|
|
10471
|
+
'Editor.applyDocumentEdits': applyDocumentEdits,
|
|
10471
10472
|
'Editor.applyEdit': applyEdit,
|
|
10472
10473
|
'Editor.applyEdit2': applyEdits2,
|
|
10473
10474
|
'Editor.applyWorkspaceEdit': applyWorkspaceEdit,
|
|
@@ -10482,13 +10483,10 @@ const commandMap = {
|
|
|
10482
10483
|
'Editor.compositionEnd': compositionEnd,
|
|
10483
10484
|
'Editor.compositionStart': compositionStart,
|
|
10484
10485
|
'Editor.compositionUpdate': compositionUpdate,
|
|
10485
|
-
'Editor.handleClickAtPosition': handleClickAtPosition,
|
|
10486
|
-
'Editor.applyDocumentEdits': applyDocumentEdits,
|
|
10487
10486
|
'Editor.contextMenu': handleContextMenu,
|
|
10488
10487
|
'Editor.copy': copy$1,
|
|
10489
10488
|
'Editor.copyLineDown': copyLineDown,
|
|
10490
10489
|
'Editor.copyLineUp': copyLineUp,
|
|
10491
|
-
'Editor.getMenuIds': getMenuIds,
|
|
10492
10490
|
'Editor.create': createEditor,
|
|
10493
10491
|
'Editor.cursorCharacterLeft': cursorCharacterLeft,
|
|
10494
10492
|
'Editor.cursorCharacterRight': cursorCharacterRight,
|
|
@@ -10518,20 +10516,21 @@ const commandMap = {
|
|
|
10518
10516
|
'Editor.executeWidgetCommand': executeWidgetCommand,
|
|
10519
10517
|
'Editor.findAllReferences': findAllReferences$1,
|
|
10520
10518
|
'Editor.format': format,
|
|
10519
|
+
'Editor.getDiagnostics': getDiagnostics$1,
|
|
10521
10520
|
'Editor.getKeyBindings': getKeyBindings,
|
|
10522
10521
|
'Editor.getKeys': getKeys,
|
|
10523
10522
|
'Editor.getLanguageId': getLanguageId,
|
|
10524
10523
|
'Editor.getLines2': getLines2,
|
|
10525
10524
|
'Editor.getMenuEntries': getMenuEntries,
|
|
10526
10525
|
'Editor.getMenuEntries2': getMenuEntries,
|
|
10526
|
+
'Editor.getMenuIds': getMenuIds,
|
|
10527
10527
|
'Editor.getOffsetAtCursor': getOffsetAtCursor,
|
|
10528
10528
|
'Editor.getPositionAtCursor': getPositionAtCursor,
|
|
10529
|
-
'Editor.getSourceActions': getSourceActions,
|
|
10530
10529
|
'Editor.getProblems': getProblems,
|
|
10531
10530
|
'Editor.getQuickPickMenuEntries': getQuickPickMenuEntries,
|
|
10532
10531
|
'Editor.getSelections': getSelections,
|
|
10533
10532
|
'Editor.getSelections2': getSelections2,
|
|
10534
|
-
'Editor.
|
|
10533
|
+
'Editor.getSourceActions': getSourceActions,
|
|
10535
10534
|
'Editor.getText': getText,
|
|
10536
10535
|
'Editor.getUri': getUri,
|
|
10537
10536
|
'Editor.getWordAt': getWordAt$1,
|
|
@@ -10544,6 +10543,7 @@ const commandMap = {
|
|
|
10544
10543
|
'Editor.handleBeforeInput': handleBeforeInput,
|
|
10545
10544
|
'Editor.handleBeforeInputFromContentEditable': handleBeforeInputFromContentEditable,
|
|
10546
10545
|
'Editor.handleBlur': handleBlur$1,
|
|
10546
|
+
'Editor.handleClickAtPosition': handleClickAtPosition,
|
|
10547
10547
|
'Editor.handleContextMenu': handleContextMenu,
|
|
10548
10548
|
'Editor.handleDoubleClick': handleDoubleClick,
|
|
10549
10549
|
'Editor.handleFocus': handleFocus$1,
|
|
@@ -10566,6 +10566,7 @@ const commandMap = {
|
|
|
10566
10566
|
'Editor.handleTouchMove': handleTouchMove,
|
|
10567
10567
|
'Editor.handleTouchStart': handleTouchStart,
|
|
10568
10568
|
'Editor.handleTripleClick': handleTripleClick,
|
|
10569
|
+
'Editor.hotReload': hotReload,
|
|
10569
10570
|
'Editor.indendLess': indentLess,
|
|
10570
10571
|
'Editor.indentMore': indentMore,
|
|
10571
10572
|
'Editor.insertLineBreak': insertLineBreak,
|
|
@@ -10624,7 +10625,6 @@ const commandMap = {
|
|
|
10624
10625
|
'Editor.toggleComment': toggleComment,
|
|
10625
10626
|
'Editor.toggleLineComment': editorToggleLineComment,
|
|
10626
10627
|
'Editor.type': type,
|
|
10627
|
-
'Editor.hotReload': hotReload,
|
|
10628
10628
|
'Editor.typeWithAutoClosing': typeWithAutoClosing,
|
|
10629
10629
|
'Editor.undo': undo,
|
|
10630
10630
|
'Editor.unIndent': editorUnindent,
|
|
@@ -10640,12 +10640,15 @@ const commandMap = {
|
|
|
10640
10640
|
'EditorCompletion.handleEditorClick': handleEditorClick,
|
|
10641
10641
|
'EditorCompletion.handleEditorDeleteLeft': handleEditorDeleteLeft$1,
|
|
10642
10642
|
'EditorCompletion.handleEditorType': handleEditorType$1,
|
|
10643
|
+
'EditorCompletion.handlePointerDown': handlePointerDown,
|
|
10643
10644
|
'EditorCompletion.handleWheel': handleWheel$1,
|
|
10644
10645
|
'EditorCompletion.openDetails': openDetails,
|
|
10645
10646
|
'EditorCompletion.selectCurrent': selectCurrent$1,
|
|
10646
10647
|
'EditorCompletion.selectIndex': selectIndex$1,
|
|
10647
10648
|
'EditorCompletion.toggleDetails': toggleDetails$1,
|
|
10648
|
-
'
|
|
10649
|
+
'EditorRename.accept': accept,
|
|
10650
|
+
'EditorRename.close': close$2,
|
|
10651
|
+
'EditorRename.handleInput': handleInput,
|
|
10649
10652
|
'EditorSourceAction.close': close$1,
|
|
10650
10653
|
'EditorSourceAction.closeDetails': closeDetails,
|
|
10651
10654
|
'EditorSourceAction.focusFirst': focusFirst,
|
|
@@ -10657,38 +10660,36 @@ const commandMap = {
|
|
|
10657
10660
|
'EditorSourceAction.selectIndex': selectIndex,
|
|
10658
10661
|
'EditorSourceAction.selectItem': selectItem,
|
|
10659
10662
|
'EditorSourceAction.toggleDetails': toggleDetails,
|
|
10660
|
-
'EditorRename.accept': accept,
|
|
10661
|
-
'EditorRename.close': close$2,
|
|
10662
|
-
'EditorRename.handleInput': handleInput,
|
|
10663
10663
|
'EditorSourceActions.focusNext': focusNext$1,
|
|
10664
|
+
'ExtensionHostManagement.activateByEvent': activateByEvent,
|
|
10664
10665
|
'FindWidget.close': close$3,
|
|
10665
10666
|
'FindWidget.focusCloseButton': focusCloseButton,
|
|
10666
10667
|
'FindWidget.focusFind': focusFind,
|
|
10667
10668
|
'FindWidget.focusNext': focusNext$2,
|
|
10669
|
+
'FindWidget.focusNextElement': focusNextElement,
|
|
10668
10670
|
'FindWidget.focusNextMatchButton': focusNextMatchButton,
|
|
10669
10671
|
'FindWidget.focusPrevious': focusPrevious$1,
|
|
10672
|
+
'FindWidget.focusPreviousElement': focusPreviousElement,
|
|
10670
10673
|
'FindWidget.focusPreviousMatchButton': focusPreviousMatchButton,
|
|
10671
10674
|
'FindWidget.focusReplace': focusReplace,
|
|
10672
10675
|
'FindWidget.focusReplaceAllButton': focusReplaceAllButton,
|
|
10673
10676
|
'FindWidget.focusReplaceButton': focusReplaceButton,
|
|
10674
10677
|
'FindWidget.focusToggleReplace': focusToggleReplace,
|
|
10675
|
-
'FindWidget.replace': replace,
|
|
10676
|
-
'FindWidget.replaceAll': replaceAll,
|
|
10677
10678
|
'FindWidget.handleBlur': handleBlur,
|
|
10678
|
-
'FindWidget.handleFocus': handleFocus,
|
|
10679
10679
|
'FindWidget.handleClickButton': handleClickButton,
|
|
10680
|
+
'FindWidget.handleFocus': handleFocus,
|
|
10680
10681
|
'FindWidget.handleInput': handleInput$1,
|
|
10681
10682
|
'FindWidget.handleReplaceFocus': handleReplaceFocus,
|
|
10682
10683
|
'FindWidget.handleReplaceInput': handleReplaceInput,
|
|
10683
10684
|
'FindWidget.handleToggleReplaceFocus': handleToggleReplaceFocus,
|
|
10685
|
+
'FindWidget.loadContent': loadContent$1,
|
|
10686
|
+
'FindWidget.replace': replace,
|
|
10687
|
+
'FindWidget.replaceAll': replaceAll,
|
|
10684
10688
|
'FindWidget.toggleMatchCase': toggleMatchCase,
|
|
10685
10689
|
'FindWidget.toggleMatchWholeWord': toggleMatchWholeWord,
|
|
10686
|
-
'FindWidget.
|
|
10690
|
+
'FindWidget.togglePreserveCase': togglePreserveCase,
|
|
10687
10691
|
'FindWidget.toggleReplace': toggleReplace,
|
|
10688
10692
|
'FindWidget.toggleUseRegularExpression': toggleUseRegularExpression,
|
|
10689
|
-
'FindWidget.focusNextElement': focusNextElement,
|
|
10690
|
-
'FindWidget.focusPreviousElement': focusPreviousElement,
|
|
10691
|
-
'FindWidget.togglePreserveCase': togglePreserveCase,
|
|
10692
10693
|
'Font.ensure': ensure,
|
|
10693
10694
|
'HandleMessagePort.handleMessagePort': handleMessagePort,
|
|
10694
10695
|
'Hover.getHoverInfo': getEditorHoverInfo,
|
|
@@ -10732,51 +10733,51 @@ const getCodeGeneratorVirtualDom = state => {
|
|
|
10732
10733
|
const escapeToClose$1 = escapeToClose();
|
|
10733
10734
|
const enterCode$1 = enterCode();
|
|
10734
10735
|
return [{
|
|
10735
|
-
|
|
10736
|
+
childCount: 2,
|
|
10736
10737
|
className: mergeClassNames(Viewlet, CodeGeneratorWidget),
|
|
10737
|
-
|
|
10738
|
+
type: Div
|
|
10738
10739
|
}, {
|
|
10739
|
-
type: Input,
|
|
10740
|
-
className: mergeClassNames(CodeGeneratorInput$1, InputBox),
|
|
10741
10740
|
childCount: 0,
|
|
10741
|
+
className: mergeClassNames(CodeGeneratorInput$1, InputBox),
|
|
10742
|
+
name: CodeGeneratorInput,
|
|
10742
10743
|
placeholder: enterCode$1,
|
|
10743
|
-
|
|
10744
|
+
type: Input
|
|
10744
10745
|
}, {
|
|
10745
|
-
|
|
10746
|
+
childCount: 1,
|
|
10746
10747
|
className: CodeGeneratorMessage,
|
|
10747
|
-
|
|
10748
|
+
type: Div
|
|
10748
10749
|
}, text(escapeToClose$1)];
|
|
10749
10750
|
};
|
|
10750
10751
|
|
|
10751
10752
|
const renderContent$1 = {
|
|
10752
|
-
isEqual(oldState, newState) {
|
|
10753
|
-
return oldState.questions === newState.questions;
|
|
10754
|
-
},
|
|
10755
10753
|
apply(oldState, newState) {
|
|
10756
10754
|
const dom = getCodeGeneratorVirtualDom();
|
|
10757
10755
|
return [SetDom2, newState.uid, dom];
|
|
10756
|
+
},
|
|
10757
|
+
isEqual(oldState, newState) {
|
|
10758
|
+
return oldState.questions === newState.questions;
|
|
10758
10759
|
}
|
|
10759
10760
|
};
|
|
10760
10761
|
const renderBounds$1 = {
|
|
10761
|
-
isEqual(oldState, newState) {
|
|
10762
|
-
return oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height;
|
|
10763
|
-
},
|
|
10764
10762
|
apply(oldState, newState) {
|
|
10765
10763
|
const {
|
|
10766
|
-
|
|
10767
|
-
y,
|
|
10764
|
+
height,
|
|
10768
10765
|
width,
|
|
10769
|
-
|
|
10766
|
+
x,
|
|
10767
|
+
y
|
|
10770
10768
|
} = newState;
|
|
10771
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;
|
|
10772
10773
|
}
|
|
10773
10774
|
};
|
|
10774
10775
|
const renderFocus = {
|
|
10775
|
-
isEqual(oldState, newState) {
|
|
10776
|
-
return oldState.focused === newState.focused && oldState.focusSource === newState.focusSource;
|
|
10777
|
-
},
|
|
10778
10776
|
apply(oldState, newState) {
|
|
10779
10777
|
return [Focus, '.CodeGeneratorInput', newState.focusSource];
|
|
10778
|
+
},
|
|
10779
|
+
isEqual(oldState, newState) {
|
|
10780
|
+
return oldState.focused === newState.focused && oldState.focusSource === newState.focusSource;
|
|
10780
10781
|
}
|
|
10781
10782
|
};
|
|
10782
10783
|
const render$5 = [renderContent$1, renderBounds$1, renderFocus];
|
|
@@ -10856,22 +10857,22 @@ const EditorColorPickerWidget = {
|
|
|
10856
10857
|
|
|
10857
10858
|
const getCompletionDetailVirtualDom = content => {
|
|
10858
10859
|
const dom = [{
|
|
10859
|
-
|
|
10860
|
+
childCount: 2,
|
|
10860
10861
|
className: 'Viewlet EditorCompletionDetails',
|
|
10861
|
-
|
|
10862
|
+
type: Div
|
|
10862
10863
|
}, {
|
|
10863
|
-
|
|
10864
|
+
childCount: 1,
|
|
10864
10865
|
className: CompletionDetailContent,
|
|
10865
|
-
|
|
10866
|
+
type: Div
|
|
10866
10867
|
}, text(content), {
|
|
10867
|
-
|
|
10868
|
+
childCount: 1,
|
|
10868
10869
|
className: CompletionDetailCloseButton,
|
|
10869
10870
|
onClick: HandleClose,
|
|
10870
|
-
|
|
10871
|
+
type: Div
|
|
10871
10872
|
}, {
|
|
10872
|
-
|
|
10873
|
+
childCount: 0,
|
|
10873
10874
|
className: `${MaskIcon} ${IconClose}`,
|
|
10874
|
-
|
|
10875
|
+
type: Div
|
|
10875
10876
|
}];
|
|
10876
10877
|
return dom;
|
|
10877
10878
|
};
|
|
@@ -10887,26 +10888,26 @@ const renderParts = (render, oldState, newState) => {
|
|
|
10887
10888
|
};
|
|
10888
10889
|
|
|
10889
10890
|
const renderContent = {
|
|
10890
|
-
isEqual(oldState, newState) {
|
|
10891
|
-
return oldState.content === newState.content;
|
|
10892
|
-
},
|
|
10893
10891
|
apply(oldState, newState) {
|
|
10894
10892
|
const dom = getCompletionDetailVirtualDom(newState.content);
|
|
10895
10893
|
return [SetDom2, newState.uid, dom];
|
|
10894
|
+
},
|
|
10895
|
+
isEqual(oldState, newState) {
|
|
10896
|
+
return oldState.content === newState.content;
|
|
10896
10897
|
}
|
|
10897
10898
|
};
|
|
10898
10899
|
const renderBounds = {
|
|
10899
|
-
isEqual(oldState, newState) {
|
|
10900
|
-
return oldState.x === newState.x && oldState.y === newState.y && oldState.width === newState.width && oldState.height === newState.height;
|
|
10901
|
-
},
|
|
10902
10900
|
apply(oldState, newState) {
|
|
10903
10901
|
const {
|
|
10904
|
-
|
|
10905
|
-
y,
|
|
10902
|
+
height,
|
|
10906
10903
|
width,
|
|
10907
|
-
|
|
10904
|
+
x,
|
|
10905
|
+
y
|
|
10908
10906
|
} = newState;
|
|
10909
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;
|
|
10910
10911
|
}
|
|
10911
10912
|
};
|
|
10912
10913
|
const render$2 = [renderContent, renderBounds];
|