Skip to main content

Crate oxc_span

Crate oxc_span 

Source
Expand description

Source positions and related helper functions.

https://doc.rust-lang.org/beta/nightly-rustc/rustc_span

Structs§

SourceType
Source Type for JavaScript vs TypeScript / Script vs Module / JSX
Span
A range in text, represented by a zero-indexed start and end offset.
UnknownExtension
Error returned by SourceType::from_path and SourceType::from_extension when the file extension is not found or recognized.

Enums§

FileExtension
Valid file extension.
Language
JavaScript or TypeScript
LanguageVariant
JSX for JavaScript and TypeScript
ModuleKind
Script or Module

Constants§

SPAN
An empty span.
VALID_EXTENSIONS
Valid file extensions.

Traits§

ContentEq
This trait works similarly to PartialEq but it gives the liberty of checking the equality of the content loosely.
GetSpan
Get the span for an AST node.
GetSpanMut
Get mutable ref to span for an AST node.

Functions§

best_match
Returns the closest candidate to needle within threshold, or None.
min_edit_distance
Returns the Levenshtein edit distance between a and b.