Theia API Documentation v1.71.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.

    Index

    Constructors

    Properties

    _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 user/default scope values. Asynchronous callers should await ready before their first read.

    Accessors

    Methods

    • Reads the preference, ignoring workspace/folder scopes when the workspace is untrusted. Returns globalValue ?? defaultValue ?? fallback.

      Type Parameters

      • T

      Parameters

      • preferenceName: string
      • Optionalfallback: T
      • OptionalresourceUri: string

      Returns undefined | T