记录下使用scala-cli vscode metals时Metals doctor报告出的semanticdb index not being produced问题

Metals Doctor信息

Metals Doctor
Metals Java: 21.0.4 from Arch Linux located at /usr/lib/jvm/java-21-openjdk

Metals Server version: 1.3.5+171-b77fedf0-SNAPSHOT

Below are listed the build targets for this workspace. One build target corresponds to one classpath. For example, normally one sbt project maps to two build targets: main and test.

Project’s Java: 21.0.4 located at /usr/lib/jvm/java-21-openjdk

Build definition is coming from scala-cli.

Build server currently being used is scala-cli v1.5.0. (Reset)

Build target Type Compilation status Diagnostics Interactive Semanticdb Debugging Java support Error reports Recommendation
scala-cli-demo_f1b25db0ce Scala 3.4.2 ✅ ✅ ✅ ✅ ✅ ✅ ✅
scala-cli-demo_f1b25db0ce-test Scala 3.4.2 ✅ ✅ ✅ ⚠️ ✅ ✅ ✅
Compilation status:

✅ - code is compiling
Diagnostics:

✅ - diagnostics correctly being reported by the build server
Interactive features (completions, hover):

✅ - supported Scala version
Semanticdb features (references, renames, go to implementation):

✅ - build tool automatically creating needed semanticdb files
⚠️ - semanticdb index files not present currently
❌ - semanticdb index not being produced
Debugging (run/test, breakpoints, evaluation):

✅ - users can run or test their code with debugging capabilities
Java Support:

✅ - hover, completions and index based features supported
Error reports:
You can attach a single error report or a couple or reports in a zip file (create a zip file from anonymized reports) to your GitHub issue (create a github issue) to help with debugging.

问题原因

因我之前是直接在项目文件夹scala-cli-demo下创建文件的,没有分目录导致编译后的test文件夹没有文件,也就生成不出Semanticdb 文件来,所以doctor报出scala-cli-demo_f1b25db0ce-test文件夹的 Semanticdb 有问题

调整目录结构

├── META-INF
└── src
└── main
├── java
├── scala
└── test
├── java
└── scala
scala-cli-demo目录结构
注意src/main/test/scala下要建一个scala文件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值