pub struct ItemScope<'a> {
pub diagnostics: RefCell<Vec<Diagnostic>>,
/* private fields */
}
Fields§
§diagnostics: RefCell<Vec<Diagnostic>>
Implementations§
Trait Implementations§
Source§impl<'a> AnalyzerContext for ItemScope<'a>
impl<'a> AnalyzerContext for ItemScope<'a>
Source§fn get_context_type(&self) -> Option<TypeId>
fn get_context_type(&self) -> Option<TypeId>
Gets std::context::Context
if it exists
fn db(&self) -> &dyn AnalyzerDb
Source§fn add_expression(&self, node: &Node<Expr>, attributes: ExpressionAttributes)
fn add_expression(&self, node: &Node<Expr>, attributes: ExpressionAttributes)
Attribute contextual information to an expression node. Read more
Source§fn update_expression(
&self,
node: &Node<Expr>,
f: &dyn Fn(&mut ExpressionAttributes),
)
fn update_expression( &self, node: &Node<Expr>, f: &dyn Fn(&mut ExpressionAttributes), )
Update the expression attributes. Read more
Source§fn add_constant(
&self,
_name: &Node<SmolStr>,
_expr: &Node<Expr>,
_value: Constant,
)
fn add_constant( &self, _name: &Node<SmolStr>, _expr: &Node<Expr>, _value: Constant, )
Add evaluated constant value in a constant declaration to the context.
Source§fn constant_value_by_name(
&self,
name: &SmolStr,
_span: Span,
) -> Result<Option<Constant>, IncompleteItem>
fn constant_value_by_name( &self, name: &SmolStr, _span: Span, ) -> Result<Option<Constant>, IncompleteItem>
Returns constant value from variable name.
Source§fn parent_function(&self) -> FunctionId
fn parent_function(&self) -> FunctionId
Returns a function id that encloses a context. Read more
fn get_call(&self, _node: &Node<Expr>) -> Option<CallType>
Source§fn is_in_function(&self) -> bool
fn is_in_function(&self) -> bool
Returns
true
if the context is in function scope.Source§fn inherits_type(&self, _typ: BlockScopeType) -> bool
fn inherits_type(&self, _typ: BlockScopeType) -> bool
Returns
true
if the scope or any of its parents is of the given type.fn resolve_name( &self, name: &str, span: Span, ) -> Result<Option<NamedThing>, IncompleteItem>
Source§fn resolve_path(
&self,
path: &Path,
span: Span,
) -> Result<NamedThing, FatalError>
fn resolve_path( &self, path: &Path, span: Span, ) -> Result<NamedThing, FatalError>
Resolves the given path and registers all errors
Source§fn resolve_visible_path(&self, path: &Path) -> Option<NamedThing>
fn resolve_visible_path(&self, path: &Path) -> Option<NamedThing>
Resolves the given path only if it is visible. Does not register any errors
Source§fn resolve_any_path(&self, path: &Path) -> Option<NamedThing>
fn resolve_any_path(&self, path: &Path) -> Option<NamedThing>
Resolves the given path. Does not register any errors
fn add_diagnostic(&self, diag: Diagnostic)
fn error( &self, message: &str, label_span: Span, label: &str, ) -> DiagnosticVoucher
fn type_error( &self, message: &str, span: Span, expected: TypeId, actual: TypeId, ) -> DiagnosticVoucher
fn not_yet_implemented(&self, feature: &str, span: Span) -> DiagnosticVoucher
fn fancy_error( &self, message: &str, labels: Vec<Label>, notes: Vec<String>, ) -> DiagnosticVoucher
fn duplicate_name_error( &self, message: &str, name: &str, original: Span, duplicate: Span, ) -> DiagnosticVoucher
fn name_conflict_error( &self, name_kind: &str, name: &str, original: &NamedThing, original_span: Option<Span>, duplicate_span: Span, ) -> DiagnosticVoucher
fn register_diag(&self, diag: Diagnostic) -> DiagnosticVoucher
Auto Trait Implementations§
impl<'a> !Freeze for ItemScope<'a>
impl<'a> !RefUnwindSafe for ItemScope<'a>
impl<'a> !Send for ItemScope<'a>
impl<'a> !Sync for ItemScope<'a>
impl<'a> Unpin for ItemScope<'a>
impl<'a> !UnwindSafe for ItemScope<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more