Change to use nodePath instead of sourceRange for Operations (#7320)
* Add NodePath to operations * Change to use nodePath to get pathToNode instead of sourceRange * Add additional node path unit test * Update output * Fix import statement NodePaths * Update output * Factor into function
This commit is contained in:
		@ -14,6 +14,24 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
      "sourceRange": []
 | 
			
		||||
    },
 | 
			
		||||
    "labeledArgs": {},
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 0
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "PipeBodyItem",
 | 
			
		||||
          "index": 0
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
@ -46,6 +64,24 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
        "sourceRange": []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 1
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "PipeBodyItem",
 | 
			
		||||
          "index": 0
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
@ -91,6 +127,24 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
        "sourceRange": []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 1
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "PipeBodyItem",
 | 
			
		||||
          "index": 1
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
@ -142,6 +196,24 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
        "sourceRange": []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 1
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "PipeBodyItem",
 | 
			
		||||
          "index": 2
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
@ -194,6 +266,24 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
        "sourceRange": []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 1
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "PipeBodyItem",
 | 
			
		||||
          "index": 3
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
@ -218,6 +308,24 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
        "sourceRange": []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 2
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "PipeBodyItem",
 | 
			
		||||
          "index": 0
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
@ -242,6 +350,24 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
        "sourceRange": []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 3
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "PipeBodyItem",
 | 
			
		||||
          "index": 0
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
@ -274,6 +400,20 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
 | 
			
		||||
        "sourceRange": []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nodePath": {
 | 
			
		||||
      "steps": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "ProgramBodyItem",
 | 
			
		||||
          "index": 4
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationDeclaration"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "VariableDeclarationInit"
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sourceRange": []
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user