[−][src]Struct ra_ap_ide::Analysis
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]
&self,
position: FilePosition
) -> Cancelable<Option<TextSize>>
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]
&self,
file_id: FileId,
text_range: Option<TextRange>
) -> Cancelable<String>
Returns a syntax tree represented as String
, for debug purposes.
pub fn expand_macro(
&self,
position: FilePosition
) -> Cancelable<Option<ExpandedMacro>>
[src]
&self,
position: FilePosition
) -> Cancelable<Option<ExpandedMacro>>
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]
&self,
position: FilePosition,
char_typed: char
) -> Cancelable<Option<SourceChange>>
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]
&self,
file_id: FileId,
config: &InlayHintsConfig
) -> Cancelable<Vec<InlayHint>>
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.
pub fn symbol_search(&self, query: Query) -> Cancelable<Vec<NavigationTarget>>
[src]
Fuzzy searches for a symbol.
pub fn goto_definition(
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
[src]
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
Returns the definitions from the symbol at position
.
pub fn goto_implementation(
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
[src]
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
Returns the impls from the symbol at position
.
pub fn goto_type_definition(
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
[src]
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
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]
&self,
position: FilePosition,
search_scope: Option<SearchScope>
) -> Cancelable<Option<ReferenceSearchResult>>
Finds all usages of the reference at point.
pub fn hover(
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<HoverResult>>>
[src]
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<HoverResult>>>
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]
&self,
position: FilePosition
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>>
Computes call hierarchy candidates for the given file position.
pub fn incoming_calls(
&self,
position: FilePosition
) -> Cancelable<Option<Vec<CallItem>>>
[src]
&self,
position: FilePosition
) -> Cancelable<Option<Vec<CallItem>>>
Computes incoming calls for the given file position.
pub fn outgoing_calls(
&self,
position: FilePosition
) -> Cancelable<Option<Vec<CallItem>>>
[src]
&self,
position: FilePosition
) -> Cancelable<Option<Vec<CallItem>>>
Computes incoming calls for the given file position.
pub fn parent_module(
&self,
position: FilePosition
) -> Cancelable<Vec<NavigationTarget>>
[src]
&self,
position: FilePosition
) -> Cancelable<Vec<NavigationTarget>>
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]
&self,
frange: FileRange
) -> Cancelable<Vec<HighlightedRange>>
Computes syntax highlighting for the given file range.
pub fn highlight_as_html(
&self,
file_id: FileId,
rainbow: bool
) -> Cancelable<String>
[src]
&self,
file_id: FileId,
rainbow: bool
) -> Cancelable<String>
Computes syntax highlighting for the given file.
pub fn completions(
&self,
config: &CompletionConfig,
position: FilePosition
) -> Cancelable<Option<Vec<CompletionItem>>>
[src]
&self,
config: &CompletionConfig,
position: FilePosition
) -> Cancelable<Option<Vec<CompletionItem>>>
Computes completions at the given position.
pub fn resolved_assists(
&self,
config: &AssistConfig,
frange: FileRange
) -> Cancelable<Vec<ResolvedAssist>>
[src]
&self,
config: &AssistConfig,
frange: FileRange
) -> Cancelable<Vec<ResolvedAssist>>
Computes resolved assists with source changes for the given position.
pub fn unresolved_assists(
&self,
config: &AssistConfig,
frange: FileRange
) -> Cancelable<Vec<Assist>>
[src]
&self,
config: &AssistConfig,
frange: FileRange
) -> Cancelable<Vec<Assist>>
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]
&self,
config: &DiagnosticsConfig,
file_id: FileId
) -> Cancelable<Vec<Diagnostic>>
Computes the set of diagnostics for the given file.
pub fn rename(
&self,
position: FilePosition,
new_name: &str
) -> Cancelable<Option<RangeInfo<SourceChange>>>
[src]
&self,
position: FilePosition,
new_name: &str
) -> Cancelable<Option<RangeInfo<SourceChange>>>
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]
&self,
query: &str,
parse_only: bool,
resolve_context: FilePosition,
selections: Vec<FileRange>
) -> Cancelable<Result<SourceChange, SsrError>>
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Cast for T
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Self: CastTo<U>,
U: HasInterner,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,