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 0.19.3 to 0.19.4

10

CHANGELOG.md

@@ -0,1 +1,11 @@

## 0.19.4 (2022-02-25)
### Bug fixes
Fix an issue where an outdated marker could stick around on the lint gutter after all diagnostics were removed.
### New features
Add a `hoverTime` option to the lint gutter. Change default hover time to 300
## 0.19.3 (2021-11-09)

@@ -2,0 +12,0 @@

8

dist/index.d.ts

@@ -54,2 +54,8 @@ import * as _codemirror_state from '@codemirror/state';

}
interface LintGutterConfig {
/**
The delay before showing a tooltip when hovering over a lint gutter marker.
*/
hoverTime?: number;
}
/**

@@ -112,4 +118,4 @@ Returns a transaction spec which updates the current set of

*/
declare function lintGutter(): Extension;
declare function lintGutter(config?: LintGutterConfig): Extension;
export { Action, Diagnostic, closeLintPanel, diagnosticCount, forceLinting, lintGutter, lintKeymap, linter, nextDiagnostic, openLintPanel, setDiagnostics, setDiagnosticsEffect };

24

dist/index.js
import { Decoration, EditorView, ViewPlugin, logException, WidgetType } from '@codemirror/view';
import { StateEffect, StateField, Facet } from '@codemirror/state';
import { StateEffect, StateField, Facet, combineConfig } from '@codemirror/state';
import { hoverTooltip, showTooltip } from '@codemirror/tooltip';

@@ -207,6 +207,4 @@ import { showPanel, getPanel } from '@codemirror/panel';

Promise.all(sources.map(source => Promise.resolve(source(this.view)))).then(annotations => {
var _a, _b;
let all = annotations.reduce((a, b) => a.concat(b));
if (this.view.state.doc == state.doc &&
(all.length || ((_b = (_a = this.view.state.field(lintState, false)) === null || _a === void 0 ? void 0 : _a.diagnostics) === null || _b === void 0 ? void 0 : _b.size)))
if (this.view.state.doc == state.doc)
this.view.dispatch(setDiagnostics(this.view.state, all));

@@ -609,3 +607,3 @@ }, error => { logException(this.view.state, error); });

function hovered() {
let line = view.visualLineAtHeight(marker.getBoundingClientRect().top + 5);
let line = view.visualLineAtHeight(marker.getBoundingClientRect().top + 5 - view.documentTop);
const linePos = view.coordsAtPos(line.from), markerRect = marker.getBoundingClientRect();

@@ -627,3 +625,4 @@ if (linePos) {

}
let hoverTimeout = setTimeout(hovered, 600 /* Time */);
let { hoverTime } = view.state.facet(lintGutterConfig);
let hoverTimeout = setTimeout(hovered, hoverTime);
marker.onmouseout = () => {

@@ -635,3 +634,3 @@ clearTimeout(hoverTimeout);

clearTimeout(hoverTimeout);
hoverTimeout = setTimeout(hovered, 600 /* Time */);
hoverTimeout = setTimeout(hovered, hoverTime);
};

@@ -702,2 +701,9 @@ }

});
const lintGutterConfig = /*@__PURE__*/Facet.define({
combine(configs) {
return combineConfig(configs, {
hoverTime: 300 /* Time */,
});
}
});
/**

@@ -708,6 +714,6 @@ Returns an extension that installs a gutter showing markers for

*/
function lintGutter() {
return [lintGutterMarkers, lintGutterExtension, lintGutterTheme, lintGutterTooltip];
function lintGutter(config = {}) {
return [lintGutterConfig.of(config), lintGutterMarkers, lintGutterExtension, lintGutterTheme, lintGutterTooltip];
}
export { closeLintPanel, diagnosticCount, forceLinting, lintGutter, lintKeymap, linter, nextDiagnostic, openLintPanel, setDiagnostics, setDiagnosticsEffect };
{
"name": "@codemirror/lint",
"version": "0.19.3",
"version": "0.19.4",
"description": "Linting support for the CodeMirror code editor",

@@ -34,3 +34,3 @@ "scripts": {

"@codemirror/tooltip": "^0.19.5",
"@codemirror/view": "^0.19.0",
"@codemirror/view": "^0.19.22",
"crelt": "^1.0.5"

@@ -37,0 +37,0 @@ },

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