pub struct JavaScriptPlugin {
pub language: SupportedLanguage,
}Expand description
JavaScript or TypeScript import extraction and resolution.
Fields§
§language: SupportedLanguageSelects the grammar used during extraction.
Trait Implementations§
Source§impl Clone for JavaScriptPlugin
impl Clone for JavaScriptPlugin
impl Copy for JavaScriptPlugin
Source§impl Debug for JavaScriptPlugin
impl Debug for JavaScriptPlugin
Source§impl ImportPlugin for JavaScriptPlugin
impl ImportPlugin for JavaScriptPlugin
Source§fn extract_from_node(
&self,
source: &[u8],
node: &Node<'_>,
) -> Option<Vec<ImportStatement>>
fn extract_from_node( &self, source: &[u8], node: &Node<'_>, ) -> Option<Vec<ImportStatement>>
Read whatever this node says about imports, if it says anything. Read more
Source§fn child_depth_step(&self, _node: &Node<'_>) -> u8
fn child_depth_step(&self, _node: &Node<'_>) -> u8
How much deeper references inside this node’s children sit. Read more
Source§fn is_cfg_gated(&self, _source: &[u8], _node: &Node<'_>) -> bool
fn is_cfg_gated(&self, _source: &[u8], _node: &Node<'_>) -> bool
Whether this reference only exists when a feature flag is on. Read more
Source§fn collect_declarations(
&self,
_source: &[u8],
_tree: &Tree,
) -> Option<DeclaredNames>
fn collect_declarations( &self, _source: &[u8], _tree: &Tree, ) -> Option<DeclaredNames>
Names this source declares, when the language needs a lookup by name. Read more
Source§impl ResolverPlugin for JavaScriptPlugin
impl ResolverPlugin for JavaScriptPlugin
Source§fn resolve(
&self,
import_path: &str,
context: ResolveContext<'_>,
) -> Option<String>
fn resolve( &self, import_path: &str, context: ResolveContext<'_>, ) -> Option<String>
Turn an import path into a project-relative file path.
Source§fn names_a_known_module(
&self,
_name: &str,
_context: ResolveContext<'_>,
) -> bool
fn names_a_known_module( &self, _name: &str, _context: ResolveContext<'_>, ) -> bool
Whether
name names a module this analysis can see. Read moreSource§fn leaves_project(&self, _name: &str, _context: ResolveContext<'_>) -> bool
fn leaves_project(&self, _name: &str, _context: ResolveContext<'_>) -> bool
Whether a path that names
name provably leaves the project. Read moreAuto Trait Implementations§
impl Freeze for JavaScriptPlugin
impl RefUnwindSafe for JavaScriptPlugin
impl Send for JavaScriptPlugin
impl Sync for JavaScriptPlugin
impl Unpin for JavaScriptPlugin
impl UnsafeUnpin for JavaScriptPlugin
impl UnwindSafe for JavaScriptPlugin
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