-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix edge case of ShowExecutionPreview #13173
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -478,17 +478,20 @@ public ChangeSetComputer Clone() | |
{ | ||
comp.currentSubTreeList.Add(subTreePairs.Key, subTreePairs.Value); | ||
} | ||
|
||
comp.csData = new ChangeSetData(); | ||
comp.csData.ContainsDeltaAST = csData.ContainsDeltaAST; | ||
comp.csData.DeletedBinaryExprASTNodes = new List<AssociativeNode>(csData.DeletedBinaryExprASTNodes); | ||
comp.csData.DeletedFunctionDefASTNodes = new List<AssociativeNode>(csData.DeletedFunctionDefASTNodes); | ||
comp.csData.RemovedBinaryNodesFromModification = new List<AssociativeNode>(csData.RemovedBinaryNodesFromModification); | ||
comp.csData.ModifiedNodesForRuntimeSetValue = new List<AssociativeNode>(csData.ModifiedNodesForRuntimeSetValue); | ||
comp.csData.RemovedFunctionDefNodesFromModification = new List<AssociativeNode>(csData.RemovedFunctionDefNodesFromModification); | ||
comp.csData.ForceExecuteASTList = new List<AssociativeNode>(csData.ForceExecuteASTList); | ||
comp.csData.ModifiedFunctions = new List<AssociativeNode>(csData.ModifiedFunctions); | ||
comp.csData.ModifiedNestedLangBlock = new List<AssociativeNode>(csData.ModifiedNestedLangBlock); | ||
|
||
if (csData != null) | ||
{ | ||
comp.csData = new ChangeSetData(); | ||
comp.csData.ContainsDeltaAST = csData.ContainsDeltaAST; | ||
comp.csData.DeletedBinaryExprASTNodes = new List<AssociativeNode>(csData.DeletedBinaryExprASTNodes); | ||
comp.csData.DeletedFunctionDefASTNodes = new List<AssociativeNode>(csData.DeletedFunctionDefASTNodes); | ||
comp.csData.RemovedBinaryNodesFromModification = new List<AssociativeNode>(csData.RemovedBinaryNodesFromModification); | ||
comp.csData.ModifiedNodesForRuntimeSetValue = new List<AssociativeNode>(csData.ModifiedNodesForRuntimeSetValue); | ||
comp.csData.RemovedFunctionDefNodesFromModification = new List<AssociativeNode>(csData.RemovedFunctionDefNodesFromModification); | ||
comp.csData.ForceExecuteASTList = new List<AssociativeNode>(csData.ForceExecuteASTList); | ||
comp.csData.ModifiedFunctions = new List<AssociativeNode>(csData.ModifiedFunctions); | ||
comp.csData.ModifiedNestedLangBlock = new List<AssociativeNode>(csData.ModifiedNestedLangBlock); | ||
} | ||
return comp; | ||
} | ||
|
||
|
@@ -601,7 +604,7 @@ private IEnumerable<AssociativeNode> GetDeltaAstListDeleted(IEnumerable<Subtree> | |
return deltaAstList; | ||
} | ||
|
||
private IEnumerable<AssociativeNode> GetDeltaAstListAdded(IEnumerable<Subtree> addedSubTrees) | ||
internal IEnumerable<AssociativeNode> GetDeltaAstListAdded(IEnumerable<Subtree> addedSubTrees) | ||
{ | ||
var deltaAstList = new List<AssociativeNode>(); | ||
if (addedSubTrees != null) | ||
|
@@ -787,7 +790,6 @@ private void UpdateCachedASTList(Subtree st, List<AssociativeNode> modifiedASTLi | |
} | ||
} | ||
|
||
|
||
private IEnumerable<AssociativeNode> GetDeltaAstListModified(List<Subtree> modifiedSubTrees) | ||
{ | ||
var deltaAstList = new List<AssociativeNode>(); | ||
|
@@ -1660,11 +1662,30 @@ private void CompileAndExecuteForDeltaExecution(List<AssociativeNode> astList) | |
private List<Guid> PreviewInternal(GraphSyncData syncData) | ||
{ | ||
var previewChangeSetComputer = changeSetComputer.Clone(); | ||
|
||
// Get the list of ASTs that will be affected by syncData | ||
var previewAstList = previewChangeSetComputer.GetDeltaASTList(syncData); | ||
|
||
// Get the list of guid's affected by the astlist | ||
List<Guid> cbnGuidList = previewChangeSetComputer.EstimateNodesAffectedByASTList(previewAstList); | ||
|
||
var finalDeltaAstList = new List<AssociativeNode>(); | ||
|
||
// Newly added nodes will not be in the VM yet. | ||
// So we need to add them to the preview list. | ||
var addCSComputer = changeSetComputer.Clone(); | ||
|
||
var addedDeltaAsts = addCSComputer.GetDeltaAstListAdded(syncData.AddedSubtrees); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pinzart90 can't you use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly yes. If I use the |
||
foreach (AssociativeNode ast in addedDeltaAsts) | ||
{ | ||
if (ast is BinaryExpressionNode bnode) | ||
{ | ||
if (!cbnGuidList.Contains(bnode.guid)) | ||
{ | ||
cbnGuidList.Add(bnode.guid); | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The preview functionality in question is to color the connectors between nodes that need to be recomputed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not just connectors, it should be the node UI as well, but the new UI was not updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mjkkirschner by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, that when updating the NodeView's for the visual refresh it appears this feature was never tested. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the highlight control is commented out in the nodeview xaml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, appearantly this is an incomplete feature but we should be able to make it better, once this PR is merged I can continue to work on #12908 |
||
return cbnGuidList; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QilongTang It seems to me like we should be watching both ends of the connector.
Can you confirm this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good one!