Questions tagged [scala-metals]

Scala language server with rich IDE features

Metals

Scala language server with rich IDE features

See: https://scalameta.org/metals/

46 questions
2
votes
0 answers

VSCode Scala Metals: Mainclass not found after updating plugin from 1.23.0 to 1.24.0

After updating the Scala (metals) extension in VSCode on 2023/07/20, the mainclass is not found anymore and thus cannot run anymore in a project that uses a workspace. In a project without workspace, everything still works. We expect this to be…
Thejipppp
  • 21
  • 1
2
votes
0 answers

The quick fix feature for importing classes from other packages in Scala doesn't work in vscode and metals

I used the quick fix that provided by vscode to automatically import the package, but it doesn't work. how can i solve it? And this is my metals doctor in this project. Maybe metals doesn't support the quick fix feature? I installed an old version…
terdong
  • 43
  • 5
2
votes
1 answer

How to debug Scala in Visual Studio Code?

I've created a .scala file and opened it in VS Code. I have Scala (Metals) installed which is a VS Code extension which advertises including a debugger. According to its documentation, it should integrate with VS Code's debugging features. But I can…
2
votes
3 answers

Build a jar file with Scala-Metals on VSCode

I'm attempting to develop for Scala and Spark using VSCode and the metals extension. My setup is using a dev container following the instructions (here). I now have my code running and I need to build a jar file to deploy to Spark. Is there a way to…
eNaught
  • 81
  • 6
2
votes
0 answers

Debug/Run issue with VS Code error with metals

I have a bare bone project with just one Object and it runs fine in sbt I have the following in my launch.json in vs code And when I try to run it, I get the following error: I haven't yet been successful in finding out a solution.
2
votes
1 answer

Manually trigger Scala Metals build import in (n)vim

As per the title, how can I manually trigger the build import query from Scala Metals in (n)vim? Metals usually queries upon writing changes to build.sbt or related files, but when I decide to cancel to query (empty entry) or write again before the…
Martin
  • 57
  • 8
2
votes
0 answers

Symbol’s value as variable is void: lsp-server-install-dir

I've been trying to set up the Scala layer and the Metals backend for spacemacs. I am relatively new to spacemacs and completely new to Scala. Quickly some problems, for which I have no idea how they can be connected to the Scala layer, arised.…
Anarendil
  • 21
  • 2
2
votes
1 answer

Visual Studio Code: how can I import the `sbt`-changes

After adding another dependency in build.sbt - how can I import the sbt-changes? With the Command Reload Window it works but it reloads everything (like bloob). Is there a way just to just import the sbt-changes?
pme
  • 14,156
  • 3
  • 52
  • 95
1
vote
0 answers

How do I get Metals LSP working in neovim?

Please help me with Metals LSP setup. I tried doing that with no luck, so I hope somebody here can help me please. I've been using mason and its lsp-config but now with metals i have trouble to configure it correctly since its not in mason currently…
1
vote
1 answer

How do I have integrated support for Scala inside newer versions of Eclipse (2023-06)?

I have a large java project with a bit of scala in it and it builds sucessfully with gradle on command line. Inside the IDE, it builds sucessfully thanks to an old plugin named Scala-IDE which is not maintained anymore and binds me to an older…
Sybuser
  • 735
  • 10
  • 27
1
vote
1 answer

Is there a way to manually provide the build target path to Metals in VSCode?

I am working with Scala in VS Code, but have the problem that I can not get the debugger to run in some projects. Metals is simply not able to find the build target depending how the project is structured. Can I browse somehow in VS Code to the…
1
vote
0 answers

Scala metals: "Evaluation failed because the thread is not suspended."

So, like the title says, this error comes up as I run the program. However, should I compile the code in any other IDE (tested IntelliJ and it works) or through terminal, it works. How can this be solved? I have seen other threads, and they seem to…
Exiits
  • 43
  • 6
1
vote
1 answer

Autocomplete in Neovim for Scala

I am using Neovim v0.7.2 and I am looking for a way to have autocomplete for my Neovim. Since it's suggested that we should use Metals for Scala in Neovim. After installing it, I could use its features but it seems does not support autocomplete as…
Duc Le
  • 61
  • 7
1
vote
0 answers

Metals VS Code connection to build server failing

I've set up a Scala project with the metals extension and when importing the the build.sbt, this fails and im provided with the following error message and this metals.log Failed to connect with build server, no functionality will work. See logs for…
Mikecraft1224
  • 99
  • 1
  • 9
1
vote
0 answers

Add file to classpath of testcontainer in VS Code / Metals using build.sbt

I have an sbt project configured with a build.sbt. When I run tests, a docker container is started with a configuration file available. This is how I wanted to use it in the test…