File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
src/extension/inlineEdits/vscode-node Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -104,18 +104,22 @@ export class InlineEditProviderFeature {
104104 public rolloutFeature ( ) : IDisposable {
105105 const hasUpdatedNesSettingKey = 'copilot.chat.nextEdits.hasEnabledNesInSettings' ;
106106
107- return autorun ( ( reader ) => {
108- const copilotToken = this . _copilotToken . read ( reader ) ;
107+ return autorun ( async ( reader ) => {
108+ if ( this . _vscodeExtensionContext . globalState . get < boolean | undefined > ( hasUpdatedNesSettingKey ) ) {
109+ return ; // We already updated the setting for the user once. No need to run this logic again.
110+ }
109111
112+ const copilotToken = this . _copilotToken . read ( reader ) ;
110113 if ( copilotToken === undefined ) {
111114 return ;
112115 }
113116
114- if (
115- this . _expService . getTreatmentVariable < boolean > ( 'copilotchat.enableNesInSettings' ) &&
116- this . _vscodeExtensionContext . globalState . get < boolean | undefined > ( hasUpdatedNesSettingKey ) !== true &&
117- ! copilotToken . isFreeUser
118- ) {
117+ if ( copilotToken . isFreeUser || copilotToken . isNoAuthUser ) {
118+ return ;
119+ }
120+
121+ await this . _expService . hasTreatments ( ) ;
122+ if ( ! this . _expService . getTreatmentVariable < boolean > ( 'copilotchat.avoidEnablingNesInSettings' ) ) {
119123 this . _vscodeExtensionContext . globalState . update ( hasUpdatedNesSettingKey , true ) ;
120124 if ( ! this . _configurationService . isConfigured ( ConfigKey . InlineEditsEnabled ) ) {
121125 this . _configurationService . setConfig ( ConfigKey . InlineEditsEnabled , true ) ;
You can’t perform that action at this time.
0 commit comments