1#[cfg(feature = "oak-highlight")]
6pub mod highlighter;
7
8#[cfg(feature = "lsp")]
9use {oak_lsp::LanguageService, oak_vfs::MemoryVfs};
10
11#[cfg(feature = "oak-pretty-print")]
12pub mod formatter;
13
14use crate::language::LiquidLanguage;
15
16#[cfg(feature = "lsp")]
18pub struct LiquidLanguageService {
19 vfs: MemoryVfs,
20 workspace: oak_lsp::workspace::WorkspaceManager,
21}
22
23#[cfg(feature = "lsp")]
24impl LiquidLanguageService {
25 pub fn new(vfs: MemoryVfs) -> Self {
27 Self { vfs, workspace: oak_lsp::workspace::WorkspaceManager::default() }
28 }
29}
30
31#[cfg(feature = "lsp")]
32impl LanguageService for LiquidLanguageService {
33 type Lang = LiquidLanguage;
34 type Vfs = MemoryVfs;
35
36 fn vfs(&self) -> &Self::Vfs {
37 &self.vfs
38 }
39
40 fn workspace(&self) -> &oak_lsp::workspace::WorkspaceManager {
41 &self.workspace
42 }
43
44 fn get_root(&self, _uri: &str) -> impl std::future::Future<Output = Option<oak_core::tree::RedNode<'_, LiquidLanguage>>> + Send + '_ {
45 async move { None }
46 }
47}