Theia API Documentation v1.77.0
    Preparing search index...

    Helper for reading AI preferences that must ignore workspace/folder scopes when the current workspace is not trusted.

    Writes should continue to go through PreferenceService directly; trust only affects reads.

    This is an implementation detail of AiConfigurationService. AI configuration consumers should go through AiConfigurationService rather than injecting this reader directly.

    Index
    _ready: Deferred<void> = ...
    onDidChangeTrust: Event<boolean> = ...
    onDidChangeTrustEmitter: Emitter<boolean> = ...
    preferences: PreferenceService
    trusted: boolean = false

    Cached trust flag updated via onDidChangeWorkspaceTrust. Defaults to false (fail closed): until the initial trust state has resolved, reads return only session/user/default scope values. Asynchronous callers should await ready before their first read.

    • get ready(): Promise<void>

      Resolves once the initial workspace trust state has been resolved. Callers that need a deterministic trust state before their first read can await this promise.

      Returns Promise<void>

    • Reads the preference, ignoring workspace/folder scopes when the workspace is untrusted, and resolves the session, user and default scopes like PreferenceService.get.

      Type Parameters

      • T

      Parameters

      • preferenceName: string
      • Optionalfallback: T
      • Optionalresource: string

      Returns T | undefined