#[repr(C)]pub struct CliConfigResolver {
pub base: ConfigResolver,
pub default_config: Config,
pub config_cache: HashMap<String, Config>,
pub config_errors: Vec<(String, String)>,
}Expand description
Port of struct CliConfigResolver : Luau::ConfigResolver (CLI/src/Analyze.cpp:231-321).
Like the analysis ConfigResolver (a struct with a fn-pointer vtable slot for
the single pure virtual getConfig), this concrete subclass is #[repr(C)]
with base: ConfigResolver first so that a *const ConfigResolver (the vtable
receiver) can be cast back to *const CliConfigResolver.
C++ members:
Luau::Config defaultConfig;mutable std::unordered_map<std::string, Luau::Config> configCache;mutable std::vector<std::pair<std::string, std::string>> configErrors;
Fields§
§base: ConfigResolver§default_config: Config§config_cache: HashMap<String, Config>§config_errors: Vec<(String, String)>Implementations§
Source§impl CliConfigResolver
impl CliConfigResolver
Sourcepub fn cli_config_resolver(mode: Mode) -> Self
pub fn cli_config_resolver(mode: Mode) -> Self
C++ CliConfigResolver(Luau::Mode mode) { defaultConfig.mode = mode; }
(CLI/src/Analyze.cpp:238-241).
Source§impl CliConfigResolver
impl CliConfigResolver
Sourcepub fn get_config(&self, name: &ModuleName, limits: &TypeCheckLimits) -> &Config
pub fn get_config(&self, name: &ModuleName, limits: &TypeCheckLimits) -> &Config
C++ const Config& getConfig(const ModuleName& name, const TypeCheckLimits& limits) const
(CLI/src/Analyze.cpp:243-250).
getConfig is logically const in C++ but mutates the mutable configCache
/ configErrors members through readConfigRec; the &self receiver is cast
to &mut self for those interior mutations, matching the C++ mutable intent.
Source§impl CliConfigResolver
impl CliConfigResolver
Sourcepub fn read_config_rec(
&mut self,
path: &str,
limits: &TypeCheckLimits,
) -> &Config
pub fn read_config_rec( &mut self, path: &str, limits: &TypeCheckLimits, ) -> &Config
C++ const Config& readConfigRec(const std::string& path, const TypeCheckLimits& limits) const
(CLI/src/Analyze.cpp:252-320).