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,

Object Safety§

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