-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot evaluate expression on value definition #103
Comments
I can still reproduce the issue in Metals, can you take a second look @tdudzik ? |
Just a sanity check, but make sure you have the new bloop that it brought in running and not the old one. I've made that mistake more than once when testing this out 😆 |
Actually, it doesn't always work. It seems there were two issues with that case and I've fixed only one of them. The other one should be fixed soon. |
@tdudzik Can you share the reproduction case? |
@adpi2 it seems that it works only when a value/variable is defined but it's not used, so e.g.: val a = 1 // breakpoint
println("Hello, World!") it's not going to work: val a = 1 // breakpoint
println(a) The reason is that in {
1 + 2 // expression
val a = 1
}
println(a) and then the value |
Do we need to have |
I originally brought this up in scalameta/metals#2959 while testing out the new code evaluation in Metals. I noticed that given a situation where you set a breakpoint before a variable is assigned, any evaluation is then blocked since it seems to not find that variable. A picture is worth a thousand words so you can see what I mean here:
Notice that I'm stopped on the line containing
val y = x * 3
. I'm just trying to evaluate3 * 6
here, and I'd expect that to work instead of getting the message aboutnot found: value y
.The same thing happens if you try to access another variable that should already be assigned like
x
in this example:Notice that it is there when looking at the variables, but when I try to access it via just
x
where the expressions are entered at the bottom, I again see the message.I tested this with the pr in Metals here: scalameta/metals#2959 while using nvim-metals, which integrates with nvim-dap.
As a total aside, great job on this so far. It's fantastic to see this working. In the above examples if I just step over once, then everything works.
The text was updated successfully, but these errors were encountered: