LangTypeScript

Struct LangTypeScript 

Source
pub struct LangTypeScript {}
Expand description

Language Struct Definition

Implementations§

Source§

impl LangTypeScript

Language Constants

Source

pub const Text_function: u16 = 50u16

Source

pub const Text_class: u16 = 48u16

Source

pub const Text_interface: u16 = 145u16

Source

pub const Text_type: u16 = 6u16

Source

pub const Text_const: u16 = 20u16

Source

pub const Text_let: u16 = 19u16

Source

pub const Text_var: u16 = 18u16

Source

pub const Text_enum: u16 = 146u16

Source

pub const Text_import: u16 = 14u16

Source

pub const Text_export: u16 = 3u16

Source

pub const Text_from: u16 = 15u16

Source

pub const Text_extends: u16 = 142u16

Source

pub const Text_implements: u16 = 143u16

Source

pub const Text_return: u16 = 38u16

Source

pub const Text_async: u16 = 49u16

Source

pub const Text_await: u16 = 29u16

Source

pub const Text_LPAREN: u16 = 26u16

Source

pub const Text_RPAREN: u16 = 28u16

Source

pub const Text_LBRACE: u16 = 10u16

Source

pub const Text_RBRACE: u16 = 12u16

Source

pub const Text_LBRACKET: u16 = 45u16

Source

pub const Text_RBRACKET: u16 = 46u16

Source

pub const Text_SEMI: u16 = 27u16

Source

pub const Text_COLON: u16 = 40u16

Source

pub const Text_COMMA: u16 = 11u16

Source

pub const Text_DOT: u16 = 47u16

Source

pub const Text_ARROW: u16 = 51u16

Source

pub const Text_EQ: u16 = 7u16

Source

pub const Text_QUESTION: u16 = 125u16

Source

pub const Text_LT: u16 = 84u16

Source

pub const Text_GT: u16 = 91u16

Source

pub const program: u16 = 166u16

Source

pub const internal_module: u16 = 284u16

Source

pub const module: u16 = 283u16

Source

pub const class_declaration: u16 = 221u16

Source

pub const abstract_class_declaration: u16 = 282u16

Source

pub const class: u16 = 220u16

Source

pub const class_body: u16 = 256u16

Source

pub const interface_declaration: u16 = 288u16

Source

pub const interface_body: u16 = 376u16

Source

pub const type_alias_declaration: u16 = 293u16

Source

pub const enum_declaration: u16 = 290u16

Source

pub const enum_body: u16 = 291u16

Source

pub const enum_assignment: u16 = 292u16

Source

pub const function_declaration: u16 = 224u16

Source

pub const generator_function_declaration: u16 = 226u16

Source

pub const function_expression: u16 = 223u16

Source

pub const arrow_function: u16 = 227u16

Source

pub const generator_function: u16 = 225u16

Source

pub const function_signature: u16 = 271u16

Source

pub const method_definition: u16 = 261u16

Source

pub const method_signature: u16 = 269u16

Source

pub const abstract_method_signature: u16 = 270u16

Source

pub const call_signature: u16 = 338u16

Source

pub const construct_signature: u16 = 344u16

Source

pub const public_field_definition: u16 = 266u16

Source

pub const property_signature: u16 = 339u16

Source

pub const formal_parameters: u16 = 257u16

Source

pub const required_parameter: u16 = 296u16

Source

pub const optional_parameter: u16 = 297u16

Source

pub const rest_pattern: u16 = 260u16

Source

pub const variable_declaration: u16 = 183u16

Source

pub const lexical_declaration: u16 = 184u16

Source

pub const variable_declarator: u16 = 185u16

Source

pub const statement_block: u16 = 186u16

Source

pub const return_statement: u16 = 200u16

Source

pub const if_statement: u16 = 188u16

Source

pub const for_statement: u16 = 190u16

Source

pub const for_in_statement: u16 = 191u16

Source

pub const while_statement: u16 = 193u16

Source

pub const switch_statement: u16 = 189u16

Source

pub const try_statement: u16 = 195u16

Source

pub const catch_clause: u16 = 207u16

Source

pub const call_expression: u16 = 231u16

Source

pub const new_expression: u16 = 232u16

Source

pub const member_expression: u16 = 234u16

Source

pub const subscript_expression: u16 = 235u16

Source

pub const assignment_expression: u16 = 236u16

Source

pub const binary_expression: u16 = 243u16

Source

pub const unary_expression: u16 = 244u16

Source

pub const ternary_expression: u16 = 242u16

Source

pub const await_expression: u16 = 233u16

Source

pub const as_expression: u16 = 274u16

Source

pub const satisfies_expression: u16 = 275u16

Source

pub const type_assertion: u16 = 273u16

Source

pub const identifier: u16 = 1u16

Source

pub const type_identifier: u16 = 382u16

Source

pub const nested_type_identifier: u16 = 287u16

Source

pub const nested_identifier: u16 = 219u16

Source

pub const property_identifier: u16 = 377u16

Source

pub const shorthand_property_identifier: u16 = 378u16

Source

pub const shorthand_property_identifier_pattern: u16 = 379u16

Source

pub const private_property_identifier: u16 = 111u16

Source

pub const string: u16 = 247u16

Source

pub const number: u16 = 110u16

Source

pub const template_string: u16 = 248u16

Source

pub const regex: u16 = 250u16

Source

pub const type_annotation: u16 = 302u16

Source

pub const type_arguments: u16 = 336u16

Source

pub const type_parameters: u16 = 340u16

Source

pub const type_parameter: u16 = 341u16

Source

pub const constraint: u16 = 343u16

Source

pub const default_type: u16 = 342u16

Source

pub const union_type: u16 = 349u16

Source

pub const intersection_type: u16 = 350u16

Source

pub const function_type: u16 = 351u16

Source

pub const array_type: u16 = 346u16

Source

pub const tuple_type: u16 = 347u16

Source

pub const generic_type: u16 = 319u16

Source

pub const object_type: u16 = 337u16

Source

pub const predefined_type: u16 = 335u16

Source

pub const literal_type: u16 = 330u16

Source

pub const conditional_type: u16 = 318u16

Source

pub const mapped_type: u16 = 0u16

Source

pub const indexed_access_type: u16 = 0u16

Source

pub const infer_type: u16 = 317u16

Source

pub const constructor_type: u16 = 313u16

Source

pub const this_type: u16 = 381u16

Source

pub const object_pattern: u16 = 214u16

Source

pub const array_pattern: u16 = 218u16

Source

pub const assignment_pattern: u16 = 215u16

Source

pub const pair_pattern: u16 = 263u16

Source

pub const object_assignment_pattern: u16 = 216u16

Source

pub const import_statement: u16 = 174u16

Source

pub const import_clause: u16 = 175u16

Source

pub const named_imports: u16 = 178u16

Source

pub const import_specifier: u16 = 179u16

Source

pub const namespace_import: u16 = 177u16

Source

pub const export_statement: u16 = 167u16

Source

pub const export_clause: u16 = 169u16

Source

pub const export_specifier: u16 = 170u16

Source

pub const ambient_declaration: u16 = 281u16

Source

pub const decorator: u16 = 253u16

Source

pub const class_heritage: u16 = 222u16

Source

pub const extends_clause: u16 = 278u16

Source

pub const extends_type_clause: u16 = 289u16

Source

pub const implements_clause: u16 = 280u16

Source

pub const accessibility_modifier: u16 = 294u16

Source

pub const override_modifier: u16 = 295u16

Source

pub const readonly_type: u16 = 348u16

Source

pub const object: u16 = 213u16

Source

pub const array: u16 = 217u16

Source

pub const pair: u16 = 262u16

Source

pub const spread_element: u16 = 241u16

Source

pub const comment: u16 = 104u16

Source

pub const field_name: u16 = 25u16

Source

pub const field_body: u16 = 5u16

Source

pub const field_type: u16 = 37u16

Source

pub const field_value: u16 = 40u16

Source

pub const field_parameters: u16 = 30u16

Source

pub const field_return_type: u16 = 33u16

Source

pub const field_type_parameters: u16 = 39u16

Source

pub const field_type_arguments: u16 = 38u16

Source

pub const field_constraint: u16 = 8u16

Source

pub const field_source: u16 = 36u16

Source

pub const field_alias: u16 = 1u16

Source

pub const field_declaration: u16 = 10u16

Source

pub const field_left: u16 = 23u16

Source

pub const field_right: u16 = 34u16

Source

pub const field_object: u16 = 26u16

Source

pub const field_property: u16 = 32u16

Source

pub const field_function: u16 = 14u16

Source

pub const field_arguments: u16 = 4u16

Source

pub const field_pattern: u16 = 31u16

Source

pub const field_condition: u16 = 6u16

