@@ -20,8 +20,7 @@ import { IInterpreterService } from '../../interpreter/contracts';
20
20
import { IServiceContainer } from '../../ioc/types' ;
21
21
import { ICodeExecutionHelper } from '../types' ;
22
22
import { traceError } from '../../logging' ;
23
- import { IConfigurationService , IExperimentService , Resource } from '../../common/types' ;
24
- import { EnableREPLSmartSend } from '../../common/experiments/groups' ;
23
+ import { IConfigurationService , Resource } from '../../common/types' ;
25
24
import { sendTelemetryEvent } from '../../telemetry' ;
26
25
import { EventName } from '../../telemetry/constants' ;
27
26
@@ -93,7 +92,6 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
93
92
const startLineVal = activeEditor ?. selection ?. start . line ?? 0 ;
94
93
const endLineVal = activeEditor ?. selection ?. end . line ?? 0 ;
95
94
const emptyHighlightVal = activeEditor ?. selection ?. isEmpty ?? true ;
96
- const smartSendExperimentEnabledVal = pythonSmartSendEnabled ( this . serviceContainer ) ;
97
95
let smartSendSettingsEnabledVal = false ;
98
96
const configuration = this . serviceContainer . get < IConfigurationService > ( IConfigurationService ) ;
99
97
if ( configuration ) {
@@ -107,7 +105,6 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
107
105
startLine : startLineVal ,
108
106
endLine : endLineVal ,
109
107
emptyHighlight : emptyHighlightVal ,
110
- smartSendExperimentEnabled : smartSendExperimentEnabledVal ,
111
108
smartSendSettingsEnabled : smartSendSettingsEnabledVal ,
112
109
} ) ;
113
110
observable . proc ?. stdin ?. write ( input ) ;
@@ -117,12 +114,7 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
117
114
const result = await normalizeOutput . promise ;
118
115
const object = JSON . parse ( result ) ;
119
116
120
- if (
121
- activeEditor ?. selection &&
122
- smartSendExperimentEnabledVal &&
123
- smartSendSettingsEnabledVal &&
124
- object . normalized !== 'deprecated'
125
- ) {
117
+ if ( activeEditor ?. selection && smartSendSettingsEnabledVal && object . normalized !== 'deprecated' ) {
126
118
const lineOffset = object . nextBlockLineno - activeEditor ! . selection . start . line - 1 ;
127
119
await this . moveToNextBlock ( lineOffset , activeEditor ) ;
128
120
}
@@ -145,16 +137,15 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
145
137
*/
146
138
// eslint-disable-next-line class-methods-use-this
147
139
private async moveToNextBlock ( lineOffset : number , activeEditor ?: TextEditor ) : Promise < void > {
148
- if ( pythonSmartSendEnabled ( this . serviceContainer ) ) {
149
- if ( activeEditor ?. selection ?. isEmpty ) {
150
- await this . commandManager . executeCommand ( 'cursorMove' , {
151
- to : 'down' ,
152
- by : 'line' ,
153
- value : Number ( lineOffset ) ,
154
- } ) ;
155
- await this . commandManager . executeCommand ( 'cursorEnd' ) ;
156
- }
140
+ if ( activeEditor ?. selection ?. isEmpty ) {
141
+ await this . commandManager . executeCommand ( 'cursorMove' , {
142
+ to : 'down' ,
143
+ by : 'line' ,
144
+ value : Number ( lineOffset ) ,
145
+ } ) ;
146
+ await this . commandManager . executeCommand ( 'cursorEnd' ) ;
157
147
}
148
+
158
149
return Promise . resolve ( ) ;
159
150
}
160
151
@@ -314,9 +305,3 @@ function getMultiLineSelectionText(textEditor: TextEditor): string {
314
305
// ↑<---------------- To here
315
306
return selectionText ;
316
307
}
317
-
318
- function pythonSmartSendEnabled ( serviceContainer : IServiceContainer ) : boolean {
319
- const experiment = serviceContainer . get < IExperimentService > ( IExperimentService ) ;
320
-
321
- return experiment ? experiment . inExperimentSync ( EnableREPLSmartSend . experiment ) : false ;
322
- }
0 commit comments