Enum ImportLanguage
pub enum ImportLanguage {
Rust,
Python,
Java,
JavaScript,
TypeScript,
Tsx,
}Expand description
Tier-1 languages CodeLore extracts import edges from.
Variants§
Implementations§
§impl ImportLanguage
impl ImportLanguage
pub fn from_path(path: &Path) -> Option<Self>
pub fn from_path(path: &Path) -> Option<Self>
Map a file extension to its ImportLanguage. Returns None
for non-Tier-1 files (the import pass silently skips them).
pub fn language(self) -> Language
pub fn language(self) -> Language
Build a tree-sitter Language for this ImportLanguage. Uses
the exact-pinned grammar crates the rest of the workspace
already loads (parser-ABI compatible with both the complexity
pass and the clones pass).
pub fn import_node_kinds(self) -> &'static [&'static str]
pub fn import_node_kinds(self) -> &'static [&'static str]
Tree-sitter node-kind names that mark an import statement.
Walker hits any node whose kind() is in this set and records
the import edge from its raw source text.
Verified against each grammar’s grammar.js for the pinned
versions in workspace Cargo.toml (tree-sitter-* = "=0.23.x"):
- Rust:
use_declaration - Python:
import_statement(bare) +import_from_statement(from-style) - Java:
import_declaration - JS/TS:
import_statement(default / named / namespace / side-effect /import x = require(…)),export_statement(re-exports:export … from), andcall_expression(dynamicimport(…)andCommonJSrequire(…)). The extractor filters call expressions down to the two callee shapes that name a module.
Trait Implementations§
§impl Clone for ImportLanguage
impl Clone for ImportLanguage
§fn clone(&self) -> ImportLanguage
fn clone(&self) -> ImportLanguage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ImportLanguage
§impl Debug for ImportLanguage
impl Debug for ImportLanguage
impl Eq for ImportLanguage
§impl Hash for ImportLanguage
impl Hash for ImportLanguage
§impl PartialEq for ImportLanguage
impl PartialEq for ImportLanguage
impl StructuralPartialEq for ImportLanguage
Auto Trait Implementations§
impl Freeze for ImportLanguage
impl RefUnwindSafe for ImportLanguage
impl Send for ImportLanguage
impl Sync for ImportLanguage
impl Unpin for ImportLanguage
impl UnsafeUnpin for ImportLanguage
impl UnwindSafe for ImportLanguage
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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