Vscode-java-debug: Cannot evaluate because of compilation error(s): Evaluations must contain either an expression or a block of well-formed statements

Created on 28 Jan 2020  路  11Comments  路  Source: microsoft/vscode-java-debug

Environment
  • Operating System: Win 10
  • JDK version: openjdk version "11.0.5" 2019-10-15
  • Java extension version: ?? do you mean "Language Support for Java(TM) by Red Hat"? if so 0.55.1
  • Java Debugger extension version: 0.24.0
  • Visual Studio Code Version: 1.41.1 (user setup)
  • Commit: 26076a4de974ead31f97692a0d32f90d735645c0
  • Date: 2019-12-18T14:58:56.166Z
  • Electron: 6.1.5
  • Chrome: 76.0.3809.146
  • Node.js: 12.4.0
  • V8: 7.6.303.31-electron.0
  • OS: Windows_NT x64 10.0.18363
Steps To Reproduce
  1. Use a Stream.forEach() and try to evaluate something in the debug console

Sample project

java test runner - can't evaluate.log

Current Result

image

maybe it more has to do w/ lambda's? 馃

image

Expected Result

image

image

Additional Informations
bug

Most helpful comment

image
Obviously, this problem is still unresolved, sad.

All 11 comments

Also, the debugger variables window is able to see the values:

image

@spottedmahn thanks for reaching out. It looks like a bug to me. @testforstephen please take a look.

The upstream jdt has the same error on inspecting variable in the lambda expression. Need take a look at the upstream jdt first.

Apologies for slightly hijacking this issue, but i have a very similar issue and want to check if it is same/related. When trying to evaluate in generic code, all evaluations fail with "Cannot evaluate because of a compilation error(s): Evaluations must contain either an expression or a block of well-formed statements". This is not a lambda, it's just a plain method of a (generic) type. I tried a trivial example and expressions worked with generics, so does this sound like the same bug ?

Any update on this issue? This is adding a lot of friction for me while debugging.

The upstream has added the support for the lambda support in 2020-03 release, and already integrated to the debugger extension. See the upstream issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=560392

@puremourning @noel-yap Could you please open a new bug for your issue? Also please add the code snippet to explain your scenario.

@akaroml @testforstephen - any idea when that eclipse fix will be incorporated with vs code extension / tools? Also, looking at the issue on the eclipse site it appears that working with streams it's still not fixed.

Debugger 0.27.0 just released today, the fix should be already there. Could you try again?

BTW, you also need update Language Support for Java by Red Hat extension to latest version 0.64.1.

image
Obviously, this problem is still unresolved, sad.

Hi all,

I've the same issue trying to evaluating expression in a Tomcat application. Do you know how to solve it?

Thanks,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gcbartlett picture gcbartlett  路  3Comments

mojo2012 picture mojo2012  路  3Comments

llgcode picture llgcode  路  7Comments

khe817 picture khe817  路  4Comments

mojo2012 picture mojo2012  路  5Comments