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 multiple folders to src path #412

Closed
yababer opened this issue Dec 10, 2020 · 6 comments
Closed

Add multiple folders to src path #412

yababer opened this issue Dec 10, 2020 · 6 comments
Labels

Comments

@yababer
Copy link

yababer commented Dec 10, 2020

We are trying to make this work with a Bazel mono-repo and are wondering if there is a programmatic way to add multiple src folders to the .classpath file?

Right now it seems to add the first src/main/java folder if finds to the .classpath file and then stops. If you right-click on another folder and add it to the java source path that works fine.

For example:

<classpath>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="src" path="{default added folder 1}"/> 
        <classpathentry kind="src" path="{manually added folder 2}"/>
<classpath>

It would be nice to have a config like this:

  "java.project.srcs": [
    "/src/main/java",
    "/src/test/java"
  ]

For example, this shell script exports the desired src folders.

SRC_PATHS=$(find . -type d -path '*/src/main/java' -o -path '*/src/test/java')

Hopefully, there is another, simpler way to do this.

@jdneo
Copy link
Member

jdneo commented Dec 11, 2020

Currently the Java Language Server does not support Bazel. By doing right-click on another folder and add it to the java source path. It's actually treat the project as a no build tool project.

I'm actually curious if that really works for your Bazel project?

@yababer
Copy link
Author

yababer commented Dec 11, 2020 via email

@jdneo
Copy link
Member

jdneo commented Dec 17, 2020

The team is now thinking about the classpath management experience(source path, jdk, dependencies) as a whole big feature.

The rough idea is users can manage the classpath in a webview. I'll update if we have anything new.

@no-response
Copy link

no-response bot commented Feb 1, 2021

This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

@jdneo
Copy link
Member

jdneo commented Mar 9, 2021

The upstream issue has been fixed.

In the next version, you should be able to use the setting java.project.sourcePaths to specify your source paths for the project without any build tools

@siddh78
Copy link

siddh78 commented Sep 27, 2024

Can we define the output folder correspnding to each source path ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants