Skip to content

Commit 466c7d7

Browse files
authored
nes - disable for anonymous users for now (#1127)
1 parent 0d8ee6a commit 466c7d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/extension/inlineEdits/vscode-node/inlineCompletionProvider.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { InlineEditLogger } from './parts/inlineEditLogger';
3939
import { IVSCodeObservableDocument } from './parts/vscodeWorkspace';
4040
import { toExternalRange } from './utils/translations';
4141
import { getNotebookId } from '../../../platform/notebook/common/helpers';
42+
import { IAuthenticationService } from '../../../platform/authentication/common/authentication';
4243

4344
const learnMoreAction: Command = {
4445
title: l10n.t('Learn More'),
@@ -119,6 +120,7 @@ export class InlineCompletionProviderImpl implements InlineCompletionItemProvide
119120
@IGitExtensionService private readonly _gitExtensionService: IGitExtensionService,
120121
@INotebookService private readonly _notebookService: INotebookService,
121122
@IWorkspaceService private readonly _workspaceService: IWorkspaceService,
123+
@IAuthenticationService private readonly authenticationService: IAuthenticationService,
122124
) {
123125
this._tracer = createTracer(['NES', 'Provider'], (s) => this._logService.trace(s));
124126
this._displayNextEditorNES = this._configurationService.getExperimentBasedConfig(ConfigKey.Internal.UseAlternativeNESNotebookFormat, this._expService);
@@ -155,6 +157,12 @@ export class InlineCompletionProviderImpl implements InlineCompletionItemProvide
155157
return undefined;
156158
}
157159

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+
158166
const doc = this.model.workspace.getDocumentByTextDocument(document);
159167
if (!doc) {
160168
tracer.returns('document not found in workspace');

0 commit comments

Comments
 (0)