Comments (7)
Hi @gersonsosa
Not sure if you were saying that you'd like to look at or fix this yourself. If so, the code responsible for adding the semanticdb plugin is here...
bloop/frontend/src/main/scala/bloop/data/Project.scala
Lines 477 to 504 in 7a7a913
Currently it adds the semanticdb plugin to the classpath and adds various javac options. I guess it could test to see if -processorpath
exists and then classpath can be left unchanged and -processorpath
could be altered to include the semanticdb plugin path.
I note here that it's recommended to use the classpath unless you're using annotation processors so I don't know if there would be an issue moving to -processorpath
in all cases, maybe a performance hit?
It would also need to be changed in Metals here...
and possibly here but I don't know this area...
from bloop.
It looks correct what @Arthurm1 wrote. Let us know if you are interesting in helping out!
If you can't, it would be awesome if you created a small repro that we can take a look like. So probably a small project that uses a preprocessor.
from bloop.
What I would like some guidance is if I can include a sample project for example here as a test in the code or it would be best to just test the parts I change independently and where should I put those tests
I think using a sample project is perfectly fine, we already have some tests that use it. For example in the BspProtocolSuite. We have a method that loads up those test project (loadBspBuildFromResources
)
from bloop.
@gersonsosa I think you're right. It looks like the on-the-fly generation ignores the java options.
I'm looking to try to change how this code works so I'd recommend not bothering to change Metals.
from bloop.
@Arthurm1 @tgodzik thanks for your response, sure I’m in for helping out, while playing with the code it seems that with the changes in bloop
- here (by altering the processorpath string including semanticdb path)
bloop/frontend/src/main/scala/bloop/data/Project.scala
Lines 477 to 504 in 7a7a913
- also looking at whether it’s necessary to include the classpath if the processorpath is there, but this change seems optional
bloop/frontend/src/main/scala/bloop/data/Project.scala
Lines 530 to 541 in 7a7a913
things run smooth once again.
What I would like some guidance is if I can include a sample project for example here as a test in the code or it would be best to just test the parts I change independently and where should I put those tests
additionally I haven’t checked metals code but I can give a try after having a PR for bloop.
from bloop.
@tgodzik @Arthurm1 I finally got some time to work on this, I made a small PR to fix this, I included small project in the test resources
I'll now look into metals now, I'm not sure why we have to change it there though
from bloop.
To elaborate on why I'm not sure I have to change metals usages of javac
I think the parts where metals compile java sources using javac
do not rely on the build tool to generate the classpath of the command, therefore they will never have the -processorpath
option when executing (please correct me if I'm wrong)
- for on the fly generation https://github.com/scalameta/metals/blob/8283260dc275a82dea0261ad3aaec632892014b2/metals/src/main/scala/scala/meta/internal/metals/JavaInteractiveSemanticdb.scala#L63
- for the project settings https://github.com/scalameta/metals/blob/8283260dc275a82dea0261ad3aaec632892014b2/sbt-metals/src/main/scala/scala/meta/metals/MetalsPlugin.scala#L67
I added a small test to a branch here it seems to work as expected https://github.com/gersonsosa/metals/tree/fix-java-options-processorpath
from bloop.
Related Issues (20)
- `bloop exit` is undocumented in CLI help and completions HOT 1
- Java modules are not handled properly HOT 2
- I met these error message in 1.5.6 and 1.5.8 HOT 1
- Bloop server has different behavior with sbt in macro HOT 1
- Incremental compile is broken in 1.5.10 HOT 3
- Bloop home directory on Linux HOT 2
- Submit to winget HOT 1
- bug: deduplicate for cancelled compilations
- Support JDK 19 HOT 2
- sbt-bloop (0.5.12) suddenly started compiling when running sbt bloopInstall HOT 6
- Cannot discover test frameworks
- `java.lang.ArrayIndexOutOfBoundsException` while compilation HOT 4
- Include provided dependency in runtime classpath
- Issues with semanticdb if workspace contains whitespace
- Invalid "sources" list generated for project with '-test' suffix.
- installation on mac fails HOT 5
- Bloop can't compile Dotty HOT 4
- multiple errors like "bad path element "... ": no such file or directory when building Apache Kafka HOT 4
- Broken link in the docs
- Is there an older version of bloop that I can use with Gradle 2.x ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bloop.