@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Type Alias Result<T, E>

    Result: { ok: true; value: T } | { cancelled: boolean; error: E; ok: false }

    Result type for operations that may fail, with explicit cancellation tracking on the failure branch.

    The framework-wide convention:

    • APIs that ask a single question (pick, input, notifications) return T | undefined, matching VS Code's own vocabulary where undefined means the user dismissed the prompt.
    • APIs that perform fallible work and want to report why return a Result.

    cancelled exists so a caller can tell "the user backed out" apart from "this failed", without inspecting the error. Collapsing the two is the mistake this type is here to prevent.

    Type Parameters

    • T
    • E = Error
    const result = await tryRefresh();
    if (!result.ok) {
    if (result.cancelled) return;
    logger.error('refresh failed', result.error);
    return;
    }
    use(result.value);