Improve the message when commands are run and extension not yet activated
Describe the bug
Import of maven project does not work To Reproduce Steps to reproduce the behavior:
- Open project with pom.xml
- Run command 'Metals: Import build'
- Error is displayed:
Command 'Metals: Import build' resulted in an error (command 'metals.build-import' not found)
Expected behavior
No errors
Screenshots
Installation:
- Operating system: Windows
- Editor: Visual Studio Code
- Metals version: v1.9.1
Additional context It's first time I'm running that extension in VSCode
Search terms
Thanks for reporting. That usually means that the plugin was not yet activated. It should activate once you open a Scala file or a workspace with a standard Scala directory structure.
Did you manage to activate the extension? I see that you opened another issue, where you progressed further.
Even after I progressed further, that error sometimes happens. I think that it may be happening only short time after start of vscode
That's an expected behaviour, because most commands are only available after the language server is fully started. And it can take some seconds to start it up properly.
Could it then give more convenient message? Something like "Wait for Metals language server to start"?
It's quite more time than seconds, by the way, I think a few minutes at least, but probably because my machine is not very fast
Could it then give more convenient message? Something like "Wait for Metals language server to start"?
It's quite more time than seconds, by the way, I think a few minutes at least, but probably because my machine is not very fast
That should not be minutes ever, it means that starting a single java process is taking minutes on your machine, which makes it almost unusable :thinking:
I have never really seen a situation like that, is there anything in the logs? Is there are message in the bottom saying "Starting Metals server" ?
Ah, sorry for late response. It starts so slowly, because we have mcafee here and it takes really long time to inspect every process that's being run when vscode starts (which's a bunch of language servers), that's why metals starts some time after vscode already started. Yes, there's a message at the bottom and I also see how antivirus eats cpu :)
It's not so unusable, once all executables are inspected, it runs as normal, but in between some of the extensions behave erratically, including metals
Thanks for the explanation. This can be improved inside the VS Code plugin - I will move it here. The issue has a lower priority though, so we would be happy to accept any contributions since I don't think we will be able to work on it soon.