-
Notifications
You must be signed in to change notification settings - Fork 519
Fix EnableISEMode
for Azure Data Studio
#3735
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
Conversation
Because ADS stripped out VS Code's debugger, the `debug` settings don't exist, causing our `update()` call for the debug setting to throw an error to the user when they run `EnableISEMode`. I couldn't find a reliable way to test if the extension is running in the ADS fork instead of the upstream VS Code, but a simple `try {} catch {}` that allows the funciton to continue is a reliable fix, as we can't do anything about this setting regardless.
/cc @Charles-Gagnon
Charles-Gagnon
commented
Jan 3, 2022
Thanks for fixing @andschwa !
There's a couple options for determining if it's running in ADS :
- You can check at runtime whether the azdata API object exists - such as what we do here : https://github.com/microsoft/azuredatastudio/blob/main/extensions/data-workspace/src/common/utils.ts#L54
vscode.env.appName
is another option (it should beAzure Data Studio
for ADS) Note though that this may not be the best option as other versions of the app such as insiders may have a slightly different name.
Although unless you find another case that you can't easily solve like this one it's probably easiest to just leave it as this. Although I would suggest adding a log statement or something in the catch so you can see what settings were ignored in case a setting is erroring that you don't expect.
Thanks so much @Charles-Gagnon, you're always so helpful!
Because ADS stripped out VS Code's debugger, the
debug
settings don'texist, causing our
update()
call for the debug setting to throw anerror to the user when they run
EnableISEMode
. I couldn't find areliable way to test if the extension is running in the ADS fork instead
of the upstream VS Code, but a simple
try {} catch {}
that allows thefunciton to continue is a reliable fix, as we can't do anything about
this setting regardless.
Resolves #3709.