[][src]Struct ra_ap_ide::Analysis

pub struct Analysis { /* fields omitted */ }

Analysis is a snapshot of a world state at a moment in time. It is the main entry point for asking semantic information about the world. When the world state is advanced using AnalysisHost::apply_change method, all existing Analysis are canceled (most method return Err(Canceled)).

Implementations

impl Analysis[src]

pub fn from_single_file(text: String) -> (Analysis, FileId)[src]

pub fn status(&self) -> Cancelable<String>[src]

Debug info about the current state of the analysis.

pub fn prime_caches(&self, files: Vec<FileId>) -> Cancelable<()>[src]

pub fn file_text(&self, file_id: FileId) -> Cancelable<Arc<String>>[src]

Gets the text of the source file.

pub fn parse(&self, file_id: FileId) -> Cancelable<SourceFile>[src]

Gets the syntax tree of the file.

pub fn file_line_index(&self, file_id: FileId) -> Cancelable<Arc<LineIndex>>[src]

Gets the file's LineIndex: data structure to convert between absolute offsets and line/column representation.

pub fn extend_selection(&self, frange: FileRange) -> Cancelable<TextRange>[src]

Selects the next syntactic nodes encompassing the range.

pub fn matching_brace(
    &self,
    position: FilePosition
) -> Cancelable<Option<TextSize>>
[src]

Returns position of the matching brace (all types of braces are supported).

pub fn syntax_tree(
    &self,
    file_id: FileId,
    text_range: Option<TextRange>
) -> Cancelable<String>
[src]

Returns a syntax tree represented as String, for debug purposes.

pub fn expand_macro(
    &self,
    position: FilePosition
) -> Cancelable<Option<ExpandedMacro>>
[src]

pub fn join_lines(&self, frange: FileRange) -> Cancelable<TextEdit>[src]

Returns an edit to remove all newlines in the range, cleaning up minor stuff like trailing commas.

pub fn on_enter(&self, position: FilePosition) -> Cancelable<Option<TextEdit>>[src]

Returns an edit which should be applied when opening a new line, fixing up minor stuff like continuing the comment. The edit will be a snippet (with $0).

pub fn on_char_typed(
    &self,
    position: FilePosition,
    char_typed: char
) -> Cancelable<Option<SourceChange>>
[src]

Returns an edit which should be applied after a character was typed.

This is useful for some on-the-fly fixups, like adding ; to let = automatically.

pub fn file_structure(&self, file_id: FileId) -> Cancelable<Vec<StructureNode>>[src]

Returns a tree representation of symbols in the file. Useful to draw a file outline.

pub fn inlay_hints(
    &self,
    file_id: FileId,
    config: &InlayHintsConfig
) -> Cancelable<Vec<InlayHint>>
[src]

Returns a list of the places in the file where type hints can be displayed.

pub fn folding_ranges(&self, file_id: FileId) -> Cancelable<Vec<Fold>>[src]

Returns the set of folding ranges.

Fuzzy searches for a symbol.

pub fn goto_definition(
    &self,
    position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
[src]

Returns the definitions from the symbol at position.

pub fn goto_implementation(
    &self,
    position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
[src]

Returns the impls from the symbol at position.

pub fn goto_type_definition(
    &self,
    position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
[src]

Returns the type definitions for the symbol at position.

pub fn find_all_refs(
    &self,
    position: FilePosition,
    search_scope: Option<SearchScope>
) -> Cancelable<Option<ReferenceSearchResult>>
[src]

Finds all usages of the reference at point.

pub fn hover(
    &self,
    position: FilePosition
) -> Cancelable<Option<RangeInfo<HoverResult>>>
[src]

Returns a short text describing element at position.

pub fn call_info(&self, position: FilePosition) -> Cancelable<Option<CallInfo>>[src]

Computes parameter information for the given call expression.

pub fn call_hierarchy(
    &self,
    position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
[src]

Computes call hierarchy candidates for the given file position.

pub fn incoming_calls(
    &self,
    position: FilePosition
) -> Cancelable<Option<Vec<CallItem>>>
[src]

Computes incoming calls for the given file position.

pub fn outgoing_calls(
    &self,
    position: FilePosition
) -> Cancelable<Option<Vec<CallItem>>>
[src]

Computes incoming calls for the given file position.

pub fn parent_module(
    &self,
    position: FilePosition
) -> Cancelable<Vec<NavigationTarget>>
[src]

Returns a mod name; declaration which created the current module.

pub fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>>[src]

Returns crates this file belongs too.

pub fn crate_edition(&self, crate_id: CrateId) -> Cancelable<Edition>[src]

Returns the edition of the given crate.

pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId>[src]

Returns the root file of the given crate.

pub fn runnables(&self, file_id: FileId) -> Cancelable<Vec<Runnable>>[src]

Returns the set of possible targets to run for the current file.

pub fn highlight(&self, file_id: FileId) -> Cancelable<Vec<HighlightedRange>>[src]

Computes syntax highlighting for the given file

pub fn highlight_range(
    &self,
    frange: FileRange
) -> Cancelable<Vec<HighlightedRange>>
[src]

Computes syntax highlighting for the given file range.

pub fn highlight_as_html(
    &self,
    file_id: FileId,
    rainbow: bool
) -> Cancelable<String>
[src]

Computes syntax highlighting for the given file.

pub fn completions(
    &self,
    config: &CompletionConfig,
    position: FilePosition
) -> Cancelable<Option<Vec<CompletionItem>>>
[src]

Computes completions at the given position.

pub fn resolved_assists(
    &self,
    config: &AssistConfig,
    frange: FileRange
) -> Cancelable<Vec<ResolvedAssist>>
[src]

Computes resolved assists with source changes for the given position.

pub fn unresolved_assists(
    &self,
    config: &AssistConfig,
    frange: FileRange
) -> Cancelable<Vec<Assist>>
[src]

Computes unresolved assists (aka code actions aka intentions) for the given position.

pub fn diagnostics(
    &self,
    config: &DiagnosticsConfig,
    file_id: FileId
) -> Cancelable<Vec<Diagnostic>>
[src]

Computes the set of diagnostics for the given file.

pub fn rename(
    &self,
    position: FilePosition,
    new_name: &str
) -> Cancelable<Option<RangeInfo<SourceChange>>>
[src]

Returns the edit required to rename reference at the position to the new name.

pub fn structural_search_replace(
    &self,
    query: &str,
    parse_only: bool,
    resolve_context: FilePosition,
    selections: Vec<FileRange>
) -> Cancelable<Result<SourceChange, SsrError>>
[src]

Trait Implementations

impl Debug for Analysis[src]

Auto Trait Implementations

impl RefUnwindSafe for Analysis

impl Send for Analysis

impl !Sync for Analysis

impl Unpin for Analysis

impl UnwindSafe for Analysis

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Cast for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.