Skip to content

Commit f0133c3

Browse files
committed
fix
1 parent ffcf7e5 commit f0133c3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cm/lsp/diagnostics.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,14 @@ function mapDiagnostics(plugin, state) {
6767
const mapped = [];
6868

6969
for (const diagnostic of stored) {
70-
const from = changes.mapPos(diagnostic.from, 1, MapMode.TrackDel);
71-
const to = changes.mapPos(diagnostic.to, -1, MapMode.TrackDel);
70+
let from;
71+
let to;
72+
try {
73+
from = changes.mapPos(diagnostic.from, 1, MapMode.TrackDel);
74+
to = changes.mapPos(diagnostic.to, -1, MapMode.TrackDel);
75+
} catch (_) {
76+
continue;
77+
}
7278
if (from != null && to != null) {
7379
mapped.push({ ...diagnostic, from, to });
7480
}

0 commit comments

Comments
 (0)