Fix to cache correct PathToNode in artifact graph (#6632)
* Add NodePath to artifact graph Since this is cached, this should make PathToNode computation correct even when code is formatted, whitespace changes, and source ranges are different. * Remove dead code * Add unit tests * Add tests for PathToNode conversion * Remove unused parameter * Add missing PathToNode cases * Fix to handle unlabeled arg * Cherry pick unlabeled arg fix * Change PathToNode comment to match TS implementation
This commit is contained in:
@ -87,7 +87,7 @@ export default class RustContext {
|
||||
JSON.stringify(settings)
|
||||
)
|
||||
/* Set the default planes, safe to call after execute. */
|
||||
const outcome = execStateFromRust(result, node)
|
||||
const outcome = execStateFromRust(result)
|
||||
|
||||
this._defaultPlanes = outcome.defaultPlanes
|
||||
|
||||
@ -161,29 +161,13 @@ export default class RustContext {
|
||||
): Promise<ExecState> {
|
||||
const instance = await this._checkInstance()
|
||||
|
||||
const ast: Node<Program> = {
|
||||
body: [],
|
||||
shebang: null,
|
||||
start: 0,
|
||||
end: 0,
|
||||
moduleId: 0,
|
||||
nonCodeMeta: {
|
||||
nonCodeNodes: {},
|
||||
startNodes: [],
|
||||
},
|
||||
innerAttrs: [],
|
||||
outerAttrs: [],
|
||||
preComments: [],
|
||||
commentStart: 0,
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await instance.bustCacheAndResetScene(
|
||||
JSON.stringify(settings),
|
||||
path
|
||||
)
|
||||
/* Set the default planes, safe to call after execute. */
|
||||
const outcome = execStateFromRust(result, ast)
|
||||
const outcome = execStateFromRust(result)
|
||||
|
||||
this._defaultPlanes = outcome.defaultPlanes
|
||||
|
||||
|
Reference in New Issue
Block a user