1use crate::language::GoLanguage;
4use oak_core::tree::RedNode;
5use oak_lsp::LanguageService;
6use oak_vfs::MemoryVfs;
7use std::future::Future;
8
9pub struct GoLanguageService {
11 vfs: MemoryVfs,
12 workspace: oak_lsp::workspace::WorkspaceManager,
13}
14
15impl GoLanguageService {
16 pub fn new(vfs: MemoryVfs) -> Self {
18 Self { vfs, workspace: oak_lsp::workspace::WorkspaceManager::default() }
19 }
20}
21
22impl LanguageService for GoLanguageService {
23 type Lang = GoLanguage;
24 type Vfs = MemoryVfs;
25
26 fn vfs(&self) -> &Self::Vfs {
27 &self.vfs
28 }
29
30 fn workspace(&self) -> &oak_lsp::workspace::WorkspaceManager {
31 &self.workspace
32 }
33
34 fn get_root(&self, _uri: &str) -> impl Future<Output = Option<RedNode<'_, Self::Lang>>> + Send + '_ {
35 async { None }
36 }
37}