pub struct TypeScriptParser { /* private fields */ }Expand description
TypeScript/JavaScript language parser implementing the CodeParser trait
Implementations§
Source§impl TypeScriptParser
impl TypeScriptParser
Sourcepub fn with_config(config: ParserConfig) -> Self
pub fn with_config(config: ParserConfig) -> Self
Create a new TypeScript parser with custom configuration
Trait Implementations§
Source§impl CodeParser for TypeScriptParser
impl CodeParser for TypeScriptParser
Source§fn language(&self) -> &str
fn language(&self) -> &str
Returns the language identifier (lowercase, e.g., “python”, “rust”)
Source§fn file_extensions(&self) -> &[&str]
fn file_extensions(&self) -> &[&str]
Returns supported file extensions (e.g., [“.py”, “.pyw”])
Source§fn parse_file(
&self,
path: &Path,
graph: &mut CodeGraph,
) -> Result<FileInfo, ParserError>
fn parse_file( &self, path: &Path, graph: &mut CodeGraph, ) -> Result<FileInfo, ParserError>
Parse a single file and insert entities/relationships into the graph Read more
Source§fn parse_source(
&self,
source: &str,
file_path: &Path,
graph: &mut CodeGraph,
) -> Result<FileInfo, ParserError>
fn parse_source( &self, source: &str, file_path: &Path, graph: &mut CodeGraph, ) -> Result<FileInfo, ParserError>
Parse source code string and insert into graph Read more
Source§fn config(&self) -> &ParserConfig
fn config(&self) -> &ParserConfig
Get parser configuration
Source§fn metrics(&self) -> ParserMetrics
fn metrics(&self) -> ParserMetrics
Get accumulated metrics Read more
Source§fn reset_metrics(&mut self)
fn reset_metrics(&mut self)
Reset metrics Read more
Source§fn parse_files(
&self,
paths: &[PathBuf],
graph: &mut CodeGraph,
) -> Result<ProjectInfo, ParserError>
fn parse_files( &self, paths: &[PathBuf], graph: &mut CodeGraph, ) -> Result<ProjectInfo, ParserError>
Parse multiple files (can be overridden for parallel parsing) Read more
Source§fn parse_directory(
&self,
dir: &Path,
graph: &mut CodeGraph,
) -> Result<ProjectInfo, ParserError>
fn parse_directory( &self, dir: &Path, graph: &mut CodeGraph, ) -> Result<ProjectInfo, ParserError>
Parse a directory recursively Read more
Source§fn discover_files(&self, dir: &Path) -> Result<Vec<PathBuf>, ParserError>
fn discover_files(&self, dir: &Path) -> Result<Vec<PathBuf>, ParserError>
Discover parseable files in a directory Read more
Auto Trait Implementations§
impl !Freeze for TypeScriptParser
impl RefUnwindSafe for TypeScriptParser
impl Send for TypeScriptParser
impl Sync for TypeScriptParser
impl Unpin for TypeScriptParser
impl UnwindSafe for TypeScriptParser
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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