1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Created by Vinh Nguyen on 2026-04-26
// Copyright © 2024 Cho Tot. All rights reserved.
//! Shared helpers for loading workspace configuration with consistent error context.
//!
//! Every call to [`vtcode_config::loader::manager::ConfigManager::load_from_workspace`]
//! across the codebase produced a slightly different `.with_context(…)` string, making
//! log searches unreliable and hiding the workspace path in some variants. This module
//! centralises all loading paths behind a single function so the error message is
//! consistent and always includes the workspace path.
use Path;
use ;
use ConfigManager;
/// Load the workspace configuration with a consistent, path-inclusive error context.
///
/// This is the single canonical wrapper around `ConfigManager::load_from_workspace`.
/// All call sites in `src/` should use this function instead of calling the manager
/// directly with an ad-hoc `.with_context(…)`.
///
/// # Errors
///
/// Returns an error if the configuration file cannot be read or parsed, with a
/// message in the form:
/// `"Failed to load VT Code configuration for workspace '<path>'"`
pub