You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow the "Dart: Use Recommended Settings" command to run silently #5159
Is your feature request related to a problem? Please describe.
During workspace creation on IDX, we're looking to use Dart's recommended settings to give users the best experience out of the box. When we execute the command from our extension, it shows a dialog that clutters the creation flow. It would be helpful to be able to call the command silently.
Describe the solution you'd like
Add a "silent" flag to the "Use Recommended Settings" command that defaults to false but can be set to true when called programmatically from a different extension.
Describe alternatives you've considered
Maintaining a separate copy of the recommended settings in IDX that would need to be maintained to be kept in line with Dart's recommended settings.
@pdblasi-google if you call dart.writeRecommendedSettings without passing {showNotification:true} the notification will no longer be shown.
But, are you already doing something to suppress the original prompt to set recommended settings? Otherwise I think our prompt might still be shown (the prompt I've allowed to be silenced here is just the confirmation that the settings were written, which is what I think you asked for).
You can suppress the initial prompt about using recommended settings by having any dart setting already existing, or by having the use_recommended_settings context value set (which is what we write to avoid prompting more than once).
Yes, I was asking about silencing the confirmation, we were already hiding the initial prompt by putting an empty "[dart]" entry in the machine settings, and with this change we can use dart.writeRecommendedSettings to fill that out with the latest Dart recommendations.
One thing I noticed looking at the PR, it looks like that change will prevent the confirmation dialog when the user calls the command from the Command Palette as well? From the IDX perspective, we don't need to silence it from the Command Palette, but if that's the preferred user experience on your end that's all good, just thought I'd mention it.
I plan to do a release tomorrow (it should've been today but I got caught up with another bugfix for the analysis server). However...
it looks like that change will prevent the confirmation dialog when the user calls the command from the Command Palette as well?
That's a good point. I forgot that it can be called from there. I did originally consider making the prompt the default and requiring an opt-out flag to be passed - would that work for you? (you'd need to update your extension to pass the new flag). Otherwise, we'd need to have two commands (one you can call and one shown in the palette) which is essentially the same, but might not be quite as nice.
I'd intended on passing a parameter of some sort seeing as the functionality is pretty IDX specific. So we're all set for that on our end whether there's a parameter or not.
And we'll just show the notification if we don't get an explicit false? (eg. options?.showNotification !== false). I can include that in tomorrow's release if you're happy with that.
The notification now has an opt-out flag. Not passing the flag will show the prompt as previous.
vs.commands.executeCommand("dart.writeRecommendedSettings");// shows promptvs.commands.executeCommand("dart.writeRecommendedSettings",{showNotification: false});// does not show prompt
The release including this will go out today, though it's also safe for you to pass the argument to older versions so you can start passing the flag at any time and it'll just work when the active extension is >= 3.92.0.
Activity
DanTup commentedon Jun 28, 2024
@pdblasi-google if you call
dart.writeRecommendedSettingswithout passing{showNotification:true}the notification will no longer be shown.But, are you already doing something to suppress the original prompt to set recommended settings? Otherwise I think our prompt might still be shown (the prompt I've allowed to be silenced here is just the confirmation that the settings were written, which is what I think you asked for).
You can suppress the initial prompt about using recommended settings by having any
dartsetting already existing, or by having theuse_recommended_settingscontext value set (which is what we write to avoid prompting more than once).pdblasi-google commentedon Jun 28, 2024
@DanTup Wow! Thanks for such a quick turnaround!
Yes, I was asking about silencing the confirmation, we were already hiding the initial prompt by putting an empty
"[dart]"entry in the machine settings, and with this change we can usedart.writeRecommendedSettingsto fill that out with the latest Dart recommendations.One thing I noticed looking at the PR, it looks like that change will prevent the confirmation dialog when the user calls the command from the Command Palette as well? From the IDX perspective, we don't need to silence it from the Command Palette, but if that's the preferred user experience on your end that's all good, just thought I'd mention it.
pdblasi-google commentedon Jul 1, 2024
Also, just for my planning on the IDX side, what's the usual release schedule for the extension?
DanTup commentedon Jul 1, 2024
I plan to do a release tomorrow (it should've been today but I got caught up with another bugfix for the analysis server). However...
That's a good point. I forgot that it can be called from there. I did originally consider making the prompt the default and requiring an opt-out flag to be passed - would that work for you? (you'd need to update your extension to pass the new flag). Otherwise, we'd need to have two commands (one you can call and one shown in the palette) which is essentially the same, but might not be quite as nice.
pdblasi-google commentedon Jul 1, 2024
I'd intended on passing a parameter of some sort seeing as the functionality is pretty IDX specific. So we're all set for that on our end whether there's a parameter or not.
DanTup commentedon Jul 1, 2024
Great, in that case can I just reverse the default, and you can call:
And we'll just show the notification if we don't get an explicit
false? (eg.options?.showNotification !== false). I can include that in tomorrow's release if you're happy with that.pdblasi-google commentedon Jul 1, 2024
That sounds great! Thanks!
DanTup commentedon Jul 2, 2024
The notification now has an opt-out flag. Not passing the flag will show the prompt as previous.
The release including this will go out today, though it's also safe for you to pass the argument to older versions so you can start passing the flag at any time and it'll just work when the active extension is >= 3.92.0.
pdblasi-google commentedon Jul 2, 2024
This worked perfectly! Thanks again for the quick turnaround!
DanTup commentedon Jul 3, 2024
No problem - thanks for confirming it's working as expected :-)
Allow recommended settings to be set silently for improved cloud IDE …
Revert default for recommended settings notification