-
Notifications
You must be signed in to change notification settings - Fork 11
Move splitted operation references to cli-split-operation-splitted-operations #66
Changes from 2 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 |
---|---|---|
|
@@ -29,6 +29,7 @@ export class NodeHelper { | |
private static readonly POLY_AS_PARAM_ORIGINIAL_PARAMETER = 'cli-poly-as-param-original-parameter'; | ||
private static readonly POLY_AS_PARAM_EXPANDED = 'cli-poly-as-param-expanded'; | ||
private static readonly SPLIT_OPERATION_ORIGINAL_OPERATION = 'cli-split-operation-original-operation'; | ||
private static readonly SPLIT_OPERATION_INTO_OPERATIONS = 'cli-split-operation-into-operations'; | ||
private static readonly SPLIT_OPERATION_NAMES = 'split-operation-names'; | ||
|
||
private static visitedKeyDict = {}; | ||
|
@@ -219,6 +220,16 @@ export class NodeHelper { | |
return NodeHelper.getExtensionsProperty(op, NodeHelper.SPLIT_OPERATION_ORIGINAL_OPERATION, null); | ||
} | ||
|
||
public static addSplitOperationIntoOperations(op: Operation, splittedOp: Operation) { | ||
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. how about make it more generic to have it in NodeHelper, we dont need split concept here, for example, addExtendedOperation(node: Operation, operation: Operation) 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 am worried about generic may cause confusing. Because previously we put these operations in cli-operations, which makes az cannot know these operations come from poly or split. That's why I create an independent property for split. 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. Removed reference. Thanks |
||
const ops: Operation[] = NodeHelper.getExtensionsProperty(op, NodeHelper.SPLIT_OPERATION_INTO_OPERATIONS, () => []); | ||
ops.push(splittedOp); | ||
NodeHelper.setExtensionsProperty(op, NodeHelper.SPLIT_OPERATION_INTO_OPERATIONS, ops); | ||
} | ||
|
||
public static getSplitOperationIntoOperations(originalOperation: Operation, defaultValue: () => any): Operation[] { | ||
return NodeHelper.getExtensionsProperty(originalOperation, NodeHelper.SPLIT_OPERATION_INTO_OPERATIONS, defaultValue); | ||
} | ||
|
||
public static setPolyAsParamBaseSchema(param: Parameter, base: Schema) { | ||
NodeHelper.setExtensionsProperty(param, NodeHelper.POLY_AS_PARAM_BASE_SCHEMA, base); | ||
} | ||
|
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.
this code is getter more and more complex, feel free to refactor it if you want.
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, I will do refactor later, thanks