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
Please don't modify my settings when I have enabled editor.formatOnType #20673
Karthik Nadig (@karthiknadig), I initially thought that this was caused by this change, but I think this may always have behaved this way. I'm happy to look at this if you'd like.
Matt Bierner (@mjbvz), currently we only set formatOnType for users in our auto-indent experiment. Assuming that experiment turns out well, my plan was to enable it for all users using the approach you describe above.
I think we can just check if formatOnType has been set globally already, and then only add the python scoped one if it isn't?
Luciana Abud (@luabud), ok. Currently we only check if it's set globally for [python], either to true or false. And if so, we make no change.
In additional to being set globally, it could be set at the workspace or workspace folder level.
So my instinct is to just check if editor.formatOnType is enabled in the current context (either globally, in the workspace, or workspace folder), and if so make no changes to the user's settings.json.
However, what if the user has explicitly set editor.formatOnType to false globally? Should we respect that?
Activity
rchiodo commentedon Feb 9, 2023
I believe this is actually added by the python core extension. Transferring.
debonte commentedon Feb 9, 2023
Karthik Nadig (@karthiknadig), I initially thought that this was caused by this change, but I think this may always have behaved this way. I'm happy to look at this if you'd like.
karthiknadig commentedon Feb 9, 2023
Erik De Bonte (@debonte) I think we need to preserve the scope of the settings.
/cc Luciana Abud (@luabud)
luabud commentedon Feb 10, 2023
I think we can just check if
formatOnTypehas been set globally already, and then only add the python scoped one if it isn't?mjbvz commentedon Feb 10, 2023
Can you use
configurationDefaultsinstead? Here's an example of it being used for markdown:https://github.com/microsoft/vscode/blob/f12d88d698d1f9aa692a1662b147de702d352b44/extensions/markdown-language-features/package.json#L572
This is preferred over automatically writing into user's settings
debonte commentedon Feb 10, 2023
Matt Bierner (@mjbvz), currently we only set
formatOnTypefor users in our auto-indent experiment. Assuming that experiment turns out well, my plan was to enable it for all users using the approach you describe above.mjbvz commentedon Feb 10, 2023
Erik De Bonte (@debonte) Want to open an issue against VS Code for running experiments with language specific settings?
debonte commentedon Feb 11, 2023
Matt Bierner (@mjbvz), thanks for suggesting that -- microsoft/vscode#174106
debonte commentedon Feb 11, 2023
Luciana Abud (@luabud), ok. Currently we only check if it's set globally for
[python], either totrueorfalse. And if so, we make no change.In additional to being set globally, it could be set at the workspace or workspace folder level.
So my instinct is to just check if
editor.formatOnTypeis enabled in the current context (either globally, in the workspace, or workspace folder), and if so make no changes to the user'ssettings.json.However, what if the user has explicitly set
editor.formatOnTypetofalseglobally? Should we respect that?luabud commentedon Feb 14, 2023
Good question, I think it might be best to be conservative and respect it. So in this case we wouldn't enable it for Python if it's disabled globally