-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Couldn't start client JSON Language Server" error #43317
Comments
@DanTup In what build do you see this? |
Stable 1.20.0, it auto updated to it a few nights ago |
I deleted it from Applications then downloaded using the Stable link on the website; extracted the zip, dragged the .app into Applications and launched. Same thing :( |
Also make sure that all instances of VSCode are closed. |
It was completely closed before I deleted it. I even launched the .app I extract directly from another location and had the same issue (though the paths were different, pointing at a temp location where Mac OS seemed to have put the app to run it). I just downloaded the Mac package again (from here) on my PC and opened it up and I can see there's no Does this not happen for any of you if you install/run the official package being served up (I don't think running from the repo commit is a good test)? |
@DanTup Close all files in Code. Shutdown Code. Open Code. Open devtools. Any errors there? Now, open |
Strangely, I cannot repro this today. I'd definitely closed all Code windows and rebooted (many times) between the update and experiencing this (restarting again was one of the first things I did before raising). I also completely removed and reinstalled it and still had the issue. I don't know what project I had open at the time, but I tried a few now and can't repro (I tried with launch.json open already and also opening it after loading, and I tried in both the main instance and the dev host). I'll do some more testing later, but I'm kinda baffled by this; it absolutely wasn't just a case of not restarting Code since the update, that I'm positive of. |
Alright, let us know if it comes back. |
Hit it again - but on my PC this time! So it's not isolated to Mac :(
I tried closing and re-opening the projects, but it didn't occur the second time... I'll try and do some more debugging after lunch. |
OK, let me know if you can repro it better. cc @bpasero @alexandrudima for more eyes on this |
Ok, I can repro this by putting the bad path into the top of any {
"folders": [
{
"path": "../testse-tests"
},
{
"path": "M:\\Coding\\Applications\\flutter\\packages\\flutter_tools"
},
{
"path": "M:\\Coding\\Applications\\flutter\\dev\\devicelab"
}
],
"settings": {
}
} |
I've very confused now. Exactly what happens when you put the bad path into the top of any |
Apologies, I've been confused too! Basically the bug is that if there is a |
I've removed the comments from when I was digging into this that turned out to be unrelated, hopefully it reads better now. |
Awesome, thanks. Seems like a great find! Also, by bad path... that means a path which does not exist in disk? |
Yep, sorry. The repo I was using had a relative path to another repo that was normally checked out alongside it, so it was referencing a missing folder for me. |
The problem is that when the language client spawns the language server it uses the first workspace folder as the cwd of the process. |
There are multiple other exceptions in the console:
I'll add a test to the language server, but I wonder if we should filter such folders from the API? @bpasero |
What happens if you just don't set a |
@aeschli I would not do that, an extension has to always assume that a workspace folder of a multi root configuration is invalid (for example, a user might have a workspace where some folders point to an external hard disk which is not always connected). It is true that this never happened before where you could only open a single folder which always had to exist. However, I would not want to add some throw-away code to handle the "first folder" case specifically because that one is deprecated API anyways. It is good to force extensions to think about the case where the first (or any) folder is not there, extensions need to deal with this imho. |
microsoft/vscode-languageserver-node#310 is the issue on the LSP side. |
Related: #43493 |
@bpasero I'm not so convinced that is the case. We're forcing all extensions to simultaneously check for |
@joaomoreno but it is not that easy, an extension might want to use the new API to change workspace folders programmatically and now suddenly those that do not exist on disk are not showing up anymore? I think we are telling the wrong story to extensions if we decide to not include those that currently are not existing on disk. |
What's the use case for an extension adding workspace folders that don't exist? Unless there's a really good scenario, I don't think we should leave it up to every extension to check that every workspace exists. |
@roblourens I was not referring to adding a folder that does not exist but managing the set of workspace folders in any way (e.g. that could also include showing a workspace folder picker to do some more stuff with it like allowing to rename a folder). I think it boils down to the question what |
Closing as the JSON language server has been fixed. |
I'm getting this error when opening launch.json on my Mac (pretty sure it doesn't happen on my PC). Restarting Code code has had no effect.
As far as I can tell, the Code Helper it's looking for does exist at that location:
Anything I can do to debug (it's possible uninstalling/reinstalling Code will fix; but there may be value in understanding what's happened?)
The text was updated successfully, but these errors were encountered: