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

Add a new command to get all Java projects #1447

Merged
merged 3 commits into from
May 20, 2020

Conversation

jdneo
Copy link
Contributor

@jdneo jdneo commented May 19, 2020

@@ -128,6 +130,17 @@ public static boolean isTestFile(String uri) throws CoreException {
return false;
}

public static List<URI> getAllJavaProject() {
List<URI> javaProejcts = new LinkedList<>();
Copy link
Contributor

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())) {
Copy link
Contributor

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

Copy link
Contributor Author

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...

Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javaProject

Copy link
Contributor Author

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. 😄

@fbricon fbricon merged commit 986257c into eclipse-jdtls:master May 20, 2020
@fbricon
Copy link
Contributor

fbricon commented May 20, 2020

Thanks @jdneo

@fbricon fbricon added this to the Mid May 2020 milestone May 20, 2020
@jdneo jdneo deleted the cs/statusbar branch March 12, 2021 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants