Sprint 2 Step 36: Lock warnings in UI

This commit is contained in:
Bill
2026-02-07 06:19:10 -07:00
parent 8f39c8edfb
commit 7dc31f48a7
5 changed files with 114 additions and 12 deletions

View File

@@ -135,6 +135,30 @@ public:
return getNodeLock(node->parent);
}
// Get all locks on a node and its ancestors
std::vector<const OptimizationLock*> getLocks(const std::string& nodeId) const {
std::vector<const OptimizationLock*> locks;
// Find the node by ID
ASTNode* node = findNodeById(currentAST.get(), nodeId);
if (!node) return locks;
// Collect all locks from the node and up the ancestry
const ASTNode* current = node;
while (current) {
// Check if this node has any optimization lock annotations
auto annotations = current->getChildren("annotations");
for (const auto* annotation : annotations) {
if (annotation->conceptType == "OptimizationLock") {
locks.push_back(static_cast<const OptimizationLock*>(annotation));
}
}
current = current->parent;
}
return locks;
}
// Record an operation for undo/redo
void recordOperation(const json& operation) {
// Clear any operations after the current position (if we're in the middle of the undo stack)