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
impl TypeScriptLanguage
Sourcepub fn with_decorators() -> Self
pub fn with_decorators() -> Self
创建支持装饰器的 TypeScript 配置
Sourcepub fn experimental() -> Self
pub fn experimental() -> Self
创建实验性语法的 TypeScript 配置
Trait Implementations§
Source§impl<'config> Builder<TypeScriptLanguage> for TypeScriptBuilder<'config>
impl<'config> Builder<TypeScriptLanguage> for TypeScriptBuilder<'config>
Source§fn build<'a, S: Source + ?Sized>(
&self,
source: &'a S,
edits: &[TextEdit],
_cache: &'a mut impl BuilderCache<TypeScriptLanguage>,
) -> OakDiagnostics<TypeScriptRoot>
fn build<'a, S: Source + ?Sized>( &self, source: &'a S, edits: &[TextEdit], _cache: &'a mut impl BuilderCache<TypeScriptLanguage>, ) -> OakDiagnostics<TypeScriptRoot>
Builds the structure from the source text.
Source§impl Language for TypeScriptLanguage
impl Language for TypeScriptLanguage
Source§const CATEGORY: LanguageCategory = LanguageCategory::Programming
const CATEGORY: LanguageCategory = LanguageCategory::Programming
The category of the language.
Source§type TokenType = TypeScriptSyntaxKind
type TokenType = TypeScriptSyntaxKind
The token type used to represent different token and node types in the language. Read more
Source§type ElementType = TypeScriptSyntaxKind
type ElementType = TypeScriptSyntaxKind
The element type used to represent composite structures in the parsed tree. Read more
Source§type TypedRoot = TypeScriptRoot
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>
impl<'config> Lexer<TypeScriptLanguage> for TypeScriptLexer<'config>
Source§fn lex<'a, S: Source + ?Sized>(
&self,
text: &S,
_edits: &[TextEdit],
cache: &'a mut impl LexerCache<TypeScriptLanguage>,
) -> LexOutput<TypeScriptLanguage>
fn lex<'a, S: Source + ?Sized>( &self, text: &S, _edits: &[TextEdit], cache: &'a mut impl LexerCache<TypeScriptLanguage>, ) -> LexOutput<TypeScriptLanguage>
Tokenizes the given source text into a sequence of tokens. Read more
Source§impl<'config> Parser<TypeScriptLanguage> for TypeScriptParser<'config>
impl<'config> Parser<TypeScriptLanguage> for TypeScriptParser<'config>
Source§fn parse<'a, S: Source + ?Sized>(
&self,
text: &'a S,
edits: &[TextEdit],
cache: &'a mut impl ParseCache<TypeScriptLanguage>,
) -> ParseOutput<'a, TypeScriptLanguage>
fn parse<'a, S: Source + ?Sized>( &self, text: &'a S, edits: &[TextEdit], cache: &'a mut impl ParseCache<TypeScriptLanguage>, ) -> ParseOutput<'a, TypeScriptLanguage>
The core parsing entry point. Read more
Source§impl<'config> Pratt<TypeScriptLanguage> for TypeScriptParser<'config>
impl<'config> Pratt<TypeScriptLanguage> for TypeScriptParser<'config>
Source§fn primary<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, TypeScriptLanguage, S>,
) -> &'a GreenNode<'a, TypeScriptLanguage>
fn primary<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, TypeScriptLanguage, S>, ) -> &'a GreenNode<'a, TypeScriptLanguage>
Parses a primary expression (e.g., literals, identifiers, group).
Source§fn prefix<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, TypeScriptLanguage, S>,
) -> &'a GreenNode<'a, TypeScriptLanguage>
fn prefix<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, TypeScriptLanguage, S>, ) -> &'a GreenNode<'a, TypeScriptLanguage>
Handles prefix operators and primary expressions. Read more
Source§fn infix<'a, S: Source + ?Sized>(
&self,
state: &mut ParserState<'a, TypeScriptLanguage, S>,
left: &'a GreenNode<'a, TypeScriptLanguage>,
min_precedence: u8,
) -> Option<&'a GreenNode<'a, TypeScriptLanguage>>
fn infix<'a, S: Source + ?Sized>( &self, state: &mut ParserState<'a, TypeScriptLanguage, S>, left: &'a GreenNode<'a, TypeScriptLanguage>, min_precedence: u8, ) -> Option<&'a GreenNode<'a, TypeScriptLanguage>>
Handles infix and postfix operators. Read more
Auto Trait Implementations§
impl Freeze for TypeScriptLanguage
impl RefUnwindSafe for TypeScriptLanguage
impl Send for TypeScriptLanguage
impl Sync for TypeScriptLanguage
impl Unpin for TypeScriptLanguage
impl UnwindSafe for TypeScriptLanguage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more