1#[cfg(feature = "oak-highlight")]
4pub mod highlighter;
5
6use crate::language::JavaLanguage;
7use oak_core::tree::RedNode;
8#[cfg(feature = "lsp")]
9use {oak_lsp::LanguageService, oak_vfs::Vfs, std::future::Future};
10
11#[cfg(feature = "lsp")]
13pub struct JavaLanguageService<V: Vfs> {
14 vfs: V,
15 workspace: oak_lsp::workspace::WorkspaceManager,
16}
17impl<V: Vfs> JavaLanguageService<V> {
18 pub fn new(vfs: V, _language: JavaLanguage) -> Self {
20 Self { vfs, workspace: oak_lsp::workspace::WorkspaceManager::default() }
21 }
22}
23impl<V: Vfs + Send + Sync + 'static + oak_vfs::WritableVfs> LanguageService for JavaLanguageService<V> {
24 type Lang = JavaLanguage;
25 type Vfs = V;
26 fn vfs(&self) -> &Self::Vfs {
27 &self.vfs
28 }
29 fn workspace(&self) -> &oak_lsp::workspace::WorkspaceManager {
30 &self.workspace
31 }
32 fn get_root(&self, _uri: &str) -> impl Future<Output = Option<RedNode<'_, JavaLanguage>>> + Send + '_ {
33 async move { None }
34 }
35}