pub struct RubyStructuralSpec;Trait Implementations§
Source§impl Debug for RubyStructuralSpec
impl Debug for RubyStructuralSpec
Source§impl Default for RubyStructuralSpec
impl Default for RubyStructuralSpec
Source§fn default() -> RubyStructuralSpec
fn default() -> RubyStructuralSpec
Returns the “default value” for a type. Read more
Source§impl StructuralSpec for RubyStructuralSpec
impl StructuralSpec for RubyStructuralSpec
Source§fn call_site_context(&self, root: Node<'_>, source: &str) -> CallSiteContext
fn call_site_context(&self, root: Node<'_>, source: &str) -> CallSiteContext
One scan of the file for the identifiers that are value-position bare
calls: whether x reads a local or calls a method depends on the
assignments and parameters lexically before it, which refine_kind
cannot see per node.
Source§fn occurrence_role_support(&self) -> &OccurrenceRoleSupport
fn occurrence_role_support(&self) -> &OccurrenceRoleSupport
Ruby has not learned occurrence-role classification yet (#1473). The empty table is the honest answer: queries and assertions that ask for an occurrence role here report incomplete rather than clean-empty.
fn language(&self) -> Language
Source§fn kind_table(&self) -> &'static [(&'static str, NormalizedKind)]
fn kind_table(&self) -> &'static [(&'static str, NormalizedKind)]
Grammar-specific node-type name → normalized kind. Compiled once per
extraction into an id-indexed lookup via
Language::id_for_node_kind;
a per-language test must assert every entry resolves (id != 0) so
grammar bumps that rename nodes fail loudly.Source§fn refine_kind(
&self,
node: Node<'_>,
kind: NormalizedKind,
enclosing: Option<NormalizedKind>,
source: &str,
context: &CallSiteContext,
) -> NormalizedKind
fn refine_kind( &self, node: Node<'_>, kind: NormalizedKind, enclosing: Option<NormalizedKind>, source: &str, context: &CallSiteContext, ) -> NormalizedKind
Context-sensitive refinement applied after table lookup.
enclosing
is the kind of the nearest enclosing normalized node, and context is
the per-file CallSiteContext from Self::call_site_context, for
refinements that depend on file-wide facts (Ruby’s value-position bare
calls).Source§fn should_extract(&self, node: Node<'_>, kind: NormalizedKind) -> bool
fn should_extract(&self, node: Node<'_>, kind: NormalizedKind) -> bool
Whether this normalized node should become a fact at all. Use this for
grammar nodes whose normalized kind is conditional on fields, such as
variable declarators that are assignments only when they have values.
Source§fn supports_kind(&self, kind: NormalizedKind) -> bool
fn supports_kind(&self, kind: NormalizedKind) -> bool
Whether this adapter can produce facts satisfying
kind.Source§fn supports_role(&self, role: Role) -> bool
fn supports_role(&self, role: Role) -> bool
Whether this adapter can model
role precisely enough to evaluate a
query that asks for it.Source§fn lexical_environment_support(&self) -> &LexicalEnvironmentSupport
fn lexical_environment_support(&self) -> &LexicalEnvironmentSupport
Which parts of a file’s lexical environment this adapter answers:
its scope tree, the interval each binding is in effect over, the local
names its imports introduce, its package clause, and what its resolver
reports about the candidates it considered. Read more
Source§fn materialization_support(&self) -> &DeclarationMaterializationSupport
fn materialization_support(&self) -> &DeclarationMaterializationSupport
Which parts of a file’s declaration-materialization story this adapter
answers: the origin and state of its declarations, its generation
sites and their generated sets, its export declarations, the link from
a declaration-only signature to its implementation, and which
declarations are gated by a preprocessing configuration. Read more
Source§fn reference_edge_support(&self) -> &ReferenceEdgeSupport
fn reference_edge_support(&self) -> &ReferenceEdgeSupport
Which parts of the reference-edge domain this adapter answers: whether
forward (site-to-target) and inverse (target-to-site) edge projections
exist for it, and which classification axes those edges carry. Read more
Source§fn identity_route_support(&self) -> &IdentityRouteSupport
fn identity_route_support(&self) -> &IdentityRouteSupport
Which parts of the identity/route surface this adapter answers: whether
it can group and decode qualified paths, resolve segment prefixes,
project canonical identities, group physical occurrences, and which
indirection relations it supplies route edges for.
Self::occurrence_role_support: the tables are total, so a default
would let a new adapter (or a new axis or relation) advertise support
nobody implemented. Adapters that answer nothing yet return
super::routes::NO_IDENTITY_ROUTE_SUPPORT.Source§fn extract(&self, node: Node<'_>, kind: NormalizedKind, sink: &mut RoleSink<'_>)
fn extract(&self, node: Node<'_>, kind: NormalizedKind, sink: &mut RoleSink<'_>)
Attach the fact’s name and role edges by reading AST fields of
node.Source§fn generator_construct(
&self,
_node: Node<'_>,
_kind: NormalizedKind,
) -> Option<&'static str>
fn generator_construct( &self, _node: Node<'_>, _kind: NormalizedKind, ) -> Option<&'static str>
A grammar-backed construct label for semantic generator rules. Read more
Source§fn call_site_facts(
&self,
_node: Node<'_>,
_source: &str,
_context: &CallSiteContext,
) -> Option<CallSiteFacts>
fn call_site_facts( &self, _node: Node<'_>, _source: &str, _context: &CallSiteContext, ) -> Option<CallSiteFacts>
What this adapter’s grammar says about the call site at
node, whose
normalized kind is NormalizedKind::Call. Read moreSource§fn binding_activation(
&self,
_binder: Node<'_>,
_scope: Range,
) -> Option<BindingActivation>
fn binding_activation( &self, _binder: Node<'_>, _scope: Range, ) -> Option<BindingActivation>
What binding
binder introduces into the scope whose range is scope,
and over which byte interval it is in effect. Read moreSource§fn occurrence_namespace(
&self,
role: OccurrenceRole,
declares: Option<NormalizedKind>,
) -> Option<Namespace>
fn occurrence_namespace( &self, role: OccurrenceRole, declares: Option<NormalizedKind>, ) -> Option<Namespace>
The namespace an occurrence of
role resolves in, where declares is
the normalized kind of the fact this token names – the enclosing fact
whose own name span is exactly this token, and None when the token
names no fact. Read moreSource§fn indirection_relation(&self, _token: Node<'_>) -> Option<RouteHopKind>
fn indirection_relation(&self, _token: Node<'_>) -> Option<RouteHopKind>
The indirection relation an import/export token participates in:
Import for a plain import, Export for an export of a local
declaration, ReExport for an export whose subject comes from
elsewhere (pub use, export ... from). Read from the token’s
enclosing statement through AST fields. Read moreSource§fn qualified_path_root<'tree>(&self, _token: Node<'tree>) -> Option<Node<'tree>>
fn qualified_path_root<'tree>(&self, _token: Node<'tree>) -> Option<Node<'tree>>
The root node of the qualified-path chain
token participates in: the
outermost chain node (a scoped_identifier, dotted_name,
nested_identifier, or language equivalent) whose ordered segments
include this token. None when the token is not part of a qualified
path — including when it is a bare single identifier, which is not a
path. Read moreSource§fn path_segment_tokens<'tree>(&self, _root: Node<'tree>) -> Vec<Node<'tree>>
fn path_segment_tokens<'tree>(&self, _root: Node<'tree>) -> Vec<Node<'tree>>
Every segment token of the qualified-path chain rooted at
root, in
source order, read from the grammar’s own chain structure (AST fields,
never text splitting). Includes segment tokens that are not facts
(Rust’s crate/self/super path keywords), so ordinals state the
real position of each segment within the path. Read moreSource§fn segment_generic_arity(&self, _token: Node<'_>) -> Option<u32>
fn segment_generic_arity(&self, _token: Node<'_>) -> Option<u32>
The number of generic (type) arguments the source spells at
token’s
segment position, read from the grammar’s argument-list field. None
means no generic arguments are spelled there — which is a statement
about the source text, not about the declaration’s own arity.Source§fn decode_spelling(&self, _raw: &str) -> Option<String>
fn decode_spelling(&self, _raw: &str) -> Option<String>
The spelling
raw denotes once the grammar’s identifier escaping is
removed (Rust’s r#type is the identifier type). Read moreSource§fn embedded_leaf_facts(
&self,
_node: Node<'_>,
_kind: NormalizedKind,
_source: &str,
_cancellation: Option<&CancellationToken>,
) -> Vec<EmbeddedLeafFact>
fn embedded_leaf_facts( &self, _node: Node<'_>, _kind: NormalizedKind, _source: &str, _cancellation: Option<&CancellationToken>, ) -> Vec<EmbeddedLeafFact>
Parse source-backed leaf facts hidden inside an otherwise opaque node. Read more
Auto Trait Implementations§
impl Freeze for RubyStructuralSpec
impl RefUnwindSafe for RubyStructuralSpec
impl Send for RubyStructuralSpec
impl Sync for RubyStructuralSpec
impl Unpin for RubyStructuralSpec
impl UnsafeUnpin for RubyStructuralSpec
impl UnwindSafe for RubyStructuralSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more