Struct Analysis

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

Entry point for asking for semantic information about ink! smart contract code.

Implementations§

Source§

impl Analysis

Source

pub fn new(code: &str, version: Version) -> Self

Creates an analysis instance from smart contract code.

Source

pub fn file(&self) -> &InkFile

Returns the intermediate representation (IR) of the smart contract code.

Source

pub fn diagnostics(&self) -> Vec<Diagnostic>

Runs diagnostics for the smart contract code.

Source

pub fn completions(&self, position: TextSize) -> Vec<Completion>

Computes ink! attribute completions at the given position.

Source

pub fn actions(&self, range: TextRange) -> Vec<Action>

Computes ink! attribute code/intent actions for the given text range.

Source

pub fn hover(&self, range: TextRange) -> Option<Hover>

Returns descriptive/informational text for the ink! attribute at the given text range (if any).

Source

pub fn inlay_hints(&self, range: Option<TextRange>) -> Vec<InlayHint>

Computes ink! attribute argument inlay hints for the given text range (if any).

Source

pub fn signature_help(&self, position: TextSize) -> Vec<SignatureHelp>

Computes ink! attribute signature help for the given position.

Source

pub fn migrate(&self) -> Vec<TextEdit>

Computes text edits for migrating the ink! 4.x file to ink! 5.0.

Source

pub fn extract(&self, range: TextRange) -> Option<Extraction>

Computes text edits for extracting an ink! event at the given text range into a standalone package (if possible).

Trait Implementations§

Source§

impl Debug for Analysis

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoBox<dyn Any> for T
where T: Any,

Source§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.