Socket
Socket
Sign inDemoInstall

@codemirror/lint

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/lint - npm Package Compare versions

Comparing version 6.8.1 to 6.8.2

8

CHANGELOG.md

@@ -0,1 +1,9 @@

## 6.8.2 (2024-09-24)
### Bug fixes
Show lint markers for code replaced by a block widget.
When multiple linters are installed, start displaying results from ones that return quickly even if others are slow to return.
## 6.8.1 (2024-06-19)

@@ -2,0 +10,0 @@

26

dist/index.js

@@ -1,2 +0,2 @@

import { Decoration, showPanel, EditorView, ViewPlugin, logException, gutter, showTooltip, hoverTooltip, getPanel, WidgetType, GutterMarker } from '@codemirror/view';
import { Decoration, showPanel, EditorView, ViewPlugin, gutter, showTooltip, hoverTooltip, getPanel, logException, WidgetType, GutterMarker } from '@codemirror/view';
import { StateEffect, StateField, Facet, combineConfig, RangeSet } from '@codemirror/state';

@@ -237,6 +237,5 @@ import elt from 'crelt';

if (sources.length)
Promise.all(sources.map(source => Promise.resolve(source(this.view)))).then(annotations => {
let all = annotations.reduce((a, b) => a.concat(b));
batchResults(sources.map(s => Promise.resolve(s(this.view))), annotations => {
if (this.view.state.doc == state.doc)
this.view.dispatch(setDiagnostics(this.view.state, all));
this.view.dispatch(setDiagnostics(this.view.state, annotations.reduce((a, b) => a.concat(b))));
}, error => { logException(this.view.state, error); });

@@ -266,2 +265,14 @@ }

});
function batchResults(promises, sink, error) {
let collected = [], timeout = -1;
for (let p of promises)
p.then(value => {
collected.push(value);
clearTimeout(timeout);
if (collected.length == promises.length)
sink(collected);
else
setTimeout(() => sink(collected), 200);
}, error);
}
const lintConfig = /*@__PURE__*/Facet.define({

@@ -709,2 +720,9 @@ combine(input) {

markers: view => view.state.field(lintGutterMarkers),
widgetMarker: (view, widget, block) => {
let diagnostics = [];
view.state.field(lintGutterMarkers).between(block.from, block.to, (from, to, value) => {
diagnostics.push(...value.diagnostics);
});
return diagnostics.length ? new LintGutterMarker(diagnostics) : null;
}
});

@@ -711,0 +729,0 @@ const lintGutterMarkers = /*@__PURE__*/StateField.define({

2

package.json
{
"name": "@codemirror/lint",
"version": "6.8.1",
"version": "6.8.2",
"description": "Linting support for the CodeMirror code editor",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc