File tree Expand file tree Collapse file tree
src/client/activation/node Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,23 +44,19 @@ export class NodeLanguageServerAnalysisOptions extends LanguageServerAnalysisOpt
4444
4545 private async isAutoIndentEnabled ( ) {
4646 const editorConfig = this . getPythonSpecificEditorSection ( ) ;
47- let formatOnTypeEffectiveValue = editorConfig . get ( FORMAT_ON_TYPE_CONFIG_SETTING ) ;
4847 const formatOnTypeInspect = editorConfig . inspect ( FORMAT_ON_TYPE_CONFIG_SETTING ) ;
4948 const formatOnTypeSetForPython = formatOnTypeInspect ?. globalLanguageValue !== undefined ;
5049
5150 const inExperiment = await this . isInAutoIndentExperiment ( ) ;
52-
53- if ( inExperiment !== formatOnTypeSetForPython ) {
54- if ( inExperiment ) {
55- await NodeLanguageServerAnalysisOptions . setPythonSpecificFormatOnType ( editorConfig , true ) ;
56- } else if ( formatOnTypeInspect ?. globalLanguageValue !== false ) {
57- await NodeLanguageServerAnalysisOptions . setPythonSpecificFormatOnType ( editorConfig , undefined ) ;
58- }
59-
60- formatOnTypeEffectiveValue = this . getPythonSpecificEditorSection ( ) . get ( FORMAT_ON_TYPE_CONFIG_SETTING ) ;
51+ // only explicitly enable formatOnType for those who are in the experiment
52+ // but have not explicitly given a value for the setting
53+ if ( ! formatOnTypeSetForPython && inExperiment ) {
54+ await NodeLanguageServerAnalysisOptions . setPythonSpecificFormatOnType ( editorConfig , true ) ;
6155 }
6256
63- return inExperiment && formatOnTypeEffectiveValue ;
57+ const formatOnTypeEffectiveValue = this . getPythonSpecificEditorSection ( ) . get ( FORMAT_ON_TYPE_CONFIG_SETTING ) ;
58+
59+ return formatOnTypeEffectiveValue ;
6460 }
6561
6662 private async isInAutoIndentExperiment ( ) : Promise < boolean > {
You can’t perform that action at this time.
0 commit comments