MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / load_toml_table

Function load_toml_table

src/config.rs:436–452  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

434}
435
436fn load_toml_table(path: &Path) -> Result<Option<toml::Table>, ConfigError> {
437 if !path.exists() {
438 return Ok(None);
439 }
440
441 let content = std::fs::read_to_string(path).map_err(|e| ConfigError::Io {
442 path: path.display().to_string(),
443 source: e,
444 })?;
445
446 let table: toml::Table = content.parse().map_err(|e| ConfigError::Parse {
447 path: path.display().to_string(),
448 source: e,
449 })?;
450
451 Ok(Some(table))
452}
453
454/// Load the project configuration, merging the global config (from the
455/// user's XDG config directory) with the project-level `.phpantom.toml`.

Callers 1

load_configFunction · 0.85

Calls 2

displayMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected