Skip to main content

oak_notedown/builder/
mod.rs

1#![doc = include_str!("readme.md")]
2use crate::{ast::NoteDocument, language::NotedownLanguage};
3use oak_core::{Builder, BuilderCache, TextEdit, source::Source};
4
5/// Notedown AST builder
6pub struct NoteBuilder<'config> {
7    pub(crate) config: &'config NotedownLanguage,
8}
9
10impl<'config> NoteBuilder<'config> {
11    /// Create a new builder with the given language configuration
12    pub fn new(config: &'config NotedownLanguage) -> Self {
13        Self { config }
14    }
15}
16
17impl<'config> Builder<NotedownLanguage> for NoteBuilder<'config> {
18    fn build<'a, S: Source + ?Sized>(&self, _source: &S, _edits: &[TextEdit], _cache: &'a mut impl BuilderCache<NotedownLanguage>) -> oak_core::builder::BuildOutput<NotedownLanguage> {
19        // Simple implementation
20        oak_core::errors::OakDiagnostics { result: Ok(NoteDocument {}), diagnostics: Vec::new() }
21    }
22}