1#![doc = include_str!("readme.md")]
2#[cfg(feature = "oak-highlight")]
3pub mod highlighter;
4
5#[cfg(feature = "lsp")]
6use {oak_lsp::LanguageService, oak_vfs::MemoryVfs};
7#[cfg(feature = "oak-pretty-print")]
8pub mod formatter;
9use crate::language::ValaLanguage;
10#[cfg(feature = "lsp")]
12pub struct ValaLanguageService {
13 vfs: MemoryVfs,
14 workspace: oak_lsp::workspace::WorkspaceManager,
15}
16#[cfg(feature = "lsp")]
17impl ValaLanguageService {
18 pub fn new(vfs: MemoryVfs) -> Self {
19 Self { vfs, workspace: oak_lsp::workspace::WorkspaceManager::default() }
20 }
21}
22#[cfg(feature = "lsp")]
23impl LanguageService for ValaLanguageService {
24 type Lang = ValaLanguage;
25 type Vfs = MemoryVfs;
26 fn vfs(&self) -> &Self::Vfs {
27 &self.vfs
28 }
29 fn workspace(&self) -> &oak_lsp::workspace::WorkspaceManager {
30 &self.workspace
31 }
32}