Source

pub const field_consequence: u16 = 7u16

Source

pub const field_alternative: u16 = 2u16

Source

pub const field_index: u16 = 17u16

Source

pub const field_key: u16 = 20u16

Source

pub const field_decorator: u16 = 11u16

Source

pub const field_module: u16 = 24u16

Source

pub const field_constructor: u16 = 9u16

Source

pub const field_trait: u16 = 37u16

Source

pub fn new() -> Self

Create a new Language instance

Trait Implementations§

Source§

impl Debug for LangTypeScript

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl LanguageTrait for LangTypeScript

Language Trait Implementation

Source§

fn parse(text: impl AsRef<[u8]>) -> Option<Box<dyn ParseTree>>

Parse source code and return a generic parse tree.

First tries the custom parse_impl from LanguageTraitImpl. If that returns None, falls back to tree-sitter parsing if available.

Source§

fn supported_extensions() -> &'static [&'static str]

Return the list of supported file extensions for this language

Source§

fn hir_kind(kind_id: u16) -> HirKind

Get the HIR kind for a given token ID

Source§

fn block_kind(kind_id: u16) -> BlockKind

Get the Block kind for a given token ID

Source§

fn block_kind_with_parent( kind_id: u16, field_id: u16, parent_kind_id: u16, ) -> BlockKind

Get the Block kind for a given token ID with parent context

Source§

fn is_test_attribute(node: &dyn ParseNode, source: &[u8]) -> bool

Check if a parse node is a test attribute that should cause the next item to be skipped

Source§

fn token_str(kind_id: u16) -> Option<&'static str>

Get the string representation of a token ID

Source§

fn is_valid_token(kind_id: u16) -> bool

Check if a token ID is valid

Source§

fn manifest_name() -> &'static str

Get the manifest file name for this language (e.g., “Cargo.toml”, “package.json”).
Source§

fn container_dirs() -> &'static [&'static str]

Get the container directories that don’t add semantic meaning. These directories are skipped in module detection (e.g., “src”, “lib”).
Source§

fn collect_init<'tcx>(cc: &'tcx CompileCtxt<'tcx>) -> ScopeStack<'tcx>

Source§

fn collect_symbols<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, scope_stack: ScopeStack<'tcx>, config: &C, ) -> &'tcx Scope<'tcx>

TOOD: can we remove the generics here, we could make a new crate or bring llmcc-resolver into core to solve the cross dependency
Source§

fn bind_symbols<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, globals: &'tcx Scope<'tcx>, config: &C, )

Source§

fn name_field() -> u16

Get the field ID that represents the “name” of a construct.
Source§

fn type_field() -> u16

Get the field ID that represents the “type” of a construct.
Source§

fn trait_field() -> u16

Get the field ID that represents the “trait” in impl blocks. Used for impl Trait for Type { } to identify the trait being implemented.
Source§

fn is_container(name: &str) -> bool

Check if a directory name is a container directory.
Source§

impl LanguageTraitImpl for LangTypeScript

Source§

fn block_kind_with_parent_impl( kind_id: u16, field_id: u16, _parent_kind_id: u16, ) -> BlockKind

Block kind with parent context - handles special TypeScript cases

Source§

fn is_test_attribute_impl(node: &dyn ParseNode, source: &[u8]) -> bool

Check if the given parse node is a TypeScript test attribute. Detects: @test, describe(), it(), test(), etc.

Source§

fn collect_init_impl<'tcx>(cc: &'tcx CompileCtxt<'tcx>) -> ScopeStack<'tcx>

Source§

fn parse_impl(text: impl AsRef<[u8]>) -> Option<Box<dyn ParseTree>>

Custom parse implementation for this language.
Source§

fn supported_extensions_impl() -> &'static [&'static str]

Supported file extensions for this language.
Source§

fn manifest_name_impl() -> &'static str

The manifest file name for this language (e.g., “Cargo.toml”, “package.json”).
Source§

fn container_dirs_impl() -> &'static [&'static str]

Container directories that don’t add semantic meaning (e.g., “src”, “lib”).
Source§

fn collect_symbols_impl<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, scope_stack: ScopeStack<'tcx>, config: &C, ) -> &'tcx Scope<'tcx>

Source§

fn bind_symbols_impl<'tcx, C>( unit: CompileUnit<'tcx>, node: HirNode<'tcx>, globals: &'tcx Scope<'tcx>, config: &C, )

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more