pub struct LspQueryTool { /* private fields */ }Expand description
Tool that queries language servers for code intelligence.
Supports four actions:
definition— go to definition of a symbol at a positionreferences— find all references to a symbol at a positionhover— get hover information (type info, docs) for a symbol at a positionsymbols— list all symbols in a file (document symbols)
Implementations§
Source§impl LspQueryTool
impl LspQueryTool
Sourcepub fn new(lsp: Arc<Mutex<LspWrapper>>) -> Self
pub fn new(lsp: Arc<Mutex<LspWrapper>>) -> Self
Create a new LSP query tool with the given LSP wrapper.
Trait Implementations§
Source§impl BaseTool for LspQueryTool
impl BaseTool for LspQueryTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description shown to the LLM.
Source§fn parameter_schema(&self) -> Value
fn parameter_schema(&self) -> Value
JSON Schema describing the tool’s parameters. Read more
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: HashMap<String, Value>,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: HashMap<String, Value>,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with the given arguments and context.
Source§fn display_meta(&self) -> Option<ToolDisplayMeta>
fn display_meta(&self) -> Option<ToolDisplayMeta>
Return TUI display metadata for this tool. Read more
Source§fn format_validation_error(&self, errors: &[ValidationError]) -> Option<String>
fn format_validation_error(&self, errors: &[ValidationError]) -> Option<String>
Format a validation error into a tool-specific, LLM-friendly message. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LspQueryTool
impl !UnwindSafe for LspQueryTool
impl Freeze for LspQueryTool
impl Send for LspQueryTool
impl Sync for LspQueryTool
impl Unpin for LspQueryTool
impl UnsafeUnpin for LspQueryTool
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