scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.07k stars 325 forks source link

Worksheet mode in VSCode stops working and perhaps causes metals to stop as well #3347

Closed vishalovercome closed 11 months ago

vishalovercome commented 2 years ago

Describe the bug

  1. Problem becomes visible when there's no output beside the code in worksheets
  2. Running doctor / Checking logs via Metals extension UI stops working
  3. Log file .metals/metals.log will have no error but some output like this [0m2021.12.09 16:22:27 INFO time: evaluated worksheet 'SomeWorksheet.worksheet.sc' in 14s
  4. After some edits event saving the file doesn't work as the Metals can't complete the code formatter
  5. Restarting bloop/metals doesn't help
  6. On rare occasions Metals goes into a restart loop after which VSCode decides to not restart it anymore

To Reproduce The code that causes it is proprietary. It works as part of application as well as in scala console

Expected behavior

  1. Provide worksheet output
  2. Some error in log that explains what's going on

Installation:

  1. VSCode (Remote container in linux) running on a Mac
  2. Metals version: v1.10.15 (used to happen with earlier versions also)
tgodzik commented 2 years ago

Thanks for reporting! Could you try and run jstack on the Metals process next time this happens? It's probably that something is hanging inside the process itself.

Alternatively, it might be possible that it will help to increase the -Xmx proeprty in the server settings.

tgodzik commented 11 months ago

Let's reopen if you manage to get more information. I wasn't able to reproduce it at any point