You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 2 directories and each of them has a file which has the same name.
Now vscode-java is unable to differentiate between these two files.
Thus this has resulted into unavailability of autocomplete feature and the docstring of various functions and methods.
Environment
Operating System: ElementaryOS x64
JDK version: javac 1.8.0_171
Visual Studio Code version: 1.23.1
Java extension version: 0.25
Steps To Reproduce
First compile the Hello.java file in folder1
then open the folder2 and try to use any method from the class in the same directory
Notice that autocomplete will provide wrong or maybe no hints at all as there is same java file in both directory i.e. Phone.java.
Is this because that vscode-java takes the entire scope in consideration means if one class has already been compiled then the methods and attributes of that class will be shown at other places too?
In the case of non-maven/gradle projects, all classes are added to a pseudo default java project in the backend. So identical files with the same namespace conflict with each other, there's no way to fix that on the vscode-java side.
On your side, you can start by at least using package names, to disambiguate the classes, i.e
folder1/project1/Phone.java (declaring package project1; in its header)
folder2/project2/Phone.java (declaring package project2; in its header)
Activity
fbricon commentedon May 25, 2018
In the case of non-maven/gradle projects, all classes are added to a pseudo default java project in the backend. So identical files with the same namespace conflict with each other, there's no way to fix that on the vscode-java side.
On your side, you can start by at least using package names, to disambiguate the classes, i.e
package project1;in its header)package project2;in its header)rajkumarGosavi commentedon May 25, 2018
Yes, It surely does solve the problem. Thank you for your reply.