pub struct ForeignLspManager { /* private fields */ }Expand description
Manages child LSP server processes for foreign language blocks.
Each foreign language gets at most one child server. The manager handles lifecycle (start, shutdown), document synchronization, and request forwarding.
Implementations§
Source§impl ForeignLspManager
impl ForeignLspManager
pub fn new(workspace_dir: PathBuf) -> Self
Sourcepub fn set_workspace_dir(&self, dir: PathBuf)
pub fn set_workspace_dir(&self, dir: PathBuf)
Update the workspace root directory.
Called from initialize() once the real workspace root is known from
the client’s rootUri / workspaceFolders. This ensures child LSP
servers receive the correct rootUri so they can discover project
config files (e.g. pyrightconfig.json, virtualenvs).
Sourcepub async fn set_configured_extensions(
&self,
specs: Vec<ConfiguredExtensionSpec>,
)
pub async fn set_configured_extensions( &self, specs: Vec<ConfiguredExtensionSpec>, )
Set extension specs that should always be loaded for foreign-LSP discovery.
Sourcepub async fn start_server(&self, language: &str) -> Result<(), String>
pub async fn start_server(&self, language: &str) -> Result<(), String>
Start a child language server for the given language, if not already running.
Sourcepub async fn update_documents(
&self,
source_uri: &str,
source: &str,
items: &[Item],
current_file: Option<&Path>,
workspace_root: Option<&Path>,
) -> Vec<Diagnostic>
pub async fn update_documents( &self, source_uri: &str, source: &str, items: &[Item], current_file: Option<&Path>, workspace_root: Option<&Path>, ) -> Vec<Diagnostic>
Update virtual documents for all foreign function blocks in a parsed program.
Call this from analyze_document whenever the program is successfully parsed.
Sourcepub async fn handle_completion(
&self,
source_uri: &str,
position: Position,
items: &[Item],
source: &str,
) -> Option<Vec<CompletionItem>>
pub async fn handle_completion( &self, source_uri: &str, position: Position, items: &[Item], source: &str, ) -> Option<Vec<CompletionItem>>
Handle a completion request that falls inside a foreign function body.
Returns None if the position is not in a foreign block or delegation fails.
Sourcepub async fn handle_hover(
&self,
source_uri: &str,
position: Position,
items: &[Item],
source: &str,
) -> Option<Hover>
pub async fn handle_hover( &self, source_uri: &str, position: Position, items: &[Item], source: &str, ) -> Option<Hover>
Handle a hover request that falls inside a foreign function body.
Sourcepub async fn handle_signature_help(
&self,
source_uri: &str,
position: Position,
items: &[Item],
source: &str,
) -> Option<SignatureHelp>
pub async fn handle_signature_help( &self, source_uri: &str, position: Position, items: &[Item], source: &str, ) -> Option<SignatureHelp>
Handle a signature help request that falls inside a foreign function body.
Sourcepub async fn handle_definition(
&self,
source_uri: &str,
position: Position,
items: &[Item],
source: &str,
) -> Option<GotoDefinitionResponse>
pub async fn handle_definition( &self, source_uri: &str, position: Position, items: &[Item], source: &str, ) -> Option<GotoDefinitionResponse>
Handle go-to-definition for positions inside foreign function bodies.
Sourcepub async fn handle_references(
&self,
source_uri: &str,
position: Position,
items: &[Item],
source: &str,
) -> Option<Vec<Location>>
pub async fn handle_references( &self, source_uri: &str, position: Position, items: &[Item], source: &str, ) -> Option<Vec<Location>>
Handle find-references for positions inside foreign function bodies.
Sourcepub async fn collect_semantic_tokens(
&self,
source_uri: &str,
) -> Vec<ForeignSemanticToken>
pub async fn collect_semantic_tokens( &self, source_uri: &str, ) -> Vec<ForeignSemanticToken>
Collect semantic tokens for foreign blocks mapped into Shape coordinates.
Sourcepub async fn get_diagnostics(&self, source_uri: &str) -> Vec<Diagnostic>
pub async fn get_diagnostics(&self, source_uri: &str) -> Vec<Diagnostic>
Retrieve diagnostics from child language servers for foreign blocks in a source file.
Maps virtual document diagnostics back to Shape source positions.
Sourcepub fn map_diagnostic_to_shape(
diagnostic: &Diagnostic,
position_map: &PositionMap,
) -> Option<Diagnostic>
pub fn map_diagnostic_to_shape( diagnostic: &Diagnostic, position_map: &PositionMap, ) -> Option<Diagnostic>
Map a diagnostic from a virtual document back to Shape source coordinates.
Auto Trait Implementations§
impl !Freeze for ForeignLspManager
impl !RefUnwindSafe for ForeignLspManager
impl Send for ForeignLspManager
impl Sync for ForeignLspManager
impl Unpin for ForeignLspManager
impl UnsafeUnpin for ForeignLspManager
impl !UnwindSafe for ForeignLspManager
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
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>
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>
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