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

How to change configurations or project structure or where LSP thinks project root is? #379

Closed
DominikMendel opened this issue Feb 8, 2022 · 4 comments

Comments

@DominikMendel
Copy link

Describe the bug
This is my first time using lsp-java so I apologize that this is more a question than a bug.
I have a project structure like this .../ProjectRoot and within ProjectRoot I have some sub-folders. /ProjectRoot/Project, /ProjectRoot/Apps, /ProjectRoot/Modules. The Project contains the necessary gradle files to build my project, but the Apps and Modules contain the Java files I need to edit and code with.

If I want to build my project from the command line this all works just fine

cd .../ProjectRoot/Project
~/./gradlew
~/./gradlew tasks
~/./gradlew assembleDebug

How can I configure lsp-java to see that is needs to build from /ProjectRoot/Project but also needs to link all the files from the other folders like /ProjectRoot/Apps, /ProjectRoot/Modules?
Any help would be greatly appreciated as I would love to do my dev work in Emacs.

Note
I am using this package out of the box with Doom Emacs.
I am also doing Android development, so there might be some hicups there. I am not expecting much though, I just want basic LSP Java features to work.

@yyoncho
Copy link
Member

yyoncho commented Feb 8, 2022

Use M-x lsp-workspace-folders-add/remove or I in the import project dialog. As a side note, AFAIK jdtls server does not work well with Android projects.

@yyoncho yyoncho closed this as completed Feb 8, 2022
@DominikMendel
Copy link
Author

Use M-x lsp-workspace-folders-add/remove or I in the import project dialog. As a side note, AFAIK jdtls server does not work well with Android projects.

Thanks for the help, sadly I don't think that fixed my issue and it might be because of the whole Android project thing.
Do you have any recommendations or know of alternatives to use for Android?

@yyoncho
Copy link
Member

yyoncho commented Feb 8, 2022

There is netbeans server https://github.com/timfel/lsp-netbeans but I am not sure if it will work with Android projects too

@timfel might know.

@timfel
Copy link

timfel commented Feb 11, 2022

I don't know about Android apps, but I do know the netbeans team has been focusing mostly on making gradle and micronaut work well recently. So you may be lucky the gradle support alone is good enough to understand the project structure

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

No branches or pull requests

3 participants