Skip to main content

CLanguageService

Struct CLanguageService 

Source
pub struct CLanguageService<V: Vfs> { /* private fields */ }

Implementations§

Source§

impl<V: Vfs> CLanguageService<V>

Source

pub fn new(vfs: V) -> Self

Trait Implementations§

Source§

impl<V: Vfs + Send + Sync + 'static + WritableVfs> LanguageService for CLanguageService<V>

Source§

type Lang = CLanguage

The language type this service supports.
Source§

type Vfs = V

The VFS type used for source management.
Source§

fn vfs(&self) -> &Self::Vfs

Returns a reference to the underlying Virtual File System.
Source§

fn workspace(&self) -> &WorkspaceManager

Returns a reference to the workspace manager.
Source§

fn get_root( &self, _uri: &str, ) -> impl Future<Output = Option<RedNode<'_, CLanguage>>> + Send + '_

Retrieves the root red node of a file for the given URI. Read more
Source§

fn hover( &self, _uri: &str, _range: Range<usize>, ) -> impl Future<Output = Option<LspHover>> + Send + '_

Provides hover information for a specific range in a file. Read more
Source§

fn get_source(&self, uri: &str) -> Option<<Self::Vfs as Vfs>::Source>

Retrieves the source content for a given URI from the VFS.
Source§

fn with_root<'a, R, F>( &'a self, uri: &'a str, f: F, ) -> impl Future<Output = Option<R>> + Send + 'a
where R: Send, F: FnOnce(RedNode<'a, Self::Lang>) -> R + Send + 'a,

Executes a closure with the root red node of a file. Read more
Source§

fn with_roots<'a, R, F>( &'a self, uris: Vec<String>, f: F, ) -> impl Future<Output = Vec<R>> + Send + 'a
where R: Send + 'static, F: Fn(RedNode<'a, Self::Lang>) -> R + Send + Sync + 'a,

Executes a closure with multiple root nodes in parallel. Read more
Source§

fn folding_ranges( &self, _uri: &str, ) -> impl Future<Output = Vec<FoldingRange>> + Send

Provides folding ranges for a file.
Source§

fn document_symbols<'a>( &'a self, uri: &'a str, ) -> impl Future<Output = Vec<StructureItem>> + Send + 'a

Provides document symbols (structure) for a file. Read more
Source§

fn workspace_symbols<'a>( &'a self, query: String, ) -> impl Future<Output = Vec<WorkspaceSymbol>> + Send + 'a

Provides workspace-wide symbol search based on a query string. Read more
Source§

fn list_all_files( &self, root_uri: &str, ) -> impl Future<Output = Vec<String>> + Send

Recursively lists all files in the VFS starting from the given root URI. Read more
Source§

fn definition<'a>( &'a self, uri: &'a str, range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a

Finds the definition(s) of a symbol at the specified range. Read more
Source§

fn document_highlight<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<DocumentHighlight>> + Send + 'a

Provides document highlights for a symbol at the specified range.
Source§

fn code_action<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<CodeAction>> + Send + 'a

Provides code actions for a specific range in a file.
Source§

fn formatting<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = Vec<TextEdit>> + Send + 'a

Provides formatting edits for a file.
Source§

fn range_formatting<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<TextEdit>> + Send + 'a

Provides range formatting edits for a file.
Source§

fn rename<'a>( &'a self, _uri: &'a str, _range: Range<usize>, _new_name: String, ) -> impl Future<Output = Option<WorkspaceEdit>> + Send + 'a

Provides rename edits for a symbol at the specified range.
Source§

fn semantic_tokens<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = Option<SemanticTokens>> + Send + 'a

Provides semantic tokens for a file.
Source§

fn inlay_hint<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<InlayHint>> + Send + 'a

Provides inlay hints for a file.
Source§

fn selection_range<'a>( &'a self, _uri: &'a str, _positions: Vec<usize>, ) -> impl Future<Output = Vec<SelectionRange>> + Send + 'a

Provides selection ranges for a file.
Source§

fn signature_help<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Option<SignatureHelp>> + Send + 'a

Provides signature help for a file.
Source§

fn completion<'a>( &'a self, _uri: &'a str, _offset: usize, ) -> impl Future<Output = Vec<CompletionItem>> + Send + 'a

Provides completion items for a file at the specified position.
Source§

fn references<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a

Finds all references to a symbol at the specified range.
Source§

fn type_definition<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a

Finds the type definition of a symbol at the specified range.
Source§

fn implementation<'a>( &'a self, _uri: &'a str, _range: Range<usize>, ) -> impl Future<Output = Vec<LocationRange>> + Send + 'a

Finds the implementation(s) of a symbol at the specified range.
Source§

fn initialize<'a>( &'a self, _params: InitializeParams, ) -> impl Future<Output = ()> + Send + 'a

Handles an LSP initialize request.
Source§

fn initialized<'a>(&'a self) -> impl Future<Output = ()> + Send + 'a

Called when the language server is fully initialized.
Source§

fn shutdown<'a>(&'a self) -> impl Future<Output = ()> + Send + 'a

Called when the language server is shut down.
Source§

fn did_save<'a>(&'a self, _uri: &'a str) -> impl Future<Output = ()> + Send + 'a

Called when a file is saved in the editor.
Source§

fn did_close<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = ()> + Send + 'a

Called when a file is closed in the editor.
Source§

fn diagnostics<'a>( &'a self, _uri: &'a str, ) -> impl Future<Output = Vec<Diagnostic>> + Send + 'a

Provides diagnostics for a file.

Auto Trait Implementations§

§

impl<V> !Freeze for CLanguageService<V>

§

impl<V> !RefUnwindSafe for CLanguageService<V>

§

impl<V> Send for CLanguageService<V>

§

impl<V> Sync for CLanguageService<V>

§

impl<V> Unpin for CLanguageService<V>
where V: Unpin,

§

impl<V> UnwindSafe for CLanguageService<V>
where V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.