TypeScriptLanguage

Struct TypeScriptLanguage 

Source
pub struct TypeScriptLanguage {
    pub jsx: bool,
    pub decorators: bool,
    pub strict: bool,
    pub target: EcmaVersion,
    pub experimental: bool,
}
Expand description

TypeScript 语言配置

Fields§

§jsx: bool

是否支持 JSX 语法

§decorators: bool

是否支持装饰器

§strict: bool

是否启用严格模式

§target: EcmaVersion

目标 ECMAScript 版本

§experimental: bool

是否允许实验性语法

Implementations§

Source§

impl TypeScriptLanguage

Source

pub fn standard() -> Self

创建标准 TypeScript 配置

Source

pub fn with_jsx() -> Self

创建支持 JSX TypeScript 配置

Source

pub fn with_decorators() -> Self

创建支持装饰器的 TypeScript 配置

Source

pub fn strict() -> Self

创建严格模式TypeScript 配置

Source

pub fn experimental() -> Self

创建实验性语法的 TypeScript 配置

Trait Implementations§

Source§

impl Language for TypeScriptLanguage

Source§

type SyntaxKind = TypeScriptSyntaxKind

The kind kind type used to represent different kind and node types in the language. Read more
Source§

type TypedRoot = TypeScriptRoot

The root type for the parsed tree that represents the top-level structure of the language. Read more
Source§

impl<'config> Lexer<TypeScriptLanguage> for TypeScriptLexer<'config>

Source§

fn lex_incremental( &self, source: impl Source, changed: usize, cache: IncrementalCache<'_, TypeScriptLanguage>, ) -> LexOutput<TypeScriptLanguage>

Tokenizes source text using an existing cache for incremental parsing. Read more
Source§

fn lex( &self, source: impl Source, ) -> OakDiagnostics<Vec<Token<<L as Language>::SyntaxKind>>>

Tokenizes the given source text into a sequence of tokens. Read more

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, 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, 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> ErasedDestructor for T
where T: 'static,