pub struct LspManager {
pub clients: HashMap<String, Arc<LspClient>>,
pub workspace_root: PathBuf,
pub opened_files: BTreeSet<PathBuf>,
}Expand description
Orchestrates Language Servers for the agent.
Fields§
§clients: HashMap<String, Arc<LspClient>>§workspace_root: PathBuf§opened_files: BTreeSet<PathBuf>Implementations§
Source§impl LspManager
impl LspManager
pub fn new(workspace_root: PathBuf) -> Self
Sourcepub async fn start_servers(&mut self) -> Result<(), String>
pub async fn start_servers(&mut self) -> Result<(), String>
Discovers and starts necessary language servers.
pub async fn start_server( &mut self, lang: &str, command: &str, args: &[String], ) -> Result<(), String>
pub fn get_client(&self, lang: &str) -> Option<Arc<LspClient>>
Sourcepub fn get_client_for_path(&self, path: &str) -> Option<Arc<LspClient>>
pub fn get_client_for_path(&self, path: &str) -> Option<Arc<LspClient>>
Helper to find the client for a file extension.
pub fn resolve_uri(&self, path: &str) -> String
pub async fn ensure_opened(&mut self, path: &str) -> Result<(), String>
Auto Trait Implementations§
impl Freeze for LspManager
impl !RefUnwindSafe for LspManager
impl Send for LspManager
impl Sync for LspManager
impl Unpin for LspManager
impl UnsafeUnpin for LspManager
impl !UnwindSafe for LspManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more