pylance-release
pylance-release copied to clipboard
Support enabling/disabling auto-indent without restarting Pylance
This came up during 2024.4.102 release testing. I didn't realize this was supported.
HeeJae said: feels like since it allows dynamic registration
"onTypeFormatting": {
"dynamicRegistration": true
},
we could dynamically change the trigger chars so user doesn't need to reload vscode?
like how we do for file watcher -- https://github.com/microsoft/pyright/blob/1.1.359/packages/pyright-internal/src/languageServerBase.ts#L1415
basically, we won't need autoIndent
as InitializeParams
, but put the setting checks in server side fully. and we don't set up it in initialize
(unless dynamic registeration is off - such as in VS but in VS, current approach doesn't work anyway so, end impact should be same?) but we set it up based on options after getSettings
dynamically like how we do for file watchers
we probably need to rename _setupFileWatcher
to _updateDynamicFeatures
and inside of it calls old _setupFileWatcher
and new dynamic features such as format on type?
python.analysis.autoFormatStrings
should behave the same way.
This issue has been fixed in prerelease version 2024.5.100, which we've just released. You can find the changelog here: CHANGELOG.md