@codingame/monaco-vscode-markers-service-override 1.83.16 → 1.85.0-next.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-markers-service-override",
3
- "version": "1.83.16",
3
+ "version": "1.85.0-next.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.83.16",
22
- "monaco-editor": "0.44.0"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.85.0-next.1",
22
+ "monaco-editor": "0.45.0"
23
23
  }
24
24
  }
@@ -24,6 +24,7 @@ import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconReg
24
24
  import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
25
25
  import { NumberBadge, IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
26
26
  import { viewFilterSubmenu } from 'vscode/vscode/vs/workbench/browser/parts/views/viewFilter';
27
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
27
28
 
28
29
  KeybindingsRegistry.registerCommandAndKeybindingRule({
29
30
  id: Markers.MARKER_OPEN_ACTION_ID,
@@ -106,6 +107,16 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
106
107
  Messages.PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_POSITION,
107
108
  ],
108
109
  },
110
+ 'problems.visibility': {
111
+ type: 'boolean',
112
+ default: true,
113
+ tags: ['experimental'],
114
+ description: ( localizeWithPath(
115
+ 'vs/workbench/contrib/markers/browser/markers.contribution',
116
+ 'problems.visibility',
117
+ "Controls whether the problems are visible throughout the editor and workbench."
118
+ )),
119
+ }
109
120
  }
110
121
  });
111
122
  const markersViewIcon = registerIcon('markers-view-icon', Codicon.warning, ( localizeWithPath(
@@ -115,7 +126,7 @@ const markersViewIcon = registerIcon('markers-view-icon', Codicon.warning, ( loc
115
126
  )));
116
127
  const VIEW_CONTAINER = ( Registry.as(Extensions$1.ViewContainersRegistry)).registerViewContainer({
117
128
  id: Markers.MARKERS_CONTAINER_ID,
118
- title: { value: Messages.MARKERS_PANEL_TITLE_PROBLEMS, original: Messages.MARKERS_PANEL_ORIGINAL_TITLE_PROBLEMS },
129
+ title: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
119
130
  icon: markersViewIcon,
120
131
  hideIfEmpty: true,
121
132
  order: 0,
@@ -632,12 +643,35 @@ registerAction2(class extends Action2 {
632
643
  }
633
644
  });
634
645
  let MarkersStatusBarContributions = class MarkersStatusBarContributions extends Disposable {
635
- constructor(markerService, statusbarService) {
646
+ constructor(markerService, statusbarService, configurationService) {
636
647
  super();
637
648
  this.markerService = markerService;
638
649
  this.statusbarService = statusbarService;
650
+ this.configurationService = configurationService;
639
651
  this.markersStatusItem = this._register(this.statusbarService.addEntry(this.getMarkersItem(), 'status.problems', 0 , 50 ));
640
- this.markerService.onMarkerChanged(() => this.markersStatusItem.update(this.getMarkersItem()));
652
+ const addStatusBarEntry = () => {
653
+ this.markersStatusItemOff = this.statusbarService.addEntry(this.getMarkersItemTurnedOff(), 'status.problemsVisibility', 0 , 49);
654
+ };
655
+ let config = this.configurationService.getValue('problems.visibility');
656
+ if (!config) {
657
+ addStatusBarEntry();
658
+ }
659
+ this._register(this.markerService.onMarkerChanged(() => {
660
+ this.markersStatusItem.update(this.getMarkersItem());
661
+ }));
662
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
663
+ if (e.affectsConfiguration('problems.visibility')) {
664
+ this.markersStatusItem.update(this.getMarkersItem());
665
+ config = this.configurationService.getValue('problems.visibility');
666
+ if (!config && !this.markersStatusItemOff) {
667
+ addStatusBarEntry();
668
+ }
669
+ else if (config && this.markersStatusItemOff) {
670
+ this.markersStatusItemOff.dispose();
671
+ this.markersStatusItemOff = undefined;
672
+ }
673
+ }
674
+ }));
641
675
  }
642
676
  getMarkersItem() {
643
677
  const markersStatistics = this.markerService.getStatistics();
@@ -654,6 +688,28 @@ let MarkersStatusBarContributions = class MarkersStatusBarContributions extends
654
688
  command: 'workbench.actions.view.toggleProblems'
655
689
  };
656
690
  }
691
+ getMarkersItemTurnedOff() {
692
+ this.statusbarService.updateEntryVisibility('status.problemsVisibility', true);
693
+ const openSettingsCommand = 'workbench.action.openSettings';
694
+ const configureSettingsLabel = '@id:problems.visibility';
695
+ const tooltip = ( localizeWithPath(
696
+ 'vs/workbench/contrib/markers/browser/markers.contribution',
697
+ 'status.problemsVisibilityOff',
698
+ "Problems are turned off. Click to open settings."
699
+ ));
700
+ return {
701
+ name: ( localizeWithPath(
702
+ 'vs/workbench/contrib/markers/browser/markers.contribution',
703
+ 'status.problemsVisibility',
704
+ "Problems Visibility"
705
+ )),
706
+ text: '$(whole-word)',
707
+ ariaLabel: tooltip,
708
+ tooltip,
709
+ kind: 'warning',
710
+ command: { title: openSettingsCommand, arguments: [configureSettingsLabel], id: openSettingsCommand }
711
+ };
712
+ }
657
713
  getMarkersTooltip(stats) {
658
714
  const errorTitle = (n) => ( localizeWithPath(
659
715
  'vs/workbench/contrib/markers/browser/markers.contribution',
@@ -712,7 +768,8 @@ let MarkersStatusBarContributions = class MarkersStatusBarContributions extends
712
768
  };
713
769
  MarkersStatusBarContributions = ( __decorate([
714
770
  ( __param(0, IMarkerService)),
715
- ( __param(1, IStatusbarService))
771
+ ( __param(1, IStatusbarService)),
772
+ ( __param(2, IConfigurationService))
716
773
  ], MarkersStatusBarContributions));
717
774
  workbenchRegistry.registerWorkbenchContribution(MarkersStatusBarContributions, 3 );
718
775
  let ActivityUpdater = class ActivityUpdater extends Disposable {
@@ -727,13 +784,18 @@ let ActivityUpdater = class ActivityUpdater extends Disposable {
727
784
  updateBadge() {
728
785
  const { errors, warnings, infos } = this.markerService.getStatistics();
729
786
  const total = errors + warnings + infos;
730
- const message = ( localizeWithPath(
731
- 'vs/workbench/contrib/markers/browser/markers.contribution',
732
- 'totalProblems',
733
- 'Total {0} Problems',
734
- total
735
- ));
736
- this.activity.value = this.activityService.showViewActivity(Markers.MARKERS_VIEW_ID, { badge: ( new NumberBadge(total, () => message)) });
787
+ if (total > 0) {
788
+ const message = ( localizeWithPath(
789
+ 'vs/workbench/contrib/markers/browser/markers.contribution',
790
+ 'totalProblems',
791
+ 'Total {0} Problems',
792
+ total
793
+ ));
794
+ this.activity.value = this.activityService.showViewActivity(Markers.MARKERS_VIEW_ID, { badge: ( new NumberBadge(total, () => message)) });
795
+ }
796
+ else {
797
+ this.activity.value = undefined;
798
+ }
737
799
  }
738
800
  };
739
801
  ActivityUpdater = ( __decorate([
@@ -120,20 +120,31 @@ let ResourceMarkersRenderer = class ResourceMarkersRenderer {
120
120
  templateData.resourceLabel.setResource({ name: resourceMarkers.name, description: this.labelService.getUriLabel(dirname(resourceMarkers.resource), { relative: true }), resource: resourceMarkers.resource }, { matches: uriMatches });
121
121
  }
122
122
  this.updateCount(node, templateData);
123
- this.renderedNodes.set(node, templateData);
123
+ const nodeRenders = this.renderedNodes.get(resourceMarkers) ?? [];
124
+ this.renderedNodes.set(resourceMarkers, [...nodeRenders, templateData]);
124
125
  }
125
- disposeElement(node) {
126
- this.renderedNodes.delete(node);
126
+ disposeElement(node, index, templateData) {
127
+ const nodeRenders = this.renderedNodes.get(node.element) ?? [];
128
+ const nodeRenderIndex = nodeRenders.findIndex(nodeRender => templateData === nodeRender);
129
+ if (nodeRenderIndex < 0) {
130
+ throw new Error('Disposing unknown resource marker');
131
+ }
132
+ if (nodeRenders.length === 1) {
133
+ this.renderedNodes.delete(node.element);
134
+ }
135
+ else {
136
+ nodeRenders.splice(nodeRenderIndex, 1);
137
+ }
127
138
  }
128
139
  disposeTemplate(templateData) {
129
140
  templateData.resourceLabel.dispose();
130
141
  }
131
142
  onDidChangeRenderNodeCount(node) {
132
- const templateData = this.renderedNodes.get(node);
133
- if (!templateData) {
143
+ const nodeRenders = this.renderedNodes.get(node.element);
144
+ if (!nodeRenders) {
134
145
  return;
135
146
  }
136
- this.updateCount(node, templateData);
147
+ nodeRenders.forEach(nodeRender => this.updateCount(node, nodeRender));
137
148
  }
138
149
  updateCount(node, templateData) {
139
150
  templateData.count.setCount(node.children.reduce((r, n) => r + (n.visible ? 1 : 0), 0));
@@ -132,7 +132,7 @@ let MarkersView = class MarkersView extends FilterViewPane {
132
132
  this.renderContent();
133
133
  }
134
134
  getTitle() {
135
- return Messages.MARKERS_PANEL_TITLE_PROBLEMS;
135
+ return Messages.MARKERS_PANEL_TITLE_PROBLEMS.value;
136
136
  }
137
137
  layoutBodyContent(height = this.currentHeight, width = this.currentWidth) {
138
138
  if (this.messageBoxContainer) {
@@ -143,7 +143,8 @@ let MarkersView = class MarkersView extends FilterViewPane {
143
143
  this.currentWidth = width;
144
144
  }
145
145
  focus() {
146
- if (this.widget.getHTMLElement() === document.activeElement) {
146
+ super.focus();
147
+ if (dom.isActiveElement(this.widget.getHTMLElement())) {
147
148
  return;
148
149
  }
149
150
  if (this.hasNoProblems()) {
@@ -628,7 +629,7 @@ let MarkersView = class MarkersView extends FilterViewPane {
628
629
  }
629
630
  updateRangeHighlights() {
630
631
  this.rangeHighlightDecorations.removeHighlightRange();
631
- if (this.widget.getHTMLElement() === document.activeElement) {
632
+ if (dom.isActiveElement(this.widget.getHTMLElement())) {
632
633
  this.highlightCurrentSelectedMarkerRange();
633
634
  }
634
635
  }
@@ -48,8 +48,7 @@ class Messages {
48
48
  'problems.panel.configuration.compareOrder.position',
49
49
  "Navigate problems ordered by position"
50
50
  )); }
51
- static { this.MARKERS_PANEL_ORIGINAL_TITLE_PROBLEMS = 'Problems'; }
52
- static { this.MARKERS_PANEL_TITLE_PROBLEMS = ( nls.localizeWithPath(
51
+ static { this.MARKERS_PANEL_TITLE_PROBLEMS = ( nls.localize2WithPath(
53
52
  'vs/workbench/contrib/markers/browser/messages',
54
53
  'markers.panel.title.problems',
55
54
  "Problems"