Open ckipp01 opened 2 years ago
Thank you for reporting! This is exciting.
maybe having built-in support for index would help
Is there a way to automatically detect which files are compiled with scala-cli? We currently detect sbt builds with project/build.properties
and we would need something similar for scala-cli scripts.
instead passing in deps via scala-cli -d
which is also valid.
I think it's OK to not support this use-case to begin with.
Is there a way to automatically detect which files are compiled with scala-cli?
I don't think it super straightforward unless you just assume any *.sc
or *.scala
file under where you are looking is valid, which maybe isn't a bad thing in this situation since a scala-cli
workspaces are sort of just a bag of scala files. The only way to be able to get a better idea would be to check out where the .scala/
dir is placed, but that's not created until ran, and even then it won't tell you really the "source" dirs but give you the package structure and all the class/tasty/etc files.
👋🏼 hello! I wanted to drop this off here since I got this working and think it's pretty neat. Lately I've been using
scala-cli
quite a bit and I was curious if I could get precise code navigation working with it. It was actually somewhat simple, but I did hit on a couple small things that maybe having built-in support forindex
would help with.Producing semanticdb with
scala-cli
is as easy as just compiling your project with--semantic-db
as a flag like:scala-cli compile --semantic-db .
, which makes it easy forlsif index-semanticdb .
to pick it up. However there are a few gotchas, or things that aren't working yet that I'll list below for others that maybe stumble on this.scala-cli
to ends up being your sourceroot, which can lead to the wrong path in yourdump.lsif
. For example in my project if I doscala-cli --semantic-db compile src/
the semanticdb will be created and found, but it will think thatsrc/
is the sourceroot and then if you are runninglsif-java
from.
you can run into issues. So just being careful and making sure where I pointscala-cli
to is also where I runlsif-java
from fixed this. This might be trickier than it other build tools since there is no "build file".javacopts.txt
information afaik. I asked about this here in hopes of figuring out a non-hacky way of getting this info to enable cross-repository navigationScalaCliBuildTool.scala
here would be quite simple, but you'd run into issue pretty quickly if users are not using directives and instead passing in deps viascala-cli -d <dependency>
which is also valid. It wouldn't work in those cases. Either way, this might be a great feature