Leverage AST and Java Runtime to resolve inline values #368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


The steps:
Visit AST tree to find the variable tokens in each lines.
ASTVisitor can identify if a node is a variable declaration and a simple name. And then based on resolveBinding, it's easy to tell if the name is a variable/field binding.
Resolve the values of the variable tokens.
Once the variable names in each lines are found, next step is to resolve values for these variables. Usually the variables come from four places, we can use different methods to get the values.
For the first two kinds, they are visible local variables of the current stack frame, and by default their values will be expanded by Variables View. So we're going to return them with VariableLookup kind to tell client to look them up in Variables View directly.
For the last two kinds, their values are hidden as properties of 'this' object and require additional evaluation to get their values. So we're going to return them with Evaluation kind, and then calling the debuggee runtime to evaluate their values.