Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix enablement of AI support #14166

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/ai-core/src/browser/ai-activation-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import { Emitter, MaybePromise, Event, } from '@theia/core';
import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
import { PREFERENCE_NAME_ENABLE_EXPERIMENTAL } from './ai-core-preferences';

export const EXPERIMENTAL_AI_CONTEXT_KEY = 'ai.experimental.enabled';
/**
* Context key for the experimental AI feature. It is set to `true` if the feature is enabled.
*/
// We reuse the enablement preference for the context key
export const EXPERIMENTAL_AI_CONTEXT_KEY = PREFERENCE_NAME_ENABLE_EXPERIMENTAL;

@injectable()
export class AIActivationService implements FrontendApplicationContribution {
Expand All @@ -41,7 +45,7 @@ export class AIActivationService implements FrontendApplicationContribution {
}

initialize(): MaybePromise<void> {
this.isExperimentalEnabledKey = this.contextKeyService.createKey(PREFERENCE_NAME_ENABLE_EXPERIMENTAL, false);
this.isExperimentalEnabledKey = this.contextKeyService.createKey(EXPERIMENTAL_AI_CONTEXT_KEY, false);
this.preferenceService.onPreferenceChanged(e => {
if (e.preferenceName === PREFERENCE_NAME_ENABLE_EXPERIMENTAL) {
this.isExperimentalEnabledKey.set(e.newValue);
Expand Down
Loading