@lvce-editor/problems-view 1.26.6 → 1.27.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.
|
@@ -1683,6 +1683,9 @@ const writeClipBoardText$1 = async text => {
|
|
|
1683
1683
|
const getActiveEditorId$1 = () => {
|
|
1684
1684
|
return invoke('GetActiveEditor.getActiveEditorId');
|
|
1685
1685
|
};
|
|
1686
|
+
const getWorkspacePath$1 = () => {
|
|
1687
|
+
return invoke('Workspace.getPath');
|
|
1688
|
+
};
|
|
1686
1689
|
|
|
1687
1690
|
const getActiveEditorId = () => {
|
|
1688
1691
|
return getActiveEditorId$1();
|
|
@@ -2674,12 +2677,15 @@ const getSavedViewMode = savedState => {
|
|
|
2674
2677
|
return List;
|
|
2675
2678
|
};
|
|
2676
2679
|
|
|
2680
|
+
const getWorkspacePath = () => {
|
|
2681
|
+
return getWorkspacePath$1();
|
|
2682
|
+
};
|
|
2683
|
+
|
|
2677
2684
|
const loadContent = async (state, savedState) => {
|
|
2678
2685
|
const {
|
|
2679
|
-
fileIconCache: oldFileIconCache
|
|
2680
|
-
workspaceUri
|
|
2686
|
+
fileIconCache: oldFileIconCache
|
|
2681
2687
|
} = state;
|
|
2682
|
-
const activeUri = await getActiveUri();
|
|
2688
|
+
const [activeUri, workspaceUri] = await Promise.all([getActiveUri(), getWorkspacePath()]);
|
|
2683
2689
|
const {
|
|
2684
2690
|
error,
|
|
2685
2691
|
problems
|
|
@@ -2690,7 +2696,8 @@ const loadContent = async (state, savedState) => {
|
|
|
2690
2696
|
activeUri,
|
|
2691
2697
|
filteredProblems: [],
|
|
2692
2698
|
message: error,
|
|
2693
|
-
problems: []
|
|
2699
|
+
problems: [],
|
|
2700
|
+
workspaceUri
|
|
2694
2701
|
};
|
|
2695
2702
|
}
|
|
2696
2703
|
const message = getMessage(problems.length);
|
|
@@ -2709,7 +2716,8 @@ const loadContent = async (state, savedState) => {
|
|
|
2709
2716
|
listItems: [],
|
|
2710
2717
|
message,
|
|
2711
2718
|
problems,
|
|
2712
|
-
viewMode
|
|
2719
|
+
viewMode,
|
|
2720
|
+
workspaceUri
|
|
2713
2721
|
};
|
|
2714
2722
|
};
|
|
2715
2723
|
|
|
@@ -2900,6 +2908,7 @@ const HandleCollapseAll = 11;
|
|
|
2900
2908
|
const HandleViewAsList = 12;
|
|
2901
2909
|
const HandleViewAsTable = 13;
|
|
2902
2910
|
const HandleClickButton = 14;
|
|
2911
|
+
const HandleFileNameClick = 15;
|
|
2903
2912
|
|
|
2904
2913
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2905
2914
|
return {
|
|
@@ -3119,7 +3128,8 @@ const getProblemVirtualDom = problem => {
|
|
|
3119
3128
|
rowIndex,
|
|
3120
3129
|
setSize,
|
|
3121
3130
|
source,
|
|
3122
|
-
type
|
|
3131
|
+
type,
|
|
3132
|
+
uri
|
|
3123
3133
|
} = problem;
|
|
3124
3134
|
let className = Problem;
|
|
3125
3135
|
const indent = getProblemIndent(listItemType);
|
|
@@ -3138,7 +3148,11 @@ const getProblemVirtualDom = problem => {
|
|
|
3138
3148
|
className,
|
|
3139
3149
|
role: TreeItem,
|
|
3140
3150
|
type: Div
|
|
3141
|
-
}, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon),
|
|
3151
|
+
}, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), {
|
|
3152
|
+
...labelNode,
|
|
3153
|
+
'data-uri': uri,
|
|
3154
|
+
onClick: HandleFileNameClick
|
|
3155
|
+
}, text(fileName), labelDetailNode, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
|
|
3142
3156
|
}
|
|
3143
3157
|
const lineColumn = atLineColumn(rowIndex + 1, columnIndex + 1);
|
|
3144
3158
|
const label = {
|
|
@@ -3498,6 +3512,9 @@ const renderEventListeners = () => {
|
|
|
3498
3512
|
}, {
|
|
3499
3513
|
name: HandlePointerDown,
|
|
3500
3514
|
params: ['handleClickAt', 'event.clientX', 'event.clientY']
|
|
3515
|
+
}, {
|
|
3516
|
+
name: HandleFileNameClick,
|
|
3517
|
+
params: ['toggleFileGroup', 'event.target.dataset.uri']
|
|
3501
3518
|
}, {
|
|
3502
3519
|
name: HandleClickMoreFilters,
|
|
3503
3520
|
params: ['handleClickMoreFilters', ClientX, ClientY]
|
|
@@ -3551,6 +3568,17 @@ const saveState = state => {
|
|
|
3551
3568
|
};
|
|
3552
3569
|
};
|
|
3553
3570
|
|
|
3571
|
+
const toggleFileGroup = (state, uri) => {
|
|
3572
|
+
const {
|
|
3573
|
+
collapsedUris
|
|
3574
|
+
} = state;
|
|
3575
|
+
const newCollapsedUris = collapsedUris.includes(uri) ? collapsedUris.filter(collapsedUri => collapsedUri !== uri) : [...collapsedUris, uri];
|
|
3576
|
+
return {
|
|
3577
|
+
...state,
|
|
3578
|
+
collapsedUris: newCollapsedUris
|
|
3579
|
+
};
|
|
3580
|
+
};
|
|
3581
|
+
|
|
3554
3582
|
const commandMap = {
|
|
3555
3583
|
'Problems.collapseAll': wrapCommand(collapseAll$1),
|
|
3556
3584
|
'Problems.copyMessage': wrapCommand(copyMessage),
|
|
@@ -3584,6 +3612,7 @@ const commandMap = {
|
|
|
3584
3612
|
'Problems.resize': resize,
|
|
3585
3613
|
'Problems.saveState': wrapGetter(saveState),
|
|
3586
3614
|
'Problems.terminate': terminate,
|
|
3615
|
+
'Problems.toggleFileGroup': wrapCommand(toggleFileGroup),
|
|
3587
3616
|
'Problems.viewAsList': wrapCommand(viewAsList),
|
|
3588
3617
|
'Problems.viewAsTable': wrapCommand(viewAsTable)
|
|
3589
3618
|
};
|