-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make "evaluate" request support structured variables
Summary: This diff updates handling of "evaluate" request based on changes in Starlark api. All heavy weight work is done by variables request handling done in D50312131. Here we just register a value access path after evaluating expression. The downside of this approach is that expression is re-evaluated for each subsequent subvalue. I'm not sure if there is any caching in the evaluator maybe this is not an issue. ## Context I've noticed expressions are hardcoding `value.to_string()`. The way I'm planning to support this is by introducing `scope: Expr(String) | Local(String)` instead of name to VariablePath. "inspect_variable" will be able to 1) evaluate scope 2) evaluate access path. And everything stays pretty much the same it is right now Probably a better implementation would be based on unique identification for Value<'v>. This will require some API in Starlark that would fetch Value<'v> based on id. I don't really know much about Starlark internals to implement this now. However pivoting to this solution is effectively changing "scope" to "id" and the rest is pretty much stays the same Reviewed By: stepancheg Differential Revision: D50396039 fbshipit-source-id: bc2b846fd2f553c2142c54ebd5d10de6f4096f4c
- Loading branch information
1 parent
02b7e2b
commit bc089a6
Showing
3 changed files
with
57 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters