@bhsd/codemirror-mediawiki 3.4.0 → 3.4.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/dist/statusBar.js CHANGED
@@ -42,8 +42,6 @@ function getLintMarker(view, severity, menu) {
42
42
  const updateDiagnosticsCount = (diagnostics, s, marker) => {
43
43
  marker.lastChild.textContent = String(diagnostics.filter(({ severity }) => severity === s).length);
44
44
  };
45
- const hasFix = (diagnostic) => diagnostic.actions?.some(({ name }) => name === 'fix' || name.startsWith('Fix:'));
46
- const isItemActionable = (cm, { name, isActionable }) => cm.hasPreference(name) && isActionable(cm);
47
45
  const toggleClass = (classList, enabled) => {
48
46
  classList.toggle('cm-status-fix-enabled', enabled);
49
47
  classList.toggle('cm-status-fix-disabled', !enabled);
@@ -74,8 +72,8 @@ const updateDiagnosticMessage = (cm, allDiagnostics, main, msg) => {
74
72
  };
75
73
  const updateMenu = (cm, allDiagnostics, main, classList, menu, fixer) => {
76
74
  if (menu) {
77
- const actionable = menuRegistry.filter(item => isItemActionable(cm, item)), fixable = new Set(fixer && getDiagnostics(allDiagnostics, main).filter(hasFix)
78
- .map(({ message }) => / \(([^()]+)\)$/u.exec(message)?.[1])
75
+ const actionable = menuRegistry.filter(({ name, isActionable }) => cm.hasPreference(name) && isActionable(cm)), fixable = new Set(fixer && getDiagnostics(allDiagnostics, main).filter(({ actions }) => actions?.some(({ name }) => name === 'fix'
76
+ || name !== 'Fix: Stylelint' && name.startsWith('Fix:'))).map(({ message }) => / \(([^()]+)\)$/u.exec(message)?.[1])
79
77
  .filter(Boolean));
80
78
  if (actionable.length === 0 && fixable.size === 0) {
81
79
  toggleClass(classList, false);