Skip to main content

FeatureProvider

Trait FeatureProvider 

Source
pub trait FeatureProvider:
    Send
    + Sync
    + 'static {
    // Required methods
    fn semantic_tokens(&self, document: &Document) -> Vec<LexSemanticToken>;
    fn document_symbols(&self, document: &Document) -> Vec<LexDocumentSymbol>;
    fn folding_ranges(&self, document: &Document) -> Vec<LexFoldingRange>;
    fn hover(
        &self,
        document: &Document,
        position: AstPosition,
    ) -> Option<HoverResult>;
    fn goto_definition(
        &self,
        document: &Document,
        position: AstPosition,
    ) -> Vec<AstRange>;
    fn references(
        &self,
        document: &Document,
        position: AstPosition,
        include_declaration: bool,
    ) -> Vec<AstRange>;
    fn document_links(&self, document: &Document) -> Vec<AstDocumentLink>;
    fn format_document(
        &self,
        document: &Document,
        source: &str,
        rules: Option<FormattingRules>,
    ) -> Vec<TextEditSpan>;
    fn format_range(
        &self,
        document: &Document,
        source: &str,
        range: FormattingLineRange,
        rules: Option<FormattingRules>,
    ) -> Vec<TextEditSpan>;
    fn completion(
        &self,
        document: &Document,
        position: AstPosition,
        current_line: Option<&str>,
        workspace: Option<&CompletionWorkspace>,
        trigger_char: Option<&str>,
    ) -> Vec<CompletionCandidate>;
    fn execute_command(
        &self,
        command: &str,
        arguments: &[Value],
    ) -> Result<Option<Value>>;
}

Required Methods§

Source

fn semantic_tokens(&self, document: &Document) -> Vec<LexSemanticToken>

Source

fn document_symbols(&self, document: &Document) -> Vec<LexDocumentSymbol>

Source

fn folding_ranges(&self, document: &Document) -> Vec<LexFoldingRange>

Source

fn hover( &self, document: &Document, position: AstPosition, ) -> Option<HoverResult>

Source

fn goto_definition( &self, document: &Document, position: AstPosition, ) -> Vec<AstRange>

Source

fn references( &self, document: &Document, position: AstPosition, include_declaration: bool, ) -> Vec<AstRange>

Source

fn format_document( &self, document: &Document, source: &str, rules: Option<FormattingRules>, ) -> Vec<TextEditSpan>

Source

fn format_range( &self, document: &Document, source: &str, range: FormattingLineRange, rules: Option<FormattingRules>, ) -> Vec<TextEditSpan>

Source

fn completion( &self, document: &Document, position: AstPosition, current_line: Option<&str>, workspace: Option<&CompletionWorkspace>, trigger_char: Option<&str>, ) -> Vec<CompletionCandidate>

Source

fn execute_command( &self, command: &str, arguments: &[Value], ) -> Result<Option<Value>>

Implementors§