scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Scala Script: "run | debug" button doesn't show up on VS Code metals after upgrading to Scala-Cli 1.2.2

Open ashwinbhaskar opened this issue 1 year ago • 6 comments

Version(s) Scala-Cli version: 1.2.2 Metals version: 1.3.0 Bsp version: 2.1.1

Describe the bug After upgrading scala-cli to version 1.2.2 the "run | debug" button has stopped showing up on VS Code (metals extension). This happens only for .sc files, .scala files show the "run | debug" button.

To Reproduce Use scala-cli 1.2.2 with metals 1.3.0 in VS Code. Below is my .bsp/scala-cli.json file contents

  "name": "scala-cli",
  "argv": [
    "/opt/homebrew/bin//scala-cli",
    "bsp",
    "--json-options",
    "<Home>/scripts/scala-cli-scripts/.scala-build/ide-options-v2.json",
    "<Home>/scripts/scala-cli-scripts"
  ],
  "version": "1.2.2",
  "bspVersion": "2.1.1",
  "languages": [
    "scala",
    "java"
  ]
}

Expected behaviour "run | debug" button should appear on .sc files too

image

ashwinbhaskar avatar Apr 18 '24 01:04 ashwinbhaskar

cc @tgodzik @kasiaMarek

Gedochao avatar Apr 18 '24 08:04 Gedochao

@ashwinbhaskar I can't reproduce the issue, is it possible that run | debug code lenses hid above line 1? I think other people had this issue and would probably be better if we were able to show run on the left of the code.

tgodzik avatar Apr 30 '24 17:04 tgodzik

@tgodzik umm, not sure. How do I check if it's hidden above line 1?

ashwinbhaskar avatar May 02 '24 01:05 ashwinbhaskar

Just scroll to the top, however this might not be the actual reason. The code should also compile and there should be something in the logs about connecting to scala-cli

tgodzik avatar May 02 '24 08:05 tgodzik

@tgodzik No change on scrolling to the top. The code compiles and works as I can run it using scala-cli run <MyFile>.

ashwinbhaskar avatar May 02 '24 08:05 ashwinbhaskar

Any logs or error reports in .metals/reports?

tgodzik avatar May 06 '24 08:05 tgodzik

I don't have a .metals/reports file. I have a .metals/metals.log file. There are no errors in it. It prints the following INFO logs

2024.05.10 09:22:20 INFO  time: Connected to build server in 1m14s
2024.05.10 09:22:20 INFO  Connected to Build server: scala-cli v1.2.2
2024.05.10 09:22:23 INFO  time: indexed workspace in 2.6s
2024.05.10 09:23:20 INFO  BSP server: [hint] "async-http-client-backend-zio is outdated, update to 3.9.6"
2024.05.10 09:23:20 INFO  BSP server: [hint]      async-http-client-backend-zio 3.8.15 -> com.softwaremill.sttp.client3::async-http-client-backend-zio:3.9.6
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "com.softwaremill.sttp.client3::async-http-client-backend-zio:3.8.15"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:10:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "core is outdated, update to 3.9.6"
2024.05.10 09:23:20 INFO  BSP server: [hint]      core 3.8.15 -> com.softwaremill.sttp.client3::core:3.9.6
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "com.softwaremill.sttp.client3::core:3.8.15"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:11:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "slf4j-backend is outdated, update to 3.9.6"
2024.05.10 09:23:20 INFO  BSP server: [hint]      slf4j-backend 3.8.15 -> com.softwaremill.sttp.client3::slf4j-backend:3.9.6
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "com.softwaremill.sttp.client3::slf4j-backend:3.8.15"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:12:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "zio-interop-reactivestreams is outdated, update to 2.0.2"
2024.05.10 09:23:20 INFO  BSP server: [hint]      zio-interop-reactivestreams 2.0.1 -> dev.zio::zio-interop-reactivestreams:2.0.2
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "dev.zio::zio-interop-reactivestreams:2.0.1"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:13:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "zio-streams is outdated, update to 2.1.0"
2024.05.10 09:23:20 INFO  BSP server: [hint]      zio-streams 2.0.13 -> dev.zio::zio-streams:2.1.0
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "dev.zio::zio-streams:2.0.13"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:14:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "zio is outdated, update to 2.1.0"
2024.05.10 09:23:20 INFO  BSP server: [hint]      zio 2.0.13 -> dev.zio::zio:2.1.0
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "dev.zio::zio:2.0.13"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:18:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "kafka-clients is outdated, update to 3.7.0"
2024.05.10 09:23:20 INFO  BSP server: [hint]      kafka-clients 3.6.1 -> org.apache.kafka:kafka-clients:3.7.0
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "org.apache.kafka:kafka-clients:3.6.1"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:20:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "redisson is outdated, update to 3.29.0"
2024.05.10 09:23:20 INFO  BSP server: [hint]      redisson 3.15.0 -> org.redisson:redisson:3.29.0
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "org.redisson:redisson:3.15.0"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024.05.10 09:23:20 INFO  BSP server: [hint] ./project.scala:21:23
2024.05.10 09:23:20 INFO  BSP server: [hint] "slf4j-api is outdated, update to 2.0.13"
2024.05.10 09:23:20 INFO  BSP server: [hint]      slf4j-api 1.7.36 -> org.slf4j:slf4j-api:2.0.13
2024.05.10 09:23:20 INFO  BSP server: [hint] //> using dependency "org.slf4j:slf4j-api:1.7.36"
2024.05.10 09:23:20 INFO  BSP server: [hint]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^

ashwinbhaskar avatar May 10 '24 03:05 ashwinbhaskar

Is there anything after that? Any logs that the code compiled? I don't have any idea what might be going on. If you could it would be awesome to get a reproduction. Could you also try on the newest version of Scala CLI?

Another thing that is curious is that it took so long to connect to the build server. It should be reasonably quick.

tgodzik avatar May 13 '24 11:05 tgodzik

We seem to be unable to reproduce this. In case the problem persists, please open an issue upstream in https://github.com/scalameta/metals Closing this here.

Gedochao avatar May 22 '24 09:05 Gedochao