| Crates.io | mansion |
| lib.rs | mansion |
| version | 0.0.1 |
| created_at | 2025-11-08 13:14:56.173791+00 |
| updated_at | 2025-11-08 13:14:56.173791+00 |
| description | Code analyzer |
| homepage | https://raphamorim.io/boo |
| repository | https://github.com/raphamorim/boo |
| max_upload_size | |
| id | 1922850 |
| size | 132,501 |
A language-agnostic code analysis library that provides LSP-like functionality without the LSP protocol.
mansion allows you to analyze source code by providing it as a string and performing various operations similar to what Language Server Protocols (LSPs) do, such as:
ra_ap_syntax) for robust parsing and analysisuse mansion::{mansion, Position};
use mansion::rust::Rustmansion;
fn main() {
let mansion = Rustmansion::new();
// Parse and check for errors
let source = r#"
fn main() {
println!("Hello, world!");
}
"#;
let diagnostics = mansion.diagnostics(source);
if diagnostics.is_empty() {
println!("No errors!");
}
// Find all symbols
let symbols = mansion.symbols(source).unwrap();
for symbol in symbols {
println!("{:?}: {}", symbol.kind, symbol.name);
}
// Find symbol at a specific position
let position = Position { line: 2, column: 12 };
if let Some(symbol) = mansion.symbol_at_position(source, position).unwrap() {
println!("Found: {}", symbol.name);
}
}
cargo run --example basic
cargo test -p mansion