kcl_lib::lsp::backend

Trait Backend

Source
pub trait Backend:
    Clone
    + Send
    + Sync
where Self: 'static,
{
Show 28 methods // Required methods fn client(&self) -> &Client; fn fs(&self) -> &Arc<FileManager>; fn is_initialized<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn set_is_initialized<'life0, 'async_trait>( &'life0 self, is_initialized: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn workspace_folders<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<WorkspaceFolder>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn add_workspace_folders<'life0, 'async_trait>( &'life0 self, folders: Vec<WorkspaceFolder>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn remove_workspace_folders<'life0, 'async_trait>( &'life0 self, folders: Vec<WorkspaceFolder>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn code_map(&self) -> &DashMap<String, Vec<u8>>; fn insert_code_map<'life0, 'async_trait>( &'life0 self, uri: String, text: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn remove_from_code_map<'life0, 'async_trait>( &'life0 self, uri: String, ) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn clear_code_state<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn current_diagnostics_map(&self) -> &DashMap<String, Vec<Diagnostic>>; fn inner_on_change<'life0, 'async_trait>( &'life0 self, params: TextDocumentItem, force: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn has_diagnostics<'life0, 'life1, 'async_trait>( &'life0 self, uri: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn on_change<'life0, 'async_trait>( &'life0 self, params: TextDocumentItem, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn update_from_disk<'life0, 'async_trait, P>( &'life0 self, path: P, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait { ... } fn do_initialized<'life0, 'async_trait>( &'life0 self, params: InitializedParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_change_workspace_folders<'life0, 'async_trait>( &'life0 self, params: DidChangeWorkspaceFoldersParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_change_configuration<'life0, 'async_trait>( &'life0 self, params: DidChangeConfigurationParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_change_watched_files<'life0, 'async_trait>( &'life0 self, params: DidChangeWatchedFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_create_files<'life0, 'async_trait>( &'life0 self, params: CreateFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_rename_files<'life0, 'async_trait>( &'life0 self, params: RenameFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_delete_files<'life0, 'async_trait>( &'life0 self, params: DeleteFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_open<'life0, 'async_trait>( &'life0 self, params: DidOpenTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_change<'life0, 'async_trait>( &'life0 self, params: DidChangeTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_save<'life0, 'async_trait>( &'life0 self, params: DidSaveTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn do_did_close<'life0, 'async_trait>( &'life0 self, params: DidCloseTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

A trait for the backend of the language server.

Required Methods§

Source

fn client(&self) -> &Client

Source

fn fs(&self) -> &Arc<FileManager>

Source

fn is_initialized<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn set_is_initialized<'life0, 'async_trait>( &'life0 self, is_initialized: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn workspace_folders<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<WorkspaceFolder>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn add_workspace_folders<'life0, 'async_trait>( &'life0 self, folders: Vec<WorkspaceFolder>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn remove_workspace_folders<'life0, 'async_trait>( &'life0 self, folders: Vec<WorkspaceFolder>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn code_map(&self) -> &DashMap<String, Vec<u8>>

Get the current code map.

Source

fn insert_code_map<'life0, 'async_trait>( &'life0 self, uri: String, text: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert a new code map.

Source

fn remove_from_code_map<'life0, 'async_trait>( &'life0 self, uri: String, ) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn clear_code_state<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clear the current code state.

Source

fn current_diagnostics_map(&self) -> &DashMap<String, Vec<Diagnostic>>

Get the current diagnostics map.

Source

fn inner_on_change<'life0, 'async_trait>( &'life0 self, params: TextDocumentItem, force: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

On change event.

Provided Methods§

Source

fn has_diagnostics<'life0, 'life1, 'async_trait>( &'life0 self, uri: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if the file has diagnostics.

Source

fn on_change<'life0, 'async_trait>( &'life0 self, params: TextDocumentItem, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_from_disk<'life0, 'async_trait, P>( &'life0 self, path: P, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_initialized<'life0, 'async_trait>( &'life0 self, params: InitializedParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_change_workspace_folders<'life0, 'async_trait>( &'life0 self, params: DidChangeWorkspaceFoldersParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_change_configuration<'life0, 'async_trait>( &'life0 self, params: DidChangeConfigurationParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_change_watched_files<'life0, 'async_trait>( &'life0 self, params: DidChangeWatchedFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_create_files<'life0, 'async_trait>( &'life0 self, params: CreateFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_rename_files<'life0, 'async_trait>( &'life0 self, params: RenameFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_delete_files<'life0, 'async_trait>( &'life0 self, params: DeleteFilesParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_open<'life0, 'async_trait>( &'life0 self, params: DidOpenTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_change<'life0, 'async_trait>( &'life0 self, params: DidChangeTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_save<'life0, 'async_trait>( &'life0 self, params: DidSaveTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_did_close<'life0, 'async_trait>( &'life0 self, params: DidCloseTextDocumentParams, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Backend for kcl_lib::lsp::copilot::Backend

Source§

impl Backend for kcl_lib::lsp::kcl::Backend