Skip to content
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

regression: Unresolved Types compilation error when running from code lens #957

Closed
rdcoe opened this issue Mar 8, 2021 · 3 comments
Closed
Assignees

Comments

@rdcoe
Copy link

rdcoe commented Mar 8, 2021

Maven successfully builds and runs tests but VsCode reports a missing type. The type is part of the source code and is package private. This has occurred with two Types, both of which are package private.

e.g., stdout on running the application:
io.vertx.core.impl.NoStackTraceThrowable: Unresolved compilation problems:
SQLquery cannot be resolved to a variable
SQLquery cannot be resolved to a type
SQLquery cannot be resolved to a variable
SQLquery cannot be resolved to a variable

Ignore the fact that it's vert.x that's being used to run it. This problem is new and possibly related to whatever broke the code formatter extension. I was successfully running this code using VsCode's code lens all day. I reloaded after updating extensions and ever since, I am seeing the Java Server fail to pick up Types in my project. If I open an editor of a Type that references package private members, the Type (say Type A) shows those as missing. If I ctrl+click to open the "missing" type (say Type B), a new editor opens to Type B and the compilation error in Type A goes away. However, if I run the code, the console output tells me I have a code compilation problem. At a minimum, VsCode should not start my application's main method without prompting me to continue, if I actually have a compilation error.

Environment
  • Operating System: Windows 10 using a WSL workspace

cat /etc/debian_version
bullseye/sid
uname -a
Linux BEASTIE 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  • JDK version: > java -version
    openjdk version "11.0.9.1" 2020-11-04
    OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10)
    OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10, mixed mode, sharing)
  • Visual Studio Code version:

code -v
1.54.1
f30a9b73e8ffc278e71575118b6bf568f04587c8
x64

  • Java extension version: v0.12.1
  • Java Debugger extension version: v0.31.0
@rdcoe
Copy link
Author

rdcoe commented Mar 8, 2021

For reference, adding the Problems view, to demonstrate that vsCode does not have any compilation errors.

image

@testforstephen
Copy link
Contributor

When you manually compile the workspace via "F1 -> Java: Force Java Compilation", did you see any compilation errors?

At a minimum, VsCode should not start my application's main method without prompting me to continue, if I actually have a compilation error.

This is duplicated with #949

@testforstephen testforstephen self-assigned this Mar 8, 2021
@rdcoe
Copy link
Author

rdcoe commented Mar 8, 2021

Unfortunately, or fortunately, I can't reproduce. I refactored my code a number of times trying to find the compilation problem. I now have my code compiling and running. In my steps to find the problem, I never did isolate it. Maven could always build and run tests and VsCode didn't show compilation failures but couldn't run the code. In the end, I must have solved it, because vsc is working and I have reduced the visibility of my Types back to package private.

I'll close this for now, because the problem is too hard to reproduce.

@rdcoe rdcoe closed this as completed Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants