-
Notifications
You must be signed in to change notification settings - Fork 89
Description
Incorrect Package error
Problem:
Even when my Java package names match the folder structure, VS Code shows an “Incorrect Package” error.
For example, my structure is:
src/
└── Model/
├── Doctor.java
├── Hello1.java
└── Tester.java
Inside Tester.java
:
package Model;
public class Tester {
}
But VS Code highlights the package Model; line with:
Incorrect Package (hints: 1:9-1:14)
This error goes away only after restarting VS Code, but it keeps coming back when I open or create new files.
Steps to Reproduce:
Create a folder src/Model/
Add Tester.java with package Model;
VS Code shows "Incorrect Package" error even though structure is valid.
Expected Behavior:
The Java package should be recognized correctly without requiring a VS Code restart.
Actual Behavior:
Incorrect package warning is shown until I restart VS Code.