Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

buildTargetScalacOptions and buildTargetJavacOptions are returning empty #29

Closed
SocksDevil opened this issue Dec 31, 2020 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@SocksDevil
Copy link
Contributor

After working on extending the BSP testkit for the extension methods, I decided to test the sample repo used here against those methods. It would seem both buildTargetScalacOptions and buildTargetJavacOptions are returning empty responses.

We should try and see what is going on there. Furthermore, after the testkit update is merged, we should take the chance to also make sure those requests are tested.

@SocksDevil SocksDevil added the bug Something isn't working label Dec 31, 2020
@SocksDevil
Copy link
Contributor Author

After doing some digging, I've managed to find where the problem lies: BazelBspServer is only initialized with buildServer, neglecting java and scala specific servers. This is related to the separation of concerns refactor done in #24 .

@gerardd33 I think we need to create a new class that takes all the implementations and serves it in one API. Wdyt? cc @agluszak @abrams27 @magda-aug

@gerardd33
Copy link
Contributor

After doing some digging, I've managed to find where the problem lies: BazelBspServer is only initialized with buildServer, neglecting java and scala specific servers. This is related to the separation of concerns refactor done in #24 .

@gerardd33 I think we need to create a new class that takes all the implementations and serves it in one API. Wdyt? cc @agluszak @abrams27 @magda-aug

I thought about it while doing this and to avoid this problem I made BazelBspServer store as attributes all three and they're initialised in startServer:

this.scalaBuildServer = new ScalaBuildServerImpl(scalaBuildServerService, serverRequestHelpers);
this.javaBuildServer = new JavaBuildServerImpl(javaBuildServerService, serverRequestHelpers);
this.buildServer = new BuildServerImpl(buildServerService, serverRequestHelpers);

But when I think about it now, I missed this spot – the problem seems to be here, right?:

new Launcher.Builder<BuildClient>()
...
.setLocalService(this.buildServer)
...

So this seems to be the place where we need this one hub for all the interfaces (I think @abrams27 asked about it once on the call and we all couldn't think of a reason why we shouldn't split it).

I agree, it looks like we should pass something that aggregates all of the endpoints here. I can try to fix it.

@SocksDevil
Copy link
Contributor Author

But when I think about it now, I missed this spot – the problem seems to be here, right?:

new Launcher.Builder<BuildClient>()
...
.setLocalService(this.buildServer)
...

Yeah that's exactly it 😄

@gerardd33
Copy link
Contributor

But when I think about it now, I missed this spot – the problem seems to be here, right?:

new Launcher.Builder<BuildClient>()
...
.setLocalService(this.buildServer)
...

Yeah that's exactly it

Okay, I'll do it later today.

@abrams27
Copy link
Member

abrams27 commented Jun 10, 2021

fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants