@@ -10,7 +10,7 @@ import { IExtensionActivationManager } from './activation/types';
10
10
import { registerTypes as appRegisterTypes } from './application/serviceRegistry' ;
11
11
import { IApplicationDiagnostics } from './application/types' ;
12
12
import { IApplicationEnvironment , ICommandManager , IWorkspaceService } from './common/application/types' ;
13
- import { Commands , PYTHON , PYTHON_LANGUAGE , UseProposedApi } from './common/constants' ;
13
+ import { Commands , PYTHON_LANGUAGE , UseProposedApi } from './common/constants' ;
14
14
import { registerTypes as installerRegisterTypes } from './common/installer/serviceRegistry' ;
15
15
import { IFileSystem } from './common/platform/types' ;
16
16
import {
@@ -25,11 +25,9 @@ import { noop } from './common/utils/misc';
25
25
import { DebuggerTypeName } from './debugger/constants' ;
26
26
import { registerTypes as debugConfigurationRegisterTypes } from './debugger/extension/serviceRegistry' ;
27
27
import { IDebugConfigurationService , IDynamicDebugConfigurationService } from './debugger/extension/types' ;
28
- import { registerTypes as formattersRegisterTypes } from './formatters/serviceRegistry' ;
29
28
import { IInterpreterService } from './interpreter/contracts' ;
30
29
import { getLanguageConfiguration } from './language/languageConfiguration' ;
31
30
import { registerTypes as lintersRegisterTypes } from './linters/serviceRegistry' ;
32
- import { PythonFormattingEditProvider } from './providers/formatProvider' ;
33
31
import { ReplProvider } from './providers/replProvider' ;
34
32
import { registerTypes as providersRegisterTypes } from './providers/serviceRegistry' ;
35
33
import { TerminalProvider } from './providers/terminalProvider' ;
@@ -51,10 +49,10 @@ import { IDebugSessionEventHandlers } from './debugger/extension/hooks/types';
51
49
import { WorkspaceService } from './common/application/workspace' ;
52
50
import { DynamicPythonDebugConfigurationService } from './debugger/extension/configuration/dynamicdebugConfigurationService' ;
53
51
import { IInterpreterQuickPick } from './interpreter/configuration/types' ;
54
- import { registerInstallFormatterPrompt } from './providers/prompts/installFormatterPrompt' ;
55
52
import { registerAllCreateEnvironmentFeatures } from './pythonEnvironments/creation/registrations' ;
56
53
import { registerCreateEnvironmentTriggers } from './pythonEnvironments/creation/createEnvironmentTrigger' ;
57
54
import { initializePersistentStateForTriggers } from './common/persistentState' ;
55
+ import { logAndNotifyOnFormatterSetting } from './logging/settingLogs' ;
58
56
59
57
export async function activateComponents (
60
58
// `ext` is passed to any extra activation funcs.
@@ -110,7 +108,7 @@ export function activateFeatures(ext: ExtensionState, _components: Components):
110
108
// See https://github.com/microsoft/vscode-python/issues/10454.
111
109
112
110
async function activateLegacy ( ext : ExtensionState ) : Promise < ActivationResult > {
113
- const { context , legacyIOC } = ext ;
111
+ const { legacyIOC } = ext ;
114
112
const { serviceManager, serviceContainer } = legacyIOC ;
115
113
116
114
// register "services"
@@ -125,7 +123,6 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
125
123
// Feature specific registrations.
126
124
unitTestsRegisterTypes ( serviceManager ) ;
127
125
lintersRegisterTypes ( serviceManager ) ;
128
- formattersRegisterTypes ( serviceManager ) ;
129
126
installerRegisterTypes ( serviceManager ) ;
130
127
commonRegisterTerminalTypes ( serviceManager ) ;
131
128
debugConfigurationRegisterTypes ( serviceManager ) ;
@@ -134,7 +131,6 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
134
131
const extensions = serviceContainer . get < IExtensions > ( IExtensions ) ;
135
132
await setDefaultLanguageServer ( extensions , serviceManager ) ;
136
133
137
- const configuration = serviceManager . get < IConfigurationService > ( IConfigurationService ) ;
138
134
// Settings are dependent on Experiment service, so we need to initialize it after experiments are activated.
139
135
serviceContainer . get < IConfigurationService > ( IConfigurationService ) . getSettings ( ) . register ( ) ;
140
136
@@ -165,20 +161,9 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
165
161
serviceContainer . get < IApplicationDiagnostics > ( IApplicationDiagnostics ) . register ( ) ;
166
162
167
163
serviceManager . get < ITerminalAutoActivation > ( ITerminalAutoActivation ) . register ( ) ;
168
- const pythonSettings = configuration . getSettings ( ) ;
169
164
170
165
serviceManager . get < ICodeExecutionManager > ( ICodeExecutionManager ) . registerCommands ( ) ;
171
166
172
- if (
173
- pythonSettings &&
174
- pythonSettings . formatting &&
175
- pythonSettings . formatting . provider !== 'internalConsole'
176
- ) {
177
- const formatProvider = new PythonFormattingEditProvider ( context , serviceContainer ) ;
178
- disposables . push ( languages . registerDocumentFormattingEditProvider ( PYTHON , formatProvider ) ) ;
179
- disposables . push ( languages . registerDocumentRangeFormattingEditProvider ( PYTHON , formatProvider ) ) ;
180
- }
181
-
182
167
disposables . push ( new ReplProvider ( serviceContainer ) ) ;
183
168
184
169
const terminalProvider = new TerminalProvider ( serviceContainer ) ;
@@ -200,7 +185,7 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
200
185
) ,
201
186
) ;
202
187
203
- registerInstallFormatterPrompt ( serviceContainer ) ;
188
+ logAndNotifyOnFormatterSetting ( ) ;
204
189
registerCreateEnvironmentTriggers ( disposables ) ;
205
190
initializePersistentStateForTriggers ( ext . context ) ;
206
191
}
0 commit comments