-
Notifications
You must be signed in to change notification settings - Fork 418
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
Classes compile outside vscode in CLI, but in vs-code problem section displays errors and editor highlights code lines in red #1531
Comments
Can you please share your project or at least the build.gradle file? |
@fabricon: Couldn't share the project. However, I could give little more details
If you could be specific on the part of build.gradle, like which build.gradle as there are too many in my project. |
It seems like the underlying Eclipse JDT Language Server, which is currently ignoring the exclusions completely (it also does for our legacy Eclipse Projects on JDK8). The settings are properly forwarded to it. They just don't work, not matter how you specify them. So basically it's still trying to parse the folders ... even tough it was properly set by the vscode-java extension. I'm not sure under what circumstances the Eclipse Language Server is used in vscode-java (just legacy projects or for everything) tough. In our case we aren't even using gradle or maven (its still using IVY), and I doubt its related to gradle or maven either. @fbricon - see in eclipse.jdt.ls GH: |
As mentioned earlier, there are 2 problems
From my side, tried these
Any update on this or tweaks to fix this is appreciated |
@sairaghavak 'The field SrkDemo.SrkInnerStatic.ID is not visible' is correct. The field is private. |
@snjeza Not sure if you are saying that it's obvious. |
@sairaghavak This issue is an upstream eclipse issue. Could you create a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT? |
@snjeza : Created a bug there: https://bugs.eclipse.org/bugs/show_bug.cgi?id=565925 How about the second part in this issue.
Ant tweak suggestions for this to resolve in vscode or it's a vscode Gradle plugin issue? |
@sairaghavak could you attach your build.gradle from the junit_tests project? |
I'm having a similar issue, except vscode can't seem to find my protobuf libraries, despite working fine from both Intellij (with intellisense), and CLI (gradle build and run configurations). |
@dragozir Could you, please, attach your project or your build.gradle file? |
Would it benefit to see the .classpath as well? It is correctly finding my sources and generated sources, but doesn't seem to be picking up any external libraries for intellisense. I can Ctrl+Click through
|
@dragozir Could you try replace
with
or remove this line. |
Installing openjdk-14-source with apt correctly provides the symlink from src.zip -> lib/src.zip, so thank you for steering me in the right direction there. .class now shows up for all java built-ins. Still having the issue with external libraries, however this seems related to intellisense as gradle is able to build and run fine. |
I have similar issue in tests as well. It shows:
However, it compiles fine from command line and IntelliJ. Here's a piece of code:
Here's a bit of info about my vscode
|
Java Code is compiling neatly, outside the Vs-Code IDE i.e., from command line and other IDE's like IntelliJ, but when I import my project into VS-Code there are some errors displayed in problems section. Some of them are shown here with screenshots
Environment
Steps To Reproduce the
Java Model Exception: Java Model Status [Cannot nest '<project>/src/main/resources' inside '<project>/src/main'. To enable the nesting exclude 'resources/' from 'junit_tests/src/main']
Current Result
Below is the Java language server log file excerpt
I have tried excluding the resources folder, but no luck, problems section still has this.
All these compile times issues or problems shown in the problems section in vsc-code are not detected in IntelliJ IDE. Not sure why the is is happening.
The code/java intellisense cannot trace the relationship between so, red marks with lines highlighted is shown, but actually that's not the case, as the classes are compiled perfectly from command line.
Some of the compiler issues, shown in the problems section are
-
The text was updated successfully, but these errors were encountered: