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 only execute my file from within VS Code with the Run Code (Control+Alt+N) command. Issuing either Start Debugging (F5) or Run Without Debigging (Control+F5) does nothing. The code lenses mentioned in the article don't appear either. Neither does the Import build prompt. Additionally, some Metals' commands don't work, resulting in an error message. E.g. for Run doctor (which I attempted, having read it's supposed to fix errors that may be present in my configuration) it says:
Command 'Metals: Run doctor' resulted in an error (command 'metals.doctor-run' not found)
I've tried reinstalling Metals but to no avail.
My software versions are:
You probably have run into an issue described here: https://github.com/scalameta/metals-vscode/issues/213
I had the same problem on Win environment - no one Metals command was recognized( E.g. "Run doctor")..
Instead of open just .scala file in VS Code try to open a project directory.