-
Notifications
You must be signed in to change notification settings - Fork 408
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
Add a new command to get all Java projects #1447
Conversation
Signed-off-by: Sheng Chen <[email protected]>
@@ -128,6 +130,17 @@ public static boolean isTestFile(String uri) throws CoreException { | |||
return false; | |||
} | |||
|
|||
public static List<URI> getAllJavaProject() { | |||
List<URI> javaProejcts = new LinkedList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javaProjects
Signed-off-by: Sheng Chen <[email protected]>
public static List<URI> getAllJavaProjects() { | ||
List<URI> javaProjects = new LinkedList<>(); | ||
for (IJavaProject javaProejct : ProjectUtils.getJavaProjects()) { | ||
if (ResourcesPlugin.getWorkspace().getRoot().getProject(ProjectsManager.DEFAULT_PROJECT_NAME).equals(javaProejct.getProject())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you return the default project? Might be valuable information to get for standalone Java files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I'm thinking that the project path of the default project is totally different from that of the standalone Java files. The client side needs to have a way to resolve such mapping...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, no mapping = default project, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I also thinks of that actually. What I'm afraid is, it might be in some situation that the client side cache is out of sync?
Hmm, Can I say that, if a java file does not belongs to any workspace folder, then it belongs to the default project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's probably an accurate assumption.
@@ -128,6 +130,17 @@ public static boolean isTestFile(String uri) throws CoreException { | |||
return false; | |||
} | |||
|
|||
public static List<URI> getAllJavaProjects() { | |||
List<URI> javaProjects = new LinkedList<>(); | |||
for (IJavaProject javaProejct : ProjectUtils.getJavaProjects()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javaProject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think I need to install a spelling checking extension. 😄
Signed-off-by: Sheng Chen <[email protected]>
Thanks @jdneo |
See redhat-developer/vscode-java#1457
Signed-off-by: Sheng Chen [email protected]