Skip to main content

IniLanguageService

Struct IniLanguageService 

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

Implementations§

Source§

impl<V: Vfs> IniLanguageService<V>

Source

pub fn new(vfs: V) -> Self

Trait Implementations§

Source§

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

Source§

type Lang = IniLanguage

Source§

type Vfs = V

Source§

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

Get the underlying VFS.
Source§

fn workspace(&self) -> &WorkspaceManager

Get the workspace manager.
Source§

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

Helper to get the root red node of a file. Implementations should override this to provide actual parsing/caching.
Source§

fn hover( &self, uri: &str, range: Range<usize>, ) -> impl Future<Output = Option<Hover>> + Send + '_

Provide hover information. Defaults to None.
Source§

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

Helper to get source from 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,

Helper to run logic with the root node.
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,

Helper to run logic with multiple root nodes in parallel.
Source§

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

Provide folding ranges. Defaults to empty.
Source§

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

Provide document symbols. Defaults to empty.
Source§

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

Provide workspace symbols.
Source§

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

Helper to list all files recursively.
Source§

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

Find definition. Defaults to empty.
Source§

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

Find references. Defaults to empty.
Source§

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

Find type definition. Defaults to empty.
Source§

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

Find implementation. Defaults to empty.
Source§

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

Provide document highlights. Defaults to empty.
Source§

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

Rename a symbol.
Source§

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

Provide completion items. Defaults to empty.
Source§

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

Provide diagnostics for a file. Defaults to empty.
Source§

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

Provide semantic tokens for a file. Defaults to None.
Source§

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

Provide semantic tokens for a range. Defaults to None.
Source§

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

Provide selection ranges for a file. Defaults to empty.
Source§

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

Provide signature help at a position. Defaults to None.
Source§

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

Provide inlay hints for a file. Defaults to empty.
Source§

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

Provide document formatting. Defaults to empty.
Source§

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

Provide code actions for a file. Defaults to empty.
Source§

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

Called when the language server is initialized.
Source§

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

Called when the language server is initialized (notification).
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.
Source§

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

Called when a file is closed.

Auto Trait Implementations§

§

impl<V> !Freeze for IniLanguageService<V>

§

impl<V> !RefUnwindSafe for IniLanguageService<V>

§

impl<V> Send for IniLanguageService<V>

§

impl<V> Sync for IniLanguageService<V>

§

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

§

impl<V> UnwindSafe for IniLanguageService<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.