| Crates.io | nocturne |
| lib.rs | nocturne |
| version | 0.0.1 |
| created_at | 2025-11-08 18:23:17.800659+00 |
| updated_at | 2025-11-08 18:23:17.800659+00 |
| description | Code analyzer |
| homepage | https://raphamorim.io/boo |
| repository | https://github.com/raphamorim/boo |
| max_upload_size | |
| id | 1923131 |
| size | 132,519 |
A language-agnostic code analysis library that provides LSP-like functionality without the LSP protocol.
nocturne 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 nocturne::{nocturne, Position};
use nocturne::rust::Rustnocturne;
fn main() {
let nocturne = Rustnocturne::new();
// Parse and check for errors
let source = r#"
fn main() {
println!("Hello, world!");
}
"#;
let diagnostics = nocturne.diagnostics(source);
if diagnostics.is_empty() {
println!("No errors!");
}
// Find all symbols
let symbols = nocturne.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) = nocturne.symbol_at_position(source, position).unwrap() {
println!("Found: {}", symbol.name);
}
}
cargo run --example basic
cargo test -p nocturne