Skip to content

Commit

Permalink
feat: feature check in operation added
Browse files Browse the repository at this point in the history
  • Loading branch information
Ateyu committed Sep 18, 2024
1 parent e55e8f9 commit b23a414
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/language.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,24 @@ export const customLinter = linter(view => {
message: "A constraint can only have one pair of parentheses."
});
}
node.node.getChildren("Operation").forEach(operationNode => {
let keyNode = operationNode.getChild("Key");
if (keyNode) {
let keyText = view.state.doc.sliceString(keyNode.from, keyNode.to).trim();
//ToDo enable for Keys too. find bug
if (!featureKeysMap.has(keyText)) {
diagnostics.push({
from: keyNode.from,
to: keyNode.to,
severity: "error",
message: `"${keyText}" is not a valid key or feature.`
});
}
}
});

let previousItem = null;
// ToDo remove after testing
//let previousItem = null;
node.node.getChildren("ConstraintsItem").forEach(constraintItemNode => {
let constraintItemText = view.state.doc.sliceString(constraintItemNode.from, constraintItemNode.to).trim();

Expand Down

0 comments on commit b23a414

Please sign in to comment.