@@ -39,6 +39,7 @@ import { InlineEditLogger } from './parts/inlineEditLogger';
39
39
import { IVSCodeObservableDocument } from './parts/vscodeWorkspace' ;
40
40
import { toExternalRange } from './utils/translations' ;
41
41
import { getNotebookId } from '../../../platform/notebook/common/helpers' ;
42
+ import { IAuthenticationService } from '../../../platform/authentication/common/authentication' ;
42
43
43
44
const learnMoreAction : Command = {
44
45
title : l10n . t ( 'Learn More' ) ,
@@ -119,6 +120,7 @@ export class InlineCompletionProviderImpl implements InlineCompletionItemProvide
119
120
@IGitExtensionService private readonly _gitExtensionService : IGitExtensionService ,
120
121
@INotebookService private readonly _notebookService : INotebookService ,
121
122
@IWorkspaceService private readonly _workspaceService : IWorkspaceService ,
123
+ @IAuthenticationService private readonly authenticationService : IAuthenticationService ,
122
124
) {
123
125
this . _tracer = createTracer ( [ 'NES' , 'Provider' ] , ( s ) => this . _logService . trace ( s ) ) ;
124
126
this . _displayNextEditorNES = this . _configurationService . getExperimentBasedConfig ( ConfigKey . Internal . UseAlternativeNESNotebookFormat , this . _expService ) ;
@@ -155,6 +157,12 @@ export class InlineCompletionProviderImpl implements InlineCompletionItemProvide
155
157
return undefined ;
156
158
}
157
159
160
+ if ( this . authenticationService . copilotToken ?. isNoAuthUser ) {
161
+ // TODO@bpasero revisit this in the future
162
+ tracer . returns ( 'inline edits disabled for anonymous users' ) ;
163
+ return undefined ;
164
+ }
165
+
158
166
const doc = this . model . workspace . getDocumentByTextDocument ( document ) ;
159
167
if ( ! doc ) {
160
168
tracer . returns ( 'document not found in workspace' ) ;
0 commit comments