oak_julia/
lsp.rs

1use crate::JuliaLanguage;
2use futures::Future;
3use oak_lsp::service::LanguageService;
4use oak_vfs::Vfs;
5
6pub struct JuliaLanguageService<V: Vfs> {
7    vfs: V,
8    workspace: oak_lsp::workspace::WorkspaceManager,
9}
10
11impl<V: Vfs> JuliaLanguageService<V> {
12    pub fn new(vfs: V) -> Self {
13        Self { vfs, workspace: oak_lsp::workspace::WorkspaceManager::default() }
14    }
15}
16
17impl<V: Vfs + Send + Sync + 'static + oak_vfs::WritableVfs> LanguageService for JuliaLanguageService<V> {
18    type Lang = JuliaLanguage;
19    type Vfs = V;
20
21    fn vfs(&self) -> &Self::Vfs {
22        &self.vfs
23    }
24
25    fn workspace(&self) -> &oak_lsp::workspace::WorkspaceManager {
26        &self.workspace
27    }
28
29    fn get_root(&self, _uri: &str) -> impl Future<Output = Option<oak_core::tree::RedNode<'_, Self::Lang>>> + Send + '_ {
30        async move { None }
31    }
32}