@@ -25,7 +25,6 @@ import {
25
25
Disposable ,
26
26
ExtensionContext ,
27
27
extensions ,
28
- IndentAction ,
29
28
languages ,
30
29
Memento ,
31
30
OutputChannel ,
@@ -41,7 +40,7 @@ import { registerTypes as appRegisterTypes } from './application/serviceRegistry
41
40
import { IApplicationDiagnostics } from './application/types' ;
42
41
import { DebugService } from './common/application/debugService' ;
43
42
import { IApplicationShell , ICommandManager , IWorkspaceService } from './common/application/types' ;
44
- import { Commands , isTestExecution , PYTHON , PYTHON_LANGUAGE , STANDARD_OUTPUT_CHANNEL } from './common/constants' ;
43
+ import { Commands , isTestExecution , PYTHON , STANDARD_OUTPUT_CHANNEL } from './common/constants' ;
45
44
import { registerTypes as registerDotNetTypes } from './common/dotnet/serviceRegistry' ;
46
45
import { registerTypes as installerRegisterTypes } from './common/installer/serviceRegistry' ;
47
46
import { traceError } from './common/logger' ;
@@ -86,6 +85,7 @@ import { registerTypes as interpretersRegisterTypes } from './interpreter/servic
86
85
import { ServiceContainer } from './ioc/container' ;
87
86
import { ServiceManager } from './ioc/serviceManager' ;
88
87
import { IServiceContainer , IServiceManager } from './ioc/types' ;
88
+ import { setLanguageConfiguration } from './language/languageConfiguration' ;
89
89
import { LinterCommands } from './linters/linterCommands' ;
90
90
import { registerTypes as lintersRegisterTypes } from './linters/serviceRegistry' ;
91
91
import { ILintingEngine } from './linters/types' ;
@@ -173,30 +173,7 @@ async function activateUnsafe(context: ExtensionContext): Promise<IExtensionApi>
173
173
const linterProvider = new LinterProvider ( context , serviceManager ) ;
174
174
context . subscriptions . push ( linterProvider ) ;
175
175
176
- // Enable indentAction
177
- // tslint:disable-next-line:no-non-null-assertion
178
- languages . setLanguageConfiguration ( PYTHON_LANGUAGE , {
179
- onEnterRules : [
180
- {
181
- beforeText : / ^ \s * (?: d e f | c l a s s | f o r | i f | e l i f | e l s e | w h i l e | t r y | w i t h | f i n a l l y | e x c e p t | a s y n c ) \b .* : \s * / ,
182
- action : { indentAction : IndentAction . Indent }
183
- } ,
184
- {
185
- beforeText : / ^ (? ! \s + \\ ) [ ^ # \n ] + \\ \s * / ,
186
- action : { indentAction : IndentAction . Indent }
187
- } ,
188
- {
189
- beforeText : / ^ \s * # .* / ,
190
- afterText : / .+ $ / ,
191
- action : { indentAction : IndentAction . None , appendText : '# ' }
192
- } ,
193
- {
194
- beforeText : / ^ \s + ( c o n t i n u e | b r e a k | r e t u r n ) \b .* / ,
195
- afterText : / \s + $ / ,
196
- action : { indentAction : IndentAction . Outdent }
197
- }
198
- ]
199
- } ) ;
176
+ setLanguageConfiguration ( ) ;
200
177
201
178
if ( pythonSettings && pythonSettings . formatting && pythonSettings . formatting . provider !== 'internalConsole' ) {
202
179
const formatProvider = new PythonFormattingEditProvider ( context , serviceContainer ) ;
0 commit comments