@lvce-editor/problems-view 1.31.1 → 1.31.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1922,7 +1922,8 @@ const filterProblems = (problems, collapsedUris, filterValue, showErrors = true,
1922
1922
  };
1923
1923
 
1924
1924
  const getVisibleProblemCount = (problems, collapsedUris, filterValue, viewMode, showErrors = true, showWarnings = true, showInfos = true) => {
1925
- const filtered = filterProblems(problems, collapsedUris, filterValue, showErrors, showWarnings, showInfos);
1925
+ const effectiveCollapsedUris = viewMode === Table ? [] : collapsedUris;
1926
+ const filtered = filterProblems(problems, effectiveCollapsedUris, filterValue, showErrors, showWarnings, showInfos);
1926
1927
  if (viewMode !== Table) {
1927
1928
  return filtered.length;
1928
1929
  }
@@ -2335,6 +2336,13 @@ const getProblems = async (workspaceUri, activeUri) => {
2335
2336
  const countByType = (diagnostics, type) => {
2336
2337
  return diagnostics.filter(diagnostic => diagnostic.type === type).length;
2337
2338
  };
2339
+ const getActiveDiagnostics = async editorId => {
2340
+ try {
2341
+ return await getDiagnostics(editorId);
2342
+ } catch {
2343
+ return [];
2344
+ }
2345
+ };
2338
2346
  const getProblemsSummary = async () => {
2339
2347
  const editorId = await getActiveEditorId();
2340
2348
  if (editorId === -1) {
@@ -2345,7 +2353,7 @@ const getProblemsSummary = async () => {
2345
2353
  warningCount: 0
2346
2354
  };
2347
2355
  }
2348
- const [allDiagnostics, activeDiagnostics] = await Promise.all([getProblems$1(), getDiagnostics(editorId)]);
2356
+ const [allDiagnostics, activeDiagnostics] = await Promise.all([getProblems$1(), getActiveDiagnostics(editorId)]);
2349
2357
  const uniqueDiagnostics = getUniqueDiagnostics(allDiagnostics);
2350
2358
  const uniqueActiveDiagnostics = getUniqueDiagnostics(activeDiagnostics);
2351
2359
  return {
@@ -2613,7 +2621,8 @@ const getVisibleProblems = (problems, fileIconCache, collapsedUris, focusedIndex
2613
2621
  string(filterValue);
2614
2622
  const visibleItems = [];
2615
2623
  const filterValueLength = filterValue.length;
2616
- const filtered = filterProblems(problems, collapsedUris, filterValue, showErrors, showWarnings, showInfos);
2624
+ const effectiveCollapsedUris = viewMode === Table ? [] : collapsedUris;
2625
+ const filtered = filterProblems(problems, effectiveCollapsedUris, filterValue, showErrors, showWarnings, showInfos);
2617
2626
  const displayProblems = viewMode === Table ? filtered.filter(problem => problem.message) : filtered;
2618
2627
  const finalLineY = Math.min(maxLineY, displayProblems.length);
2619
2628
  for (let i = minLineY; i < finalLineY; i++) {
@@ -2815,7 +2824,11 @@ const getActiveUri = async () => {
2815
2824
  if (editorId === -1) {
2816
2825
  return '';
2817
2826
  }
2818
- return getUri(editorId);
2827
+ try {
2828
+ return await getUri(editorId);
2829
+ } catch {
2830
+ return '';
2831
+ }
2819
2832
  };
2820
2833
 
2821
2834
  const isString = value => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.31.1",
3
+ "version": "1.31.3",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",