@lvce-editor/problems-view 1.13.0 → 1.14.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/problemsViewWorkerMain.js +282 -234
- package/package.json +1 -1
|
@@ -1072,10 +1072,11 @@ const create$2 = () => {
|
|
|
1072
1072
|
wrapCommand(fn) {
|
|
1073
1073
|
const wrapped = async (uid, ...args) => {
|
|
1074
1074
|
const {
|
|
1075
|
+
oldState,
|
|
1075
1076
|
newState
|
|
1076
1077
|
} = states[uid];
|
|
1077
1078
|
const newerState = await fn(newState, ...args);
|
|
1078
|
-
if (newState === newerState) {
|
|
1079
|
+
if (oldState === newerState || newState === newerState) {
|
|
1079
1080
|
return;
|
|
1080
1081
|
}
|
|
1081
1082
|
const latest = states[uid];
|
|
@@ -1146,6 +1147,8 @@ const UpArrow = 14;
|
|
|
1146
1147
|
const RightArrow = 15;
|
|
1147
1148
|
const DownArrow = 16;
|
|
1148
1149
|
|
|
1150
|
+
const Script$1 = 2;
|
|
1151
|
+
|
|
1149
1152
|
const DebugWorker = 55;
|
|
1150
1153
|
const EditorWorker$1 = 99;
|
|
1151
1154
|
const RendererWorker$1 = 1;
|
|
@@ -1298,9 +1301,20 @@ const searchFileHtml = async uri => {
|
|
|
1298
1301
|
const getFilePathElectron = async file => {
|
|
1299
1302
|
return invoke('FileSystemHandle.getFilePathElectron', file);
|
|
1300
1303
|
};
|
|
1304
|
+
/**
|
|
1305
|
+
* @deprecated
|
|
1306
|
+
*/
|
|
1301
1307
|
const showContextMenu = async (x, y, id, ...args) => {
|
|
1302
1308
|
return invoke('ContextMenu.show', x, y, id, ...args);
|
|
1303
1309
|
};
|
|
1310
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1311
|
+
number(uid);
|
|
1312
|
+
number(menuId);
|
|
1313
|
+
number(x);
|
|
1314
|
+
number(y);
|
|
1315
|
+
// @ts-ignore
|
|
1316
|
+
await invoke('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1317
|
+
};
|
|
1304
1318
|
const getElectronVersion = async () => {
|
|
1305
1319
|
return invoke('Process.getElectronVersion');
|
|
1306
1320
|
};
|
|
@@ -1348,6 +1362,11 @@ const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
|
1348
1362
|
// @ts-ignore
|
|
1349
1363
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1350
1364
|
};
|
|
1365
|
+
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1366
|
+
const command = 'IconTheme.handleMessagePort';
|
|
1367
|
+
// @ts-ignore
|
|
1368
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1369
|
+
};
|
|
1351
1370
|
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1352
1371
|
const command = 'FileSystem.handleMessagePort';
|
|
1353
1372
|
// @ts-ignore
|
|
@@ -1387,6 +1406,9 @@ const handleDebugChange = async params => {
|
|
|
1387
1406
|
const getFolderIcon = async options => {
|
|
1388
1407
|
return invoke('IconTheme.getFolderIcon', options);
|
|
1389
1408
|
};
|
|
1409
|
+
const handleWorkspaceRefresh = async () => {
|
|
1410
|
+
return invoke('Layout.handleWorkspaceRefresh');
|
|
1411
|
+
};
|
|
1390
1412
|
const closeWidget = async widgetId => {
|
|
1391
1413
|
return invoke('Viewlet.closeWidget', widgetId);
|
|
1392
1414
|
};
|
|
@@ -1411,6 +1433,9 @@ const getKeyBindings$1 = async () => {
|
|
|
1411
1433
|
const writeClipBoardText$1 = async text => {
|
|
1412
1434
|
await invoke('ClipBoard.writeText', /* text */text);
|
|
1413
1435
|
};
|
|
1436
|
+
const readClipBoardText = async () => {
|
|
1437
|
+
return invoke('ClipBoard.readText');
|
|
1438
|
+
};
|
|
1414
1439
|
const writeClipBoardImage = async blob => {
|
|
1415
1440
|
// @ts-ignore
|
|
1416
1441
|
await invoke('ClipBoard.writeImage', /* text */blob);
|
|
@@ -1454,6 +1479,20 @@ const sendMessagePortToRendererProcess = async port => {
|
|
|
1454
1479
|
// @ts-ignore
|
|
1455
1480
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1456
1481
|
};
|
|
1482
|
+
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1483
|
+
const command = 'TextMeasurement.handleMessagePort';
|
|
1484
|
+
// @ts-ignore
|
|
1485
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1486
|
+
};
|
|
1487
|
+
const sendMessagePortToSourceControlWorker = async port => {
|
|
1488
|
+
const command = 'SourceControl.handleMessagePort';
|
|
1489
|
+
// @ts-ignore
|
|
1490
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1491
|
+
};
|
|
1492
|
+
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1493
|
+
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1494
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1495
|
+
};
|
|
1457
1496
|
const getPreference = async key => {
|
|
1458
1497
|
return await invoke('Preferences.get', key);
|
|
1459
1498
|
};
|
|
@@ -1525,7 +1564,7 @@ const openExtensionSearch = async () => {
|
|
|
1525
1564
|
};
|
|
1526
1565
|
const setExtensionsSearchValue = async searchValue => {
|
|
1527
1566
|
// @ts-ignore
|
|
1528
|
-
return invoke('Extensions.handleInput', searchValue);
|
|
1567
|
+
return invoke('Extensions.handleInput', searchValue, Script$1);
|
|
1529
1568
|
};
|
|
1530
1569
|
const openExternal = async uri => {
|
|
1531
1570
|
// @ts-ignore
|
|
@@ -1547,6 +1586,9 @@ const getLogsDir = async () => {
|
|
|
1547
1586
|
// @ts-ignore
|
|
1548
1587
|
return invoke('PlatformPaths.getLogsDir');
|
|
1549
1588
|
};
|
|
1589
|
+
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1590
|
+
return invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1591
|
+
};
|
|
1550
1592
|
const registerMockRpc = commandMap => {
|
|
1551
1593
|
const mockRpc = createMockRpc({
|
|
1552
1594
|
commandMap
|
|
@@ -1593,15 +1635,18 @@ const RendererWorker = {
|
|
|
1593
1635
|
handleDebugPaused,
|
|
1594
1636
|
handleDebugResumed,
|
|
1595
1637
|
handleDebugScriptParsed,
|
|
1638
|
+
handleWorkspaceRefresh,
|
|
1596
1639
|
installExtension,
|
|
1597
1640
|
invoke,
|
|
1598
1641
|
invokeAndTransfer,
|
|
1642
|
+
measureTextBlockHeight,
|
|
1599
1643
|
openExtensionSearch,
|
|
1600
1644
|
openExternal,
|
|
1601
1645
|
openNativeFolder,
|
|
1602
1646
|
openUri,
|
|
1603
1647
|
openUrl,
|
|
1604
1648
|
openWidget,
|
|
1649
|
+
readClipBoardText,
|
|
1605
1650
|
readFile,
|
|
1606
1651
|
registerMockRpc,
|
|
1607
1652
|
registerWebViewInterceptor,
|
|
@@ -1613,11 +1658,15 @@ const RendererWorker = {
|
|
|
1613
1658
|
sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
|
|
1614
1659
|
sendMessagePortToErrorWorker,
|
|
1615
1660
|
sendMessagePortToExtensionHostWorker,
|
|
1661
|
+
sendMessagePortToFileSystemProcess,
|
|
1616
1662
|
sendMessagePortToFileSystemWorker,
|
|
1663
|
+
sendMessagePortToIconThemeWorker,
|
|
1617
1664
|
sendMessagePortToMarkdownWorker,
|
|
1618
1665
|
sendMessagePortToRendererProcess,
|
|
1619
1666
|
sendMessagePortToSearchProcess,
|
|
1667
|
+
sendMessagePortToSourceControlWorker,
|
|
1620
1668
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1669
|
+
sendMessagePortToTextMeasurementWorker,
|
|
1621
1670
|
set: set$3,
|
|
1622
1671
|
setAdditionalFocus,
|
|
1623
1672
|
setColorTheme,
|
|
@@ -1626,6 +1675,7 @@ const RendererWorker = {
|
|
|
1626
1675
|
setWebViewPort,
|
|
1627
1676
|
setWorkspacePath,
|
|
1628
1677
|
showContextMenu,
|
|
1678
|
+
showContextMenu2,
|
|
1629
1679
|
showErrorDialog,
|
|
1630
1680
|
showMessageBox,
|
|
1631
1681
|
showSaveFilePicker,
|
|
@@ -1636,9 +1686,9 @@ const RendererWorker = {
|
|
|
1636
1686
|
};
|
|
1637
1687
|
|
|
1638
1688
|
const {
|
|
1689
|
+
sendMessagePortToEditorWorker,
|
|
1639
1690
|
set: set$2,
|
|
1640
|
-
writeClipBoardText
|
|
1641
|
-
sendMessagePortToEditorWorker
|
|
1691
|
+
writeClipBoardText
|
|
1642
1692
|
} = RendererWorker;
|
|
1643
1693
|
|
|
1644
1694
|
const writeText = async text => {
|
|
@@ -1647,8 +1697,8 @@ const writeText = async text => {
|
|
|
1647
1697
|
|
|
1648
1698
|
const copyMessage = async state => {
|
|
1649
1699
|
const {
|
|
1650
|
-
|
|
1651
|
-
|
|
1700
|
+
focusedIndex,
|
|
1701
|
+
problems
|
|
1652
1702
|
} = state;
|
|
1653
1703
|
const problem = problems[focusedIndex];
|
|
1654
1704
|
await writeText(problem.message);
|
|
@@ -1670,25 +1720,25 @@ const List = 2;
|
|
|
1670
1720
|
|
|
1671
1721
|
const create = (id, uri, x, y, width, height, workspaceUri) => {
|
|
1672
1722
|
const state = {
|
|
1673
|
-
|
|
1674
|
-
|
|
1723
|
+
collapsedUris: [],
|
|
1724
|
+
filteredProblems: [],
|
|
1725
|
+
filterValue: '',
|
|
1675
1726
|
focusedIndex: -2,
|
|
1676
|
-
message: '',
|
|
1677
|
-
itemHeight: 22,
|
|
1678
|
-
x,
|
|
1679
|
-
y,
|
|
1680
|
-
width,
|
|
1681
1727
|
height,
|
|
1682
|
-
filterValue: '',
|
|
1683
|
-
viewMode: None,
|
|
1684
1728
|
inputSource: User,
|
|
1685
|
-
|
|
1686
|
-
maxLineY: 0,
|
|
1729
|
+
itemHeight: 22,
|
|
1687
1730
|
listItems: [],
|
|
1688
|
-
|
|
1731
|
+
maxLineY: 0,
|
|
1732
|
+
message: '',
|
|
1733
|
+
minLineY: 0,
|
|
1734
|
+
problems: [],
|
|
1689
1735
|
smallWidthBreakPoint: 650,
|
|
1690
|
-
|
|
1691
|
-
|
|
1736
|
+
uid: id,
|
|
1737
|
+
viewMode: None,
|
|
1738
|
+
width,
|
|
1739
|
+
workspaceUri,
|
|
1740
|
+
x,
|
|
1741
|
+
y
|
|
1692
1742
|
};
|
|
1693
1743
|
set$1(id, state, state);
|
|
1694
1744
|
};
|
|
@@ -1720,8 +1770,8 @@ const diff = (oldState, newState) => {
|
|
|
1720
1770
|
|
|
1721
1771
|
const diff2 = uid => {
|
|
1722
1772
|
const {
|
|
1723
|
-
|
|
1724
|
-
|
|
1773
|
+
newState,
|
|
1774
|
+
oldState
|
|
1725
1775
|
} = get(uid);
|
|
1726
1776
|
const diffResult = diff(oldState, newState);
|
|
1727
1777
|
return diffResult;
|
|
@@ -1762,48 +1812,48 @@ const FocusProblems = 19;
|
|
|
1762
1812
|
|
|
1763
1813
|
const getKeyBindings = () => {
|
|
1764
1814
|
return [{
|
|
1765
|
-
key: DownArrow,
|
|
1766
1815
|
command: 'Problems.focusNext',
|
|
1816
|
+
key: DownArrow,
|
|
1767
1817
|
when: FocusProblems
|
|
1768
1818
|
}, {
|
|
1769
|
-
key: UpArrow,
|
|
1770
1819
|
command: 'Problems.focusPrevious',
|
|
1820
|
+
key: UpArrow,
|
|
1771
1821
|
when: FocusProblems
|
|
1772
1822
|
}, {
|
|
1773
|
-
key: Home,
|
|
1774
1823
|
command: 'Problems.focusFirst',
|
|
1824
|
+
key: Home,
|
|
1775
1825
|
when: FocusProblems
|
|
1776
1826
|
}, {
|
|
1777
|
-
key: PageUp,
|
|
1778
1827
|
command: 'Problems.focusFirst',
|
|
1828
|
+
key: PageUp,
|
|
1779
1829
|
when: FocusProblems
|
|
1780
1830
|
}, {
|
|
1781
|
-
key: PageDown,
|
|
1782
1831
|
command: 'Problems.focusLast',
|
|
1832
|
+
key: PageDown,
|
|
1783
1833
|
when: FocusProblems
|
|
1784
1834
|
}, {
|
|
1785
|
-
key: End,
|
|
1786
1835
|
command: 'Problems.focusLast',
|
|
1836
|
+
key: End,
|
|
1787
1837
|
when: FocusProblems
|
|
1788
1838
|
}, {
|
|
1789
|
-
key: Space,
|
|
1790
1839
|
command: 'Problems.selectCurrent',
|
|
1840
|
+
key: Space,
|
|
1791
1841
|
when: FocusProblems
|
|
1792
1842
|
}, {
|
|
1793
|
-
key: Home,
|
|
1794
1843
|
command: 'Problems.focusFirst',
|
|
1844
|
+
key: Home,
|
|
1795
1845
|
when: FocusProblems
|
|
1796
1846
|
}, {
|
|
1797
|
-
key: End,
|
|
1798
1847
|
command: 'Problems.focusLast',
|
|
1848
|
+
key: End,
|
|
1799
1849
|
when: FocusProblems
|
|
1800
1850
|
}, {
|
|
1801
|
-
key: LeftArrow,
|
|
1802
1851
|
command: 'Problems.handleArrowLeft',
|
|
1852
|
+
key: LeftArrow,
|
|
1803
1853
|
when: FocusProblems
|
|
1804
1854
|
}, {
|
|
1805
|
-
key: RightArrow,
|
|
1806
1855
|
command: 'Problems.handleArrowRight',
|
|
1856
|
+
key: RightArrow,
|
|
1807
1857
|
when: FocusProblems
|
|
1808
1858
|
}];
|
|
1809
1859
|
};
|
|
@@ -1829,9 +1879,9 @@ const getArrowLeftNewFocusedIndex = (problems, collapsedUris, focusedIndex) => {
|
|
|
1829
1879
|
};
|
|
1830
1880
|
const handleArrowLeft = state => {
|
|
1831
1881
|
const {
|
|
1832
|
-
|
|
1882
|
+
collapsedUris,
|
|
1833
1883
|
focusedIndex,
|
|
1834
|
-
|
|
1884
|
+
problems
|
|
1835
1885
|
} = state;
|
|
1836
1886
|
const {
|
|
1837
1887
|
index,
|
|
@@ -1839,8 +1889,8 @@ const handleArrowLeft = state => {
|
|
|
1839
1889
|
} = getArrowLeftNewFocusedIndex(problems, collapsedUris, focusedIndex);
|
|
1840
1890
|
return {
|
|
1841
1891
|
...state,
|
|
1842
|
-
|
|
1843
|
-
|
|
1892
|
+
collapsedUris: newCollapsedUris,
|
|
1893
|
+
focusedIndex: index
|
|
1844
1894
|
};
|
|
1845
1895
|
};
|
|
1846
1896
|
|
|
@@ -1862,9 +1912,9 @@ const getArrowRightNewFocusedIndex = (problems, collapsedUris, focusedIndex) =>
|
|
|
1862
1912
|
};
|
|
1863
1913
|
const handleArrowRight = state => {
|
|
1864
1914
|
const {
|
|
1865
|
-
|
|
1915
|
+
collapsedUris,
|
|
1866
1916
|
focusedIndex,
|
|
1867
|
-
|
|
1917
|
+
problems
|
|
1868
1918
|
} = state;
|
|
1869
1919
|
const {
|
|
1870
1920
|
index,
|
|
@@ -1872,8 +1922,8 @@ const handleArrowRight = state => {
|
|
|
1872
1922
|
} = getArrowRightNewFocusedIndex(problems, collapsedUris, focusedIndex);
|
|
1873
1923
|
return {
|
|
1874
1924
|
...state,
|
|
1875
|
-
|
|
1876
|
-
|
|
1925
|
+
collapsedUris: newCollapsedUris,
|
|
1926
|
+
focusedIndex: index
|
|
1877
1927
|
};
|
|
1878
1928
|
};
|
|
1879
1929
|
|
|
@@ -1885,10 +1935,10 @@ const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight) => {
|
|
|
1885
1935
|
|
|
1886
1936
|
const handleClickAt = (state, eventX, eventY) => {
|
|
1887
1937
|
const {
|
|
1938
|
+
itemHeight,
|
|
1888
1939
|
problems,
|
|
1889
1940
|
x,
|
|
1890
|
-
y
|
|
1891
|
-
itemHeight
|
|
1941
|
+
y
|
|
1892
1942
|
} = state;
|
|
1893
1943
|
|
|
1894
1944
|
// TODO use functional focus rendering
|
|
@@ -1911,8 +1961,6 @@ const handleClickButton = async (state, name) => {
|
|
|
1911
1961
|
};
|
|
1912
1962
|
|
|
1913
1963
|
const handleContextMenu = async (state, eventX, eventY) => {
|
|
1914
|
-
// @ts-ignore
|
|
1915
|
-
// await ContextMenu.show(eventX, eventY, MenuEntryId.Problems)
|
|
1916
1964
|
return state;
|
|
1917
1965
|
};
|
|
1918
1966
|
|
|
@@ -1947,8 +1995,8 @@ const createEditorWorkerRpc = async () => {
|
|
|
1947
1995
|
};
|
|
1948
1996
|
|
|
1949
1997
|
const {
|
|
1950
|
-
|
|
1951
|
-
|
|
1998
|
+
getProblems: getProblems$1,
|
|
1999
|
+
set
|
|
1952
2000
|
} = EditorWorker;
|
|
1953
2001
|
|
|
1954
2002
|
const initialize = async () => {
|
|
@@ -1958,29 +2006,29 @@ const initialize = async () => {
|
|
|
1958
2006
|
|
|
1959
2007
|
const toProblem = (diagnostic, index) => {
|
|
1960
2008
|
const {
|
|
2009
|
+
code,
|
|
2010
|
+
columnIndex,
|
|
1961
2011
|
message,
|
|
1962
2012
|
rowIndex,
|
|
1963
|
-
columnIndex,
|
|
1964
2013
|
source,
|
|
1965
|
-
code,
|
|
1966
2014
|
type,
|
|
1967
2015
|
uri
|
|
1968
2016
|
} = diagnostic;
|
|
1969
2017
|
return {
|
|
1970
|
-
|
|
1971
|
-
rowIndex: rowIndex || 0,
|
|
2018
|
+
code: code || '',
|
|
1972
2019
|
columnIndex: columnIndex || 0,
|
|
1973
|
-
uri,
|
|
1974
|
-
relativePath: '',
|
|
1975
2020
|
count: 0,
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
type: type || 'error',
|
|
2021
|
+
fileName: '',
|
|
2022
|
+
level: 2,
|
|
1979
2023
|
listItemType: Item,
|
|
2024
|
+
message: message || '',
|
|
1980
2025
|
posInSet: index,
|
|
2026
|
+
relativePath: '',
|
|
2027
|
+
rowIndex: rowIndex || 0,
|
|
1981
2028
|
setSize: 1,
|
|
1982
|
-
|
|
1983
|
-
|
|
2029
|
+
source: source || '',
|
|
2030
|
+
type: type || 'error',
|
|
2031
|
+
uri
|
|
1984
2032
|
};
|
|
1985
2033
|
};
|
|
1986
2034
|
const getRelativeParentUri = (uri, workspaceUri) => {
|
|
@@ -1994,20 +2042,20 @@ const getFileName = uri => {
|
|
|
1994
2042
|
const toProblems = (diagnostics, workspaceUri = '') => {
|
|
1995
2043
|
const problems = [];
|
|
1996
2044
|
let problem = {
|
|
1997
|
-
|
|
1998
|
-
rowIndex: 0,
|
|
2045
|
+
code: '',
|
|
1999
2046
|
columnIndex: 0,
|
|
2000
|
-
uri: '',
|
|
2001
|
-
relativePath: '',
|
|
2002
2047
|
count: 0,
|
|
2003
|
-
|
|
2004
|
-
code: '',
|
|
2048
|
+
fileName: '',
|
|
2005
2049
|
level: 0,
|
|
2006
2050
|
listItemType: 0,
|
|
2051
|
+
message: '',
|
|
2007
2052
|
posInSet: 0,
|
|
2053
|
+
relativePath: '',
|
|
2054
|
+
rowIndex: 0,
|
|
2008
2055
|
setSize: 0,
|
|
2056
|
+
source: '',
|
|
2009
2057
|
type: '',
|
|
2010
|
-
|
|
2058
|
+
uri: ''
|
|
2011
2059
|
};
|
|
2012
2060
|
let relativeIndex = 0;
|
|
2013
2061
|
for (const diagnostic of diagnostics) {
|
|
@@ -2017,20 +2065,20 @@ const toProblems = (diagnostics, workspaceUri = '') => {
|
|
|
2017
2065
|
} else {
|
|
2018
2066
|
relativeIndex = 1;
|
|
2019
2067
|
problem = {
|
|
2020
|
-
|
|
2021
|
-
rowIndex: 0,
|
|
2068
|
+
code: '',
|
|
2022
2069
|
columnIndex: 0,
|
|
2023
|
-
uri: diagnostic.uri,
|
|
2024
|
-
relativePath: '',
|
|
2025
2070
|
count: 1,
|
|
2026
|
-
|
|
2027
|
-
|
|
2071
|
+
fileName: '',
|
|
2072
|
+
level: 1,
|
|
2028
2073
|
listItemType: Expanded,
|
|
2074
|
+
message: '',
|
|
2029
2075
|
posInSet: relativeIndex,
|
|
2076
|
+
relativePath: '',
|
|
2077
|
+
rowIndex: 0,
|
|
2030
2078
|
setSize: 123,
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2079
|
+
source: '',
|
|
2080
|
+
type: '',
|
|
2081
|
+
uri: diagnostic.uri
|
|
2034
2082
|
};
|
|
2035
2083
|
problems.push(problem);
|
|
2036
2084
|
}
|
|
@@ -2055,13 +2103,13 @@ const getProblems = async workspaceUri => {
|
|
|
2055
2103
|
// @ts-ignore
|
|
2056
2104
|
const problems = toProblems(diagnostics, workspaceUri);
|
|
2057
2105
|
return {
|
|
2058
|
-
|
|
2059
|
-
|
|
2106
|
+
error: '',
|
|
2107
|
+
problems
|
|
2060
2108
|
};
|
|
2061
2109
|
} catch (error) {
|
|
2062
2110
|
return {
|
|
2063
|
-
|
|
2064
|
-
|
|
2111
|
+
error: `${error}`,
|
|
2112
|
+
problems: []
|
|
2065
2113
|
};
|
|
2066
2114
|
}
|
|
2067
2115
|
};
|
|
@@ -2168,8 +2216,8 @@ const getSavedCollapsedUris = savedState => {
|
|
|
2168
2216
|
};
|
|
2169
2217
|
const loadContent = async (state, savedState) => {
|
|
2170
2218
|
const {
|
|
2171
|
-
|
|
2172
|
-
|
|
2219
|
+
error,
|
|
2220
|
+
problems
|
|
2173
2221
|
} = await getProblems(state.workspaceUri);
|
|
2174
2222
|
if (error) {
|
|
2175
2223
|
return {
|
|
@@ -2183,14 +2231,14 @@ const loadContent = async (state, savedState) => {
|
|
|
2183
2231
|
const collapsedUris = getSavedCollapsedUris(savedState);
|
|
2184
2232
|
return {
|
|
2185
2233
|
...state,
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
viewMode,
|
|
2234
|
+
collapsedUris,
|
|
2235
|
+
filteredProblems: problems,
|
|
2189
2236
|
filterValue,
|
|
2190
2237
|
inputSource: Script,
|
|
2191
|
-
filteredProblems: problems,
|
|
2192
2238
|
listItems: [],
|
|
2193
|
-
|
|
2239
|
+
message,
|
|
2240
|
+
problems,
|
|
2241
|
+
viewMode
|
|
2194
2242
|
};
|
|
2195
2243
|
};
|
|
2196
2244
|
|
|
@@ -2240,38 +2288,38 @@ const HandlePointerDown = 'handlePointerDown';
|
|
|
2240
2288
|
|
|
2241
2289
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2242
2290
|
return {
|
|
2243
|
-
|
|
2291
|
+
childCount: 0,
|
|
2244
2292
|
className: mergeClassNames('MaskIcon', `MaskIcon${icon}`),
|
|
2245
2293
|
role: None$1,
|
|
2246
|
-
|
|
2294
|
+
type
|
|
2247
2295
|
};
|
|
2248
2296
|
};
|
|
2249
2297
|
|
|
2250
2298
|
const getActionButtonVirtualDom = action => {
|
|
2251
2299
|
const {
|
|
2252
|
-
|
|
2300
|
+
command,
|
|
2253
2301
|
icon,
|
|
2254
|
-
|
|
2302
|
+
id
|
|
2255
2303
|
} = action;
|
|
2256
2304
|
return [{
|
|
2257
|
-
|
|
2305
|
+
childCount: 1,
|
|
2258
2306
|
className: IconButton,
|
|
2259
|
-
title: id,
|
|
2260
2307
|
'data-command': command,
|
|
2261
|
-
|
|
2308
|
+
title: id,
|
|
2309
|
+
type: Button$1
|
|
2262
2310
|
}, getIconVirtualDom(icon)];
|
|
2263
2311
|
};
|
|
2264
2312
|
|
|
2265
2313
|
const getInputBoxVirtualDom = (name, onInput, placeholder) => {
|
|
2266
2314
|
return {
|
|
2267
|
-
type: Input,
|
|
2268
|
-
className: InputBox,
|
|
2269
2315
|
autocapitalize: 'off',
|
|
2270
2316
|
autocorrect: 'off',
|
|
2317
|
+
className: InputBox,
|
|
2271
2318
|
name,
|
|
2272
2319
|
onInput: onInput,
|
|
2273
2320
|
placeholder: placeholder,
|
|
2274
|
-
spellcheck: false
|
|
2321
|
+
spellcheck: false,
|
|
2322
|
+
type: Input
|
|
2275
2323
|
};
|
|
2276
2324
|
};
|
|
2277
2325
|
|
|
@@ -2294,70 +2342,69 @@ const getBadgeDom = badgeText => {
|
|
|
2294
2342
|
return [];
|
|
2295
2343
|
}
|
|
2296
2344
|
return [{
|
|
2297
|
-
|
|
2345
|
+
childCount: 1,
|
|
2298
2346
|
className: FilterBadge,
|
|
2299
|
-
|
|
2347
|
+
type: Div
|
|
2300
2348
|
}, text(badgeText)];
|
|
2301
2349
|
};
|
|
2302
2350
|
const getProblemsFilterVirtualDom = action => {
|
|
2303
2351
|
return [{
|
|
2304
|
-
|
|
2352
|
+
childCount: getChildCount(action.badgeText),
|
|
2305
2353
|
className: Filter$1,
|
|
2306
|
-
|
|
2354
|
+
type: Div
|
|
2307
2355
|
}, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
|
|
2308
|
-
|
|
2309
|
-
// TODO use i18n string
|
|
2356
|
+
command: 'more filters',
|
|
2310
2357
|
icon: Filter,
|
|
2311
|
-
|
|
2358
|
+
id: 'more filters' // TODO use i18n string
|
|
2312
2359
|
})];
|
|
2313
2360
|
};
|
|
2314
2361
|
|
|
2315
2362
|
const getNoResultsWithFilterVirtualDom = () => {
|
|
2316
2363
|
return [{
|
|
2317
|
-
|
|
2364
|
+
childCount: 3,
|
|
2318
2365
|
className: Message,
|
|
2319
|
-
|
|
2366
|
+
type: Div
|
|
2320
2367
|
}, {
|
|
2321
|
-
|
|
2322
|
-
|
|
2368
|
+
childCount: 1,
|
|
2369
|
+
type: Span
|
|
2323
2370
|
}, text(noResultsFoundWithProvidedFilterCriteria()), {
|
|
2324
|
-
type: A,
|
|
2325
|
-
className: MessageAction,
|
|
2326
2371
|
childCount: 1,
|
|
2327
|
-
|
|
2372
|
+
className: MessageAction,
|
|
2373
|
+
onClick: HandleClearFilterClick,
|
|
2374
|
+
type: A
|
|
2328
2375
|
}, text(clearFilter()), text('.')];
|
|
2329
2376
|
};
|
|
2330
2377
|
|
|
2331
2378
|
const getBadgeVirtualDom = (className, count) => {
|
|
2332
2379
|
return [{
|
|
2333
|
-
|
|
2380
|
+
childCount: 1,
|
|
2334
2381
|
className: mergeClassNames('Badge', className) + (''),
|
|
2335
|
-
|
|
2382
|
+
type: Div
|
|
2336
2383
|
}, text(`${count}`)];
|
|
2337
2384
|
};
|
|
2338
2385
|
|
|
2339
2386
|
const getChevronDownVirtualDom = (extraClassName = '') => {
|
|
2340
2387
|
return {
|
|
2341
|
-
|
|
2388
|
+
childCount: 0,
|
|
2342
2389
|
className: mergeClassNames(Chevron, 'MaskIconChevronDown', extraClassName) + (extraClassName === '' ? ' ' : ''),
|
|
2343
|
-
|
|
2390
|
+
type: Div
|
|
2344
2391
|
};
|
|
2345
2392
|
};
|
|
2346
2393
|
const getChevronRightVirtualDom = (extraClassName = '') => {
|
|
2347
2394
|
return {
|
|
2348
|
-
|
|
2395
|
+
childCount: 0,
|
|
2349
2396
|
className: mergeClassNames(Chevron, 'MaskIconChevronRight', extraClassName) + (extraClassName === '' ? ' ' : ''),
|
|
2350
|
-
|
|
2397
|
+
type: Div
|
|
2351
2398
|
};
|
|
2352
2399
|
};
|
|
2353
2400
|
|
|
2354
2401
|
const getFileIconVirtualDom = icon => {
|
|
2355
2402
|
return {
|
|
2356
|
-
|
|
2403
|
+
childCount: 0,
|
|
2357
2404
|
className: FileIcon,
|
|
2358
|
-
src: icon,
|
|
2359
2405
|
role: None$1,
|
|
2360
|
-
|
|
2406
|
+
src: icon,
|
|
2407
|
+
type: Img
|
|
2361
2408
|
};
|
|
2362
2409
|
};
|
|
2363
2410
|
|
|
@@ -2366,15 +2413,15 @@ const Warning = 'warning';
|
|
|
2366
2413
|
const getProblemsIconVirtualDom = type => {
|
|
2367
2414
|
if (type === Warning) {
|
|
2368
2415
|
return {
|
|
2369
|
-
|
|
2416
|
+
childCount: 0,
|
|
2370
2417
|
className: mergeClassNames(ProblemsIcon, ProblemsWarningIcon),
|
|
2371
|
-
|
|
2418
|
+
type: Div
|
|
2372
2419
|
};
|
|
2373
2420
|
}
|
|
2374
2421
|
return {
|
|
2375
|
-
|
|
2422
|
+
childCount: 0,
|
|
2376
2423
|
className: mergeClassNames(ProblemsIcon, ProblemsErrorIcon),
|
|
2377
|
-
|
|
2424
|
+
type: Div
|
|
2378
2425
|
};
|
|
2379
2426
|
};
|
|
2380
2427
|
|
|
@@ -2400,6 +2447,7 @@ const getProblemVirtualDom = problem => {
|
|
|
2400
2447
|
const {
|
|
2401
2448
|
code,
|
|
2402
2449
|
columnIndex,
|
|
2450
|
+
fileName,
|
|
2403
2451
|
filterValueLength,
|
|
2404
2452
|
icon,
|
|
2405
2453
|
isActive,
|
|
@@ -2413,8 +2461,7 @@ const getProblemVirtualDom = problem => {
|
|
|
2413
2461
|
rowIndex,
|
|
2414
2462
|
setSize,
|
|
2415
2463
|
source,
|
|
2416
|
-
type
|
|
2417
|
-
fileName
|
|
2464
|
+
type
|
|
2418
2465
|
} = problem;
|
|
2419
2466
|
let className = Problem;
|
|
2420
2467
|
if (isActive) {
|
|
@@ -2422,41 +2469,41 @@ const getProblemVirtualDom = problem => {
|
|
|
2422
2469
|
}
|
|
2423
2470
|
if (listItemType === Expanded || listItemType === Collapsed) {
|
|
2424
2471
|
return [{
|
|
2425
|
-
type: Div,
|
|
2426
|
-
className,
|
|
2427
|
-
childCount: 5,
|
|
2428
|
-
paddingLeft: getTreeItemIndent(1),
|
|
2429
|
-
ariaPosInSet: posInSet,
|
|
2430
|
-
ariaSetSize: setSize,
|
|
2431
|
-
ariaLevel: level,
|
|
2432
2472
|
ariaExpanded: !isCollapsed,
|
|
2473
|
+
ariaLevel: level,
|
|
2474
|
+
ariaPosInSet: posInSet,
|
|
2433
2475
|
ariaSelected: isActive,
|
|
2434
|
-
|
|
2476
|
+
ariaSetSize: setSize,
|
|
2477
|
+
childCount: 5,
|
|
2478
|
+
className,
|
|
2479
|
+
paddingLeft: getTreeItemIndent(1),
|
|
2480
|
+
role: TreeItem,
|
|
2481
|
+
type: Div
|
|
2435
2482
|
}, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), text(fileName), {
|
|
2436
|
-
|
|
2483
|
+
childCount: 1,
|
|
2437
2484
|
className: LabelDetail,
|
|
2438
|
-
|
|
2485
|
+
type: Div
|
|
2439
2486
|
}, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
|
|
2440
2487
|
}
|
|
2441
2488
|
const lineColumn = atLineColumn(rowIndex, columnIndex);
|
|
2442
2489
|
const label = {
|
|
2443
|
-
|
|
2490
|
+
childCount: 1,
|
|
2444
2491
|
className: Label,
|
|
2445
|
-
|
|
2492
|
+
type: Div
|
|
2446
2493
|
};
|
|
2447
2494
|
/**
|
|
2448
2495
|
* @type {any}
|
|
2449
2496
|
*/
|
|
2450
2497
|
const dom = [{
|
|
2451
|
-
type: Div,
|
|
2452
|
-
className,
|
|
2453
|
-
childCount: 3,
|
|
2454
|
-
paddingLeft: getTreeItemIndent(2),
|
|
2455
|
-
ariaPosInSet: posInSet,
|
|
2456
|
-
ariaSetSize: setSize,
|
|
2457
2498
|
ariaLevel: level,
|
|
2499
|
+
ariaPosInSet: posInSet,
|
|
2458
2500
|
ariaSelected: isActive,
|
|
2459
|
-
|
|
2501
|
+
ariaSetSize: setSize,
|
|
2502
|
+
childCount: 3,
|
|
2503
|
+
className,
|
|
2504
|
+
paddingLeft: getTreeItemIndent(2),
|
|
2505
|
+
role: TreeItem,
|
|
2506
|
+
type: Div
|
|
2460
2507
|
}, getProblemsIconVirtualDom(type), label];
|
|
2461
2508
|
if (filterValueLength) {
|
|
2462
2509
|
const before = message.slice(0, messageMatchIndex);
|
|
@@ -2464,37 +2511,38 @@ const getProblemVirtualDom = problem => {
|
|
|
2464
2511
|
const after = message.slice(messageMatchIndex + filterValueLength);
|
|
2465
2512
|
label.childCount += 2;
|
|
2466
2513
|
dom.push(text(before), {
|
|
2467
|
-
|
|
2514
|
+
childCount: 1,
|
|
2468
2515
|
className: Highlight,
|
|
2469
|
-
|
|
2516
|
+
type: Div
|
|
2470
2517
|
}, text(middle), text(after));
|
|
2471
2518
|
} else {
|
|
2472
2519
|
dom.push(text(message));
|
|
2473
2520
|
}
|
|
2474
2521
|
dom.push({
|
|
2475
|
-
|
|
2522
|
+
childCount: 2,
|
|
2476
2523
|
className: ProblemAt,
|
|
2477
|
-
|
|
2524
|
+
type: Span
|
|
2478
2525
|
}, text(getProblemSourceDetail(source, code)), text(lineColumn));
|
|
2479
2526
|
return dom;
|
|
2480
2527
|
};
|
|
2481
2528
|
|
|
2482
2529
|
const getProblemsListVirtualDom = problems => {
|
|
2483
2530
|
const dom = [{
|
|
2484
|
-
|
|
2485
|
-
|
|
2531
|
+
ariaLabel: 'Problems Tree',
|
|
2532
|
+
// TODO use i18n string
|
|
2486
2533
|
childCount: problems.length,
|
|
2534
|
+
className: ProblemsList,
|
|
2487
2535
|
role: Tree,
|
|
2488
|
-
|
|
2536
|
+
type: Div
|
|
2489
2537
|
}, ...problems.flatMap(getProblemVirtualDom)];
|
|
2490
2538
|
return dom;
|
|
2491
2539
|
};
|
|
2492
2540
|
|
|
2493
2541
|
const getProblemsNoProblemsFoundVirtualDom = () => {
|
|
2494
2542
|
return [{
|
|
2495
|
-
|
|
2543
|
+
childCount: 1,
|
|
2496
2544
|
className: Message,
|
|
2497
|
-
|
|
2545
|
+
type: Div
|
|
2498
2546
|
}, text(noProblemsDetected())];
|
|
2499
2547
|
};
|
|
2500
2548
|
|
|
@@ -2507,11 +2555,11 @@ const getClassName = isEven => {
|
|
|
2507
2555
|
const getProblemsTableRowVirtualDom = problem => {
|
|
2508
2556
|
const {
|
|
2509
2557
|
code,
|
|
2510
|
-
source,
|
|
2511
|
-
uri,
|
|
2512
|
-
message,
|
|
2513
2558
|
isEven,
|
|
2514
|
-
|
|
2559
|
+
message,
|
|
2560
|
+
source,
|
|
2561
|
+
type,
|
|
2562
|
+
uri
|
|
2515
2563
|
} = problem;
|
|
2516
2564
|
// TODO problems are grouped by uri, depending
|
|
2517
2565
|
// on which renderer is used the data needs to look different
|
|
@@ -2519,38 +2567,38 @@ const getProblemsTableRowVirtualDom = problem => {
|
|
|
2519
2567
|
return [];
|
|
2520
2568
|
}
|
|
2521
2569
|
const dom = [{
|
|
2522
|
-
|
|
2570
|
+
childCount: 5,
|
|
2523
2571
|
className: getClassName(isEven),
|
|
2524
|
-
|
|
2572
|
+
type: Div
|
|
2525
2573
|
}, {
|
|
2526
|
-
|
|
2574
|
+
childCount: 1,
|
|
2527
2575
|
className: ProblemsTableRowItem,
|
|
2528
|
-
|
|
2576
|
+
type: Div
|
|
2529
2577
|
}, getProblemsIconVirtualDom(type), {
|
|
2530
|
-
|
|
2578
|
+
childCount: 1,
|
|
2531
2579
|
className: ProblemsTableRowItem,
|
|
2532
|
-
|
|
2580
|
+
type: Div
|
|
2533
2581
|
}, text(getProblemSourceDetail(source, code)), {
|
|
2534
|
-
|
|
2582
|
+
childCount: 1,
|
|
2535
2583
|
className: ProblemsTableRowItem,
|
|
2536
|
-
|
|
2584
|
+
type: Div
|
|
2537
2585
|
}, text(message), {
|
|
2538
|
-
|
|
2586
|
+
childCount: 1,
|
|
2539
2587
|
className: ProblemsTableRowItem,
|
|
2540
|
-
|
|
2588
|
+
type: Div
|
|
2541
2589
|
}, text(uri), {
|
|
2542
|
-
|
|
2590
|
+
childCount: 1,
|
|
2543
2591
|
className: ProblemsTableRowItem,
|
|
2544
|
-
|
|
2592
|
+
type: Div
|
|
2545
2593
|
}, text(source)];
|
|
2546
2594
|
return dom;
|
|
2547
2595
|
};
|
|
2548
2596
|
|
|
2549
2597
|
const getProblemsTableBodyVirtualDom = problems => {
|
|
2550
2598
|
const dom = [{
|
|
2551
|
-
|
|
2599
|
+
childCount: problems.length,
|
|
2552
2600
|
className: ProblemsTableBody,
|
|
2553
|
-
|
|
2601
|
+
type: Div
|
|
2554
2602
|
}, ...problems.flatMap(getProblemsTableRowVirtualDom)];
|
|
2555
2603
|
return dom;
|
|
2556
2604
|
};
|
|
@@ -2561,42 +2609,42 @@ const getProblemsTableHeaderVirtualDom = () => {
|
|
|
2561
2609
|
const textMessage = message();
|
|
2562
2610
|
const textFile = file();
|
|
2563
2611
|
const dom = [{
|
|
2564
|
-
|
|
2612
|
+
childCount: 1,
|
|
2565
2613
|
className: ProblemsTableHeader,
|
|
2566
|
-
|
|
2614
|
+
type: Div
|
|
2567
2615
|
}, {
|
|
2568
|
-
|
|
2616
|
+
childCount: 5,
|
|
2569
2617
|
className: ProblemsTableRow,
|
|
2570
|
-
|
|
2618
|
+
type: Div
|
|
2571
2619
|
}, {
|
|
2572
|
-
|
|
2620
|
+
childCount: 0,
|
|
2573
2621
|
className: ProblemsTableRowItem,
|
|
2574
|
-
|
|
2622
|
+
type: Div
|
|
2575
2623
|
}, {
|
|
2576
|
-
|
|
2624
|
+
childCount: 1,
|
|
2577
2625
|
className: ProblemsTableRowItem,
|
|
2578
|
-
|
|
2626
|
+
type: Div
|
|
2579
2627
|
}, text(textCode), {
|
|
2580
|
-
|
|
2628
|
+
childCount: 1,
|
|
2581
2629
|
className: ProblemsTableRowItem,
|
|
2582
|
-
|
|
2630
|
+
type: Div
|
|
2583
2631
|
}, text(textMessage), {
|
|
2584
|
-
|
|
2632
|
+
childCount: 1,
|
|
2585
2633
|
className: ProblemsTableRowItem,
|
|
2586
|
-
|
|
2634
|
+
type: Div
|
|
2587
2635
|
}, text(textFile), {
|
|
2588
|
-
|
|
2636
|
+
childCount: 1,
|
|
2589
2637
|
className: ProblemsTableRowItem,
|
|
2590
|
-
|
|
2638
|
+
type: Div
|
|
2591
2639
|
}, text(textSource)];
|
|
2592
2640
|
return dom;
|
|
2593
2641
|
};
|
|
2594
2642
|
|
|
2595
2643
|
const getProblemsTableVirtualDom = problems => {
|
|
2596
2644
|
const dom = [{
|
|
2597
|
-
|
|
2645
|
+
childCount: 2,
|
|
2598
2646
|
className: ProblemsTable,
|
|
2599
|
-
|
|
2647
|
+
type: Div
|
|
2600
2648
|
}, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
|
|
2601
2649
|
return dom;
|
|
2602
2650
|
};
|
|
@@ -2604,9 +2652,9 @@ const getProblemsTableVirtualDom = problems => {
|
|
|
2604
2652
|
const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
|
|
2605
2653
|
if (problems.length === 0 && message) {
|
|
2606
2654
|
return [{
|
|
2607
|
-
|
|
2655
|
+
childCount: 1,
|
|
2608
2656
|
className: Message,
|
|
2609
|
-
|
|
2657
|
+
type: Div
|
|
2610
2658
|
}, text(message)];
|
|
2611
2659
|
}
|
|
2612
2660
|
if (problems.length === 0 && filterValue) {
|
|
@@ -2625,19 +2673,19 @@ const getProblemsVirtualDom = (viewMode, problems, filterValue, isSmall, message
|
|
|
2625
2673
|
// TODO avoid mutation
|
|
2626
2674
|
const dom = [];
|
|
2627
2675
|
dom.push({
|
|
2628
|
-
|
|
2676
|
+
childCount: 1,
|
|
2629
2677
|
className: mergeClassNames(Viewlet, Problems),
|
|
2630
|
-
tabIndex: 0,
|
|
2631
|
-
onPointerDown: HandlePointerDown,
|
|
2632
|
-
onContextMenu: HandleContextMenu,
|
|
2633
2678
|
onBlur: HandleBlur,
|
|
2634
|
-
|
|
2679
|
+
onContextMenu: HandleContextMenu,
|
|
2680
|
+
onPointerDown: HandlePointerDown,
|
|
2681
|
+
tabIndex: 0,
|
|
2682
|
+
type: Div
|
|
2635
2683
|
});
|
|
2636
2684
|
if (isSmall) {
|
|
2637
2685
|
dom[0].childCount++;
|
|
2638
2686
|
dom.push(...getProblemsFilterVirtualDom({
|
|
2639
|
-
command: HandleFilterInput,
|
|
2640
2687
|
badgeText: '',
|
|
2688
|
+
command: HandleFilterInput,
|
|
2641
2689
|
placeholder: filter()}));
|
|
2642
2690
|
}
|
|
2643
2691
|
dom.push(...getProblemsVirtualDom$1(viewMode, problems, filterValue, message));
|
|
@@ -2675,11 +2723,11 @@ const filterProblems = (problems, collapsedUris, filterValue) => {
|
|
|
2675
2723
|
}
|
|
2676
2724
|
filtered.push({
|
|
2677
2725
|
...problem,
|
|
2678
|
-
|
|
2679
|
-
sourceMatchIndex,
|
|
2680
|
-
messageMatchIndex,
|
|
2726
|
+
isCollapsed,
|
|
2681
2727
|
listItemType: getListItemType(problem.listItemType, isCollapsed),
|
|
2682
|
-
|
|
2728
|
+
messageMatchIndex,
|
|
2729
|
+
sourceMatchIndex,
|
|
2730
|
+
uriMatchIndex
|
|
2683
2731
|
});
|
|
2684
2732
|
}
|
|
2685
2733
|
return filtered;
|
|
@@ -2707,10 +2755,10 @@ const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue)
|
|
|
2707
2755
|
const problem = filtered[i];
|
|
2708
2756
|
visibleItems.push({
|
|
2709
2757
|
...problem,
|
|
2710
|
-
|
|
2711
|
-
isActive: i === focusedIndex,
|
|
2758
|
+
filterValueLength,
|
|
2712
2759
|
icon: getIcon(problem.uri),
|
|
2713
|
-
|
|
2760
|
+
isActive: i === focusedIndex,
|
|
2761
|
+
isEven: i % 2 === 0
|
|
2714
2762
|
});
|
|
2715
2763
|
}
|
|
2716
2764
|
return visibleItems;
|
|
@@ -2718,14 +2766,14 @@ const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue)
|
|
|
2718
2766
|
|
|
2719
2767
|
const renderItems = (oldState, newState) => {
|
|
2720
2768
|
const {
|
|
2721
|
-
problems,
|
|
2722
|
-
width,
|
|
2723
|
-
smallWidthBreakPoint,
|
|
2724
2769
|
collapsedUris,
|
|
2770
|
+
filterValue,
|
|
2725
2771
|
focusedIndex,
|
|
2772
|
+
message,
|
|
2773
|
+
problems,
|
|
2774
|
+
smallWidthBreakPoint,
|
|
2726
2775
|
viewMode,
|
|
2727
|
-
|
|
2728
|
-
message
|
|
2776
|
+
width
|
|
2729
2777
|
} = newState;
|
|
2730
2778
|
const visible = getVisibleProblems(problems, collapsedUris, focusedIndex, filterValue);
|
|
2731
2779
|
const isSmall = width <= smallWidthBreakPoint;
|
|
@@ -2735,10 +2783,10 @@ const renderItems = (oldState, newState) => {
|
|
|
2735
2783
|
|
|
2736
2784
|
const getRenderer = diffType => {
|
|
2737
2785
|
switch (diffType) {
|
|
2738
|
-
case RenderItems:
|
|
2739
|
-
return renderItems;
|
|
2740
2786
|
case RenderFilterValue:
|
|
2741
2787
|
return renderFilterValue;
|
|
2788
|
+
case RenderItems:
|
|
2789
|
+
return renderItems;
|
|
2742
2790
|
default:
|
|
2743
2791
|
throw new Error('unknown renderer');
|
|
2744
2792
|
}
|
|
@@ -2755,8 +2803,8 @@ const applyRender = (oldState, newState, diffResult) => {
|
|
|
2755
2803
|
|
|
2756
2804
|
const render2 = (uid, diffResult) => {
|
|
2757
2805
|
const {
|
|
2758
|
-
|
|
2759
|
-
|
|
2806
|
+
newState,
|
|
2807
|
+
oldState
|
|
2760
2808
|
} = get(uid);
|
|
2761
2809
|
set$1(uid, newState, newState);
|
|
2762
2810
|
const commands = applyRender(oldState, newState, diffResult);
|
|
@@ -2776,23 +2824,23 @@ const getActionVirtualDom = action => {
|
|
|
2776
2824
|
|
|
2777
2825
|
const getActionsVirtualDom = actions => {
|
|
2778
2826
|
return [{
|
|
2779
|
-
|
|
2827
|
+
childCount: actions.length,
|
|
2780
2828
|
className: Actions,
|
|
2781
2829
|
role: ToolBar,
|
|
2782
|
-
|
|
2830
|
+
type: Div
|
|
2783
2831
|
}, ...actions.flatMap(getActionVirtualDom)];
|
|
2784
2832
|
};
|
|
2785
2833
|
|
|
2786
2834
|
const getActions = state => {
|
|
2787
2835
|
const {
|
|
2788
|
-
problems,
|
|
2789
|
-
width,
|
|
2790
2836
|
collapsedUris,
|
|
2791
|
-
focusedIndex,
|
|
2792
|
-
smallWidthBreakPoint,
|
|
2793
2837
|
filterValue,
|
|
2838
|
+
focusedIndex,
|
|
2794
2839
|
inputSource,
|
|
2795
|
-
|
|
2840
|
+
problems,
|
|
2841
|
+
smallWidthBreakPoint,
|
|
2842
|
+
viewMode,
|
|
2843
|
+
width
|
|
2796
2844
|
} = state;
|
|
2797
2845
|
const visibleCount = getVisibleProblems(problems, collapsedUris, focusedIndex, filterValue).length;
|
|
2798
2846
|
const problemsCount = problems.length;
|
|
@@ -2800,32 +2848,32 @@ const getActions = state => {
|
|
|
2800
2848
|
const actions = [];
|
|
2801
2849
|
if (!isSmall) {
|
|
2802
2850
|
actions.push({
|
|
2803
|
-
type: ProblemsFilter,
|
|
2804
|
-
id: 'Filter',
|
|
2805
|
-
command: HandleFilterInput,
|
|
2806
2851
|
badgeText: visibleCount === problemsCount ? '' : showingOf(visibleCount, problemsCount),
|
|
2852
|
+
command: HandleFilterInput,
|
|
2853
|
+
id: 'Filter',
|
|
2807
2854
|
placeholder: filter(),
|
|
2855
|
+
type: ProblemsFilter,
|
|
2808
2856
|
value: inputSource === Script ? filterValue : ''
|
|
2809
2857
|
});
|
|
2810
2858
|
}
|
|
2811
2859
|
if (viewMode === Table) {
|
|
2812
2860
|
actions.push({
|
|
2813
|
-
type: Button,
|
|
2814
|
-
id: viewAsList$1(),
|
|
2815
2861
|
command: 'viewAsList',
|
|
2816
|
-
icon: ListTree
|
|
2862
|
+
icon: ListTree,
|
|
2863
|
+
id: viewAsList$1(),
|
|
2864
|
+
type: Button
|
|
2817
2865
|
});
|
|
2818
2866
|
} else {
|
|
2819
2867
|
actions.push({
|
|
2820
|
-
type: Button,
|
|
2821
|
-
id: collapseAll(),
|
|
2822
2868
|
command: 'collapseAll',
|
|
2823
|
-
icon: CollapseAll
|
|
2869
|
+
icon: CollapseAll,
|
|
2870
|
+
id: collapseAll(),
|
|
2871
|
+
type: Button
|
|
2824
2872
|
}, {
|
|
2825
|
-
type: Button,
|
|
2826
|
-
id: viewAsTable$1(),
|
|
2827
2873
|
command: 'viewAsTable',
|
|
2828
|
-
icon: ListFlat
|
|
2874
|
+
icon: ListFlat,
|
|
2875
|
+
id: viewAsTable$1(),
|
|
2876
|
+
type: Button
|
|
2829
2877
|
});
|
|
2830
2878
|
}
|
|
2831
2879
|
return actions;
|
|
@@ -2870,14 +2918,14 @@ const resize = (state, dimensions) => {
|
|
|
2870
2918
|
|
|
2871
2919
|
const saveState = state => {
|
|
2872
2920
|
const {
|
|
2873
|
-
|
|
2921
|
+
collapsedUris,
|
|
2874
2922
|
filterValue,
|
|
2875
|
-
|
|
2923
|
+
viewMode
|
|
2876
2924
|
} = state;
|
|
2877
2925
|
return {
|
|
2878
|
-
|
|
2926
|
+
collapsedUris,
|
|
2879
2927
|
filterValue,
|
|
2880
|
-
|
|
2928
|
+
viewMode
|
|
2881
2929
|
};
|
|
2882
2930
|
};
|
|
2883
2931
|
|
|
@@ -2905,8 +2953,8 @@ const commandMap = {
|
|
|
2905
2953
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
2906
2954
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
2907
2955
|
'Problems.handleClickAt': wrapCommand(handleClickAt),
|
|
2908
|
-
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2909
2956
|
'Problems.handleClickButton': wrapCommand(handleClickButton),
|
|
2957
|
+
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2910
2958
|
'Problems.handleFilterInput': wrapCommand(handleFilterInput),
|
|
2911
2959
|
'Problems.handleIconThemeChange': wrapCommand(handleIconThemeChange),
|
|
2912
2960
|
'Problems.initialize': initialize,
|