Open jievince opened 3 years ago
Thanks for reporting! The project contains pom.xml
, so it should work correctly, we support sbt, maven, gradle and mill. It looks like the build import failed, do you have any logs from that? You could try rerunning Metals: Import build
command via command palette or metals view.
Hi @tgodzik, before I execute mvn clean install
command in the shell to build the shell, and build success. But metals
go to definition
doesn't work.
And After I run Metals: Import build
as you say, it seems to trigger the build again? Does metals
just work when after import build
?
Indeed, I want to use metals
to do go to the definition
of functions and header packages.
Metals: Import build
is needed for Metals to function and it's not the same as mvn clean install
. It invokes maven to create configuration files that Metals (or Bloop in reality) can understand. Things should work after a successful import was run, but only for Scala files, Java files are not supported.
The Metals: Import build
has finished. But there are many errors, the logs are very long, So I intercepted part of it:
Edit (@tgodzik): I changed the logs to collapse on click.
Looks like there is a bunch of issues with your build and some things might not work correctly:
2021.08.04 17:16:42 WARN Error reading API from class file: org.neo4j.consistency.checker.ParallelExecution$RangeOperation : java.lang.UnsupportedClassVersionError: org/neo4j/consistency/checker/ParallelExecution$RangeOperation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
means that some of the code was compiled with JDK 11 and now it's being compiled with JDK 8. You might want to set the JDK version to the main one you are using in metals.javaHome
and do a mvn clean
before reimporting. Btw. You can just attach the metals.log file, which will make it easier to read.
Where to set metals.javaHome
?
Where to set
metals.javaHome
?
In the metals section of the VS Code settings unless you are using a different editor.
metals.javaHome
is jdk11, and I do Metals: Import build
after mvn clean
, the log errors seem as the same as before:
2021.08.04 17:59:18 ERROR code navigation does not work for the file '/home/bob/neo4j/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OrderedAggregationPipe.scala' because the SemanticDB file '/home/bob/neo4j/community/cypher/interpreted-runtime/target/bloop-bsp-clients-classes/classes-Metals-D4R8xLqIR0WzDB3T4H4-vg==/META-INF/semanticdb/community/cypher/interpreted-runtime/src/main/scala/org/neo4j/cypher/internal/runtime/interpreted/pipes/OrderedAggregationPipe.scala.semanticdb' doesn't exist. There can be many reasons for this error
That error just means that the code was not correctly compiled, do you see any diagnostics errors anywhere? Let me take a look at thet repo, maybe it's a bug in config generation.
I don't see anything but metal.log. And the metals.log is too big, I couldn't upload it here
I've tried to import this project. It took about 10 minutes and reported that Import project partially failed ...
however looks like it mostly works well.
Some submodules wasn't imported with BUILD FAILURE
but it's hard to say if it's problem with this build or bloop plugin.
Attaching my logs but they are huge.
Does the go to defination
works for scala files in neo4j?
Does the go to defination works for scala files in neo4j?
@jievince yep, I tried it in some random files and it works
It looks like it doesn't export all the proejct though because of:
[ERROR] Failed to execute goal on project neo4j-id-generator: Could not resolve dependencies for project org.neo4j:neo4j-id-generator:jar:4.3.3-SNAPSHOT: The following artifacts could not be resolved: org.neo4j:neo4j-index:jar:4.3.3-SNAPSHOT, org.neo4j:neo4j-index:jar:tests:4.3.3-SNAPSHOT: Could not find artifact org.neo4j:neo4j-index:jar:4.3.3-SNAPSHOT -> [Help 1]
Looks like the issue with snapshot dependencies we had before, we would need to try and guess those dependencies and link them normally.
Mine doesn't work.
This one looks like the json file is not generate even after mvn install
because that one fails:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (default) on project neo4j-logging: Error creating shaded jar: duplicate entry: META-INF/services/org.neo4j.logging.shaded.log4j.core.util.ContextDataProvider -> [Help 1]
Any idea where it's coming from? Maven is based on local jars for dependencies and if one can't be published then the compile will fail and Metals will not know about all the projects that depend on a particular jar.
We should try doing a workaround that would translate or remove those jars so that the mvn install
is not even needed
I reopened the issue here https://github.com/scalacenter/bloop/issues/1022 we need to fix that first for sure
I reopened the issue here scalacenter/bloop#1022 we need to fix that first for sure
Hi @tgodzik, how's it going?
I took a look whether the recent fixes solved the issues in the neo4j repo, but it seems that the build is still failing on annotation processors and some other things are still problematic unfortunately:
2021.10.20 13:25:29 ERROR Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: org.neo4j.annotations.service.ServiceAnnotationProcessor Unable to get public no-arg constructor
Not yet sure how to fix it in Bloop.
Hey, guys. How's it going
No progress recently unfortunately.
Oh, feeling sadly
Hello everyone, any progress? If not, I will have to continue using the jb's IDEA.
Hello everyone, any progress? If not, I will have to continue using the jb's IDEA.
If there aren't any updates in here, it's safe to assume there isn't any progress.
The project is https://github.com/neo4j/neo4j/tree/4.3, it consists of java and scala files but doesn't have a build.sbt file. So the extension(v1.10.8) doesn't work.