import { syntaxTree } from "@codemirror/language";
import { linter, type Diagnostic } from "@codemirror/lint";
const ipfLinter = linter((view) => {
const diagnostics: Diagnostic[] = [];
if(view.state.doc['text'][0].trim() === '') {
return;
}
console.log(syntaxTree(view.state))
syntaxTree(view.state)
.cursor()
.iterate((node) => {
if (node.type.isError) {
diagnostics.push({
from: node.node.parent.from,
to: node.node.parent.to,
severity: "warning",
message: "Error",
});
}
});
return diagnostics;
});
I know there’s an error here when ‘node.type.isError === true’ but don’t know why it’s happening.
How should I get the error message