Expand description
Source positions and related helper functions.
Structs§
- Source
Type - Source Type for JavaScript vs TypeScript / Script vs Module / JSX
- Span
- A range in text, represented by a zero-indexed start and end offset.
- Unknown
Extension - Error returned by
SourceType::from_pathandSourceType::from_extensionwhen the file extension is not found or recognized.
Enums§
- File
Extension - Valid file extension.
- Language
- JavaScript or TypeScript
- Language
Variant - JSX for JavaScript and TypeScript
- Module
Kind - Script or Module
Constants§
- SPAN
- An empty span.
- VALID_
EXTENSIONS - Valid file extensions.
Traits§
- Content
Eq - 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.
- GetSpan
Mut - Get mutable ref to span for an AST node.
Functions§
- best_
match - Returns the closest candidate to
needlewithinthreshold, orNone. - min_
edit_ distance - Returns the Levenshtein edit distance between
aandb.