scalameta / metals-vscode

Visual Studio Code extension for Metals
https://marketplace.visualstudio.com/items?itemName=scalameta.metals#overview
Apache License 2.0
298 stars 75 forks source link

VS Code metals extension "New Scala project" button does not work #1415

Closed oxicage closed 1 year ago

oxicage commented 1 year ago

Hi all, i am new.

The metals extension does not start a new scala project nor does it start metals if i do click the button below it.I have opened a folder "Temp" on the desktop and it is empty, it has no other files or folders in it, i do have sbt, respectively jdk 17 installed.

To Reproduce Steps to reproduce the behavior:

  1. Go to Scala Metals Extension;
  2. Click on "New Scala project";
  3. See error.

Expected behavior

A new scala server should be started.

Screenshots

Recording here. https://www.youtube.com/watch?v=_0d1j9EGBmM

Installation:

Search terms

"Scala New Scala project does button does not work."

tgodzik commented 1 year ago

Thanks for reporting! Did you see anything in the Metals Output? It seems that recent VS Code versions will activate the extension on viewing the metals tab (not really expected previously), so there should be some info about that.

oxicage commented 1 year ago

hi! i tried to look at the output in the terminal and i got the following error message!

. : File C:\Users\Seboiu\Documents\WindowsPowerShell\Microsoft.PowerShel
l_profile.ps1 cannot be loaded because running scripts is disabled on 
this system. For more information, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ . 'C:\Users\Seboiu\Documents\WindowsPowerShell\Microsoft.PowerShell_p 
...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityExceptio 
   n
    + FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\Seboiu\Desktop\Temp> 
oxicage commented 1 year ago

Not fixed! it was a problem due to the fact that the Windows PowerShell execution policy was being set to prevent untrusted scripts.

oxicage commented 1 year ago

When running it just shows a blank output terminal. Screenshot 2023-08-08 140839

tgodzik commented 1 year ago

We don't open the terminal, the extension here doesn't seem to have started at all, could you look again in the Output and see what is being logged there?

oxicage commented 1 year ago

Hi! I have checked the output and i got this right here:

2023-08-08 15:02:43.388 [info] update#setState idle
2023-08-08 15:02:46.258 [info] WSL is not installed, so could not detect WSL profiles
2023-08-08 15:03:13.396 [info] update#setState checking for updates
2023-08-08 15:03:13.595 [info] update#setState idle

Could this be because i have not installed WSL?

tgodzik commented 1 year ago

Can you select the Metals output? Or is it not there? There are different outputs for different parts and extensions in VS Code

oxicage commented 1 year ago

i have no metals output.

but i selected the "Extension Host" output and i got this:

2023-08-09 17:05:17.431 [info] Extension host with pid 8364 started
2023-08-09 17:05:17.432 [info] Skipping acquiring lock for c:\Users\Seboiu\AppData\Roaming\Code\User\workspaceStorage\3c5e0dd79bc285a1ce6ca4af96ea653a.
2023-08-09 17:05:17.705 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2023-08-09 17:05:17.794 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2023-08-09 17:05:17.848 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2023-08-09 17:05:18.107 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2023-08-09 17:05:18.223 [info] Eager extensions activated
2023-08-09 17:05:18.302 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2023-08-09 17:05:18.311 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2023-08-09 17:05:18.333 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
2023-08-09 17:05:18.355 [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
2023-08-09 17:05:18.451 [info] ExtensionService#_doActivateExtension formulahendry.code-runner, startup: false, activationEvent: 'onStartupFinished'
2023-08-09 17:05:18.736 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl, startup: false, activationEvent: 'onStartupFinished'
2023-08-09 17:05:18.742 [error] Activating extension ms-vscode-remote.remote-wsl failed due to an error:
2023-08-09 17:05:18.742 [error] Error: Cannot find module 'c:\Users\Seboiu\.vscode\extensions\ms-vscode-remote.remote-wsl-0.81.0\dist\node\extension.js'
Require stack:
- c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
    at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
    at Module._load (node:internal/modules/cjs/loader:858:27)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at o._load (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
    at f._load (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
    at C._load (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
    at Module.require (node:internal/modules/cjs/loader:1082:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Function.i [as __$__nodeRequire] (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:5:98)
    at r.rb (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:26597)
    at async Promise.all (index 0)
2023-08-09 17:05:19.489 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2023-08-09 17:05:20.071 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-08-09 17:05:21.450 [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
2023-08-09 17:05:21.515 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
2023-08-09 17:24:18.261 [info] ExtensionService#_doActivateExtension scalameta.metals, startup: false, activationEvent: 'onView:metalsPackages'
2023-08-09 17:24:18.264 [error] Activating extension scalameta.metals failed due to an error:
2023-08-09 17:24:18.264 [error] Error: Cannot find module 'c:\Users\Seboiu\.vscode\extensions\scalameta.metals-1.24.0\out\extension'
Require stack:
- c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:1010:15)
    at s._resolveFilename (node:electron/js2c/utility_init:2:2740)
    at Module._load (node:internal/modules/cjs/loader:858:27)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at o._load (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:28084)
    at f._load (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:25418)
    at C._load (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:19511)
    at Module.require (node:internal/modules/cjs/loader:1082:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Function.i [as __$__nodeRequire] (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:5:98)
    at r.rb (c:\Users\Seboiu\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:130:26597)
    at async Promise.all (index 0)
2023-08-09 17:24:21.169 [info] ExtensionService#_doActivateExtension ms-vscode.js-debug, startup: false, activationEvent: 'onDebugDynamicConfigurations'
2023-08-09 17:24:21.377 [info] ExtensionService#_doActivateExtension vscode.debug-server-ready, startup: false, activationEvent: 'onDebugResolve'
tgodzik commented 1 year ago

Looks like somehow the extension wasn't really installed, could you try reisntalling it? It should be in c:\Users\Seboiu.vscode\extensions\scalameta.metals-1.24.0\out\extension but it seems to not be there?

oxicage commented 1 year ago

Sorry, i got the same error. I have re-installed it multiple times.

tgodzik commented 1 year ago

Looks like an issue with VS Code then, extension files are not present. Or maybe they're not available to your user?

oxicage commented 1 year ago

i do not know sorry

oxicage commented 1 year ago

i will try resetting my pc maybe it helps

oxicage commented 1 year ago

Hello, here i am again, i have come to inform you that i have re-installed my operating system and it is now no longer a problem. It may be because i was using the windows 11 version instead of an older version, because since i had been using windows 10 i had not encountered any similar problems!

If more errors occur, i will make sure to report them here.

tgodzik commented 1 year ago

It should work perfectly fine on Windows 11 from what I was testing. More likely the issue was related to the VS Code installation, but it's hard to say.