pub struct CompletionHandler { /* private fields */ }Expand description
Completion handler for LSP
Implementations§
Source§impl CompletionHandler
impl CompletionHandler
Sourcepub fn new(engine: Arc<dyn CompletionEngine>) -> Self
pub fn new(engine: Arc<dyn CompletionEngine>) -> Self
Create a new completion handler
Sourcepub async fn handle_completion(
&self,
code: &str,
position: Position,
language: &str,
) -> LspResult<Vec<Value>>
pub async fn handle_completion( &self, code: &str, position: Position, language: &str, ) -> LspResult<Vec<Value>>
Handle textDocument/completion request
Sourcepub async fn handle_completion_resolve(&self, item: &Value) -> LspResult<Value>
pub async fn handle_completion_resolve(&self, item: &Value) -> LspResult<Value>
Handle completionItem/resolve request
Sourcepub fn apply_completion(
&self,
code: &str,
position: Position,
insert_text: &str,
) -> LspResult<String>
pub fn apply_completion( &self, code: &str, position: Position, insert_text: &str, ) -> LspResult<String>
Apply a completion item to code at the cursor position
Sourcepub fn validate_code_validity(&self, code: &str) -> LspResult<bool>
pub fn validate_code_validity(&self, code: &str) -> LspResult<bool>
Validate that code is still valid after completion insertion
Auto Trait Implementations§
impl Freeze for CompletionHandler
impl !RefUnwindSafe for CompletionHandler
impl Send for CompletionHandler
impl Sync for CompletionHandler
impl Unpin for CompletionHandler
impl !UnwindSafe for CompletionHandler
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