Skip to content

Commit 63dd3ad

Browse files
authored
Enable command based on setting (#860)
1 parent acb3979 commit 63dd3ad

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,7 @@
20312031
{
20322032
"command": "github.copilot.debug.inlineEdit.reportNotebookNESIssue",
20332033
"title": "%github.copilot.command.inlineEdit.reportNotebookNESIssue%",
2034-
"enablement": "config.github.copilot.chat.advanced.notebook.alternativeNESFormat.enabled",
2034+
"enablement": "config.github.copilot.chat.advanced.notebook.alternativeNESFormat.enabled || github.copilot.chat.enableEnhancedNotebookNES",
20352035
"category": "GitHub Copilot Developer"
20362036
},
20372037
{

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { VSCodeWorkspace } from './parts/vscodeWorkspace';
3434
import { makeSettable } from './utils/observablesUtils';
3535

3636
const TRIGGER_INLINE_EDIT_ON_ACTIVE_EDITOR_CHANGE = false; // otherwise, eg, NES would trigger just when going through search results
37+
const useEnhancedNotebookNESContextKey = 'github.copilot.chat.enableEnhancedNotebookNES';
3738

3839
export class InlineEditProviderFeature extends Disposable implements IExtensionContribution {
3940

@@ -75,13 +76,17 @@ export class InlineEditProviderFeature extends Disposable implements IExtensionC
7576
@IEnvService private readonly _envService: IEnvService,
7677
@ILogService private readonly _logService: ILogService,
7778
@IInstantiationService private readonly _instantiationService: IInstantiationService,
79+
@IExperimentationService _experimentationService: IExperimentationService,
7880
) {
7981
super();
8082

8183
const tracer = createTracer(['NES', 'Feature'], (s) => this._logService.trace(s));
8284
const constructorTracer = tracer.sub('constructor');
83-
8485
const hasUpdatedNesSettingKey = 'copilot.chat.nextEdits.hasEnabledNesInSettings';
86+
const enableEnhancedNotebookNES = this._configurationService.getExperimentBasedConfig(ConfigKey.Internal.UseAlternativeNESNotebookFormat, _experimentationService) || this._configurationService.getExperimentBasedConfig(ConfigKey.UseAlternativeNESNotebookFormat, _experimentationService);
87+
88+
commands.executeCommand('setContext', useEnhancedNotebookNESContextKey, enableEnhancedNotebookNES);
89+
8590
this._register(autorun((reader) => {
8691
const copilotToken = this._copilotToken.read(reader);
8792

0 commit comments

Comments
 (0)