pub struct Analysis { /* private fields */ }
Expand description

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

Debug info about the current state of the analysis.

Gets the text of the source file.

Gets the syntax tree of the file.

Returns true if this file belongs to an immutable library.

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

Selects the next syntactic nodes encompassing the range.

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

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

Renders the crate graph to GraphViz “dot” syntax.

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

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).

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.

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

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

Returns the set of folding ranges.

Fuzzy searches for a symbol.

Returns the definitions from the symbol at position.

Returns the declaration from the symbol at position.

Returns the impls from the symbol at position.

Returns the type definitions for the symbol at position.

Finds all usages of the reference at point.

Finds all methods and free functions for the file. Does not return tests!

Returns a short text describing element at position.

Returns moniker of symbol at position.

Return URL(s) for the documentation of the symbol under the cursor.

Computes parameter information for the given call expression.

Computes call hierarchy candidates for the given file position.

Computes incoming calls for the given file position.

Computes outgoing calls for the given file position.

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

Returns crates this file belongs too.

Returns the edition of the given crate.

Returns the root file of the given crate.

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

Returns the set of tests for the given file position.

Computes syntax highlighting for the given file

Computes all ranges to highlight for a given item in a file.

Computes syntax highlighting for the given file range.

Computes syntax highlighting for the given file.

Computes completions at the given position.

Resolves additional completion data at the position given.

Computes the set of diagnostics for the given file.

Convenience function to return assists + quick fixes for diagnostics

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

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast a value to type U using CastTo.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more