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

Javac-based diagnostics not producing IProblem.PackageIsNotExpectedPackage #747

Open
mickaelistria opened this issue Aug 26, 2024 · 4 comments

Comments

@mickaelistria
Copy link

JDT produces IProblem.PackageIsNotExpectedPackage when the folder doesn't match the package declaration. Javac doesn't provide that.
An extra check should probably be added to create this problem in the JavacCompilationUnitResolver or/and in JavacProblemConverter.

@fbricon
Copy link

fbricon commented Aug 26, 2024

that's actually one of javac's particular differences compared to ECJ. ECJ's pretty anal about package names matching the underlying folder, when javac compiles fine. I vaguely remember we've had users complaining about it in the past. So I think we might need a preference to toggle this particular diagnostic

@testforstephen
Copy link

Agree with @fbricon. One of package name issues for ECJ is that it does not support the folder name with dot characters. redhat-developer/vscode-java#1406

@mickaelistria
Copy link
Author

If this behavior is not required by VSCode-Java or JDT-LS, then I would recommend that we remove the associated test cases so we can evolve more freely. What do you think?

@testforstephen
Copy link

how about skipping these tests in the command line when running javac test but keeping them for the normal jdt.ls?

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

3 participants