sway_lsp::core::token_map_ext

Trait TokenMapExt

Source
pub trait TokenMapExt<'s>: Sized {
    // Required method
    fn all_references_of_token(
        self,
        token_to_match: &'s Token,
        engines: &'s Engines,
    ) -> AllReferencesOfToken<'s, Self> ;
}
Expand description

A trait for extending iterators with the all_references_of_token method.

Required Methods§

Source

fn all_references_of_token( self, token_to_match: &'s Token, engines: &'s Engines, ) -> AllReferencesOfToken<'s, Self>

Find all references in the TokenMap for a given token.

This is useful for the highlighting and renaming LSP capabilities.

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<'s, I> TokenMapExt<'s> for I
where I: Iterator<Item = RefMulti<'s, TokenIdent, Token>>,

Implement TokenMapExt for any iterator that yields RefMulti for TokenIdent, Token pairs.