remove ts grammar

This commit is contained in:
tims 2024-12-10 12:54:14 +05:30
parent 0e227a6678
commit e724ad3d1a
10 changed files with 0 additions and 623 deletions

View file

@ -1,5 +0,0 @@
("(" @open ")" @close)
("[" @open "]" @close)
("{" @open "}" @close)
("<" @open ">" @close)
("\"" @open "\"" @close)

View file

@ -1,19 +0,0 @@
name = "TypeScript"
grammar = "typescript"
path_suffixes = ["ts", "cts", "d.cts", "d.mts", "mts"]
first_line_pattern = '^#!.*\b(?:deno run|ts-node|bun|tsx)\b'
line_comments = ["// "]
autoclose_before = ";:.,=}])>"
brackets = [
{ start = "{", end = "}", close = true, newline = true },
{ start = "[", end = "]", close = true, newline = true },
{ start = "(", end = ")", close = true, newline = true },
{ start = "<", end = ">", close = false, newline = true, not_in = ["string", "comment"] },
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] },
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
{ start = "`", end = "`", close = true, newline = false, not_in = ["string"] },
{ start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
]
word_characters = ["#", "$"]
prettier_parser_name = "typescript"
tab_size = 2

View file

@ -1,85 +0,0 @@
(
(comment)* @context
.
[
(export_statement
(function_declaration
"async"? @name
"function" @name
name: (_) @name))
(function_declaration
"async"? @name
"function" @name
name: (_) @name)
] @item
)
(
(comment)* @context
.
[
(export_statement
(class_declaration
"class" @name
name: (_) @name))
(class_declaration
"class" @name
name: (_) @name)
] @item
)
(
(comment)* @context
.
[
(export_statement
(interface_declaration
"interface" @name
name: (_) @name))
(interface_declaration
"interface" @name
name: (_) @name)
] @item
)
(
(comment)* @context
.
[
(export_statement
(enum_declaration
"enum" @name
name: (_) @name))
(enum_declaration
"enum" @name
name: (_) @name)
] @item
)
(
(comment)* @context
.
[
(export_statement
(type_alias_declaration
"type" @name
name: (_) @name))
(type_alias_declaration
"type" @name
name: (_) @name)
] @item
)
(
(comment)* @context
.
(method_definition
[
"get"
"set"
"async"
"*"
"static"
]* @name
name: (_) @name) @item
)

View file

@ -1,242 +0,0 @@
; Variables
(identifier) @variable
; Properties
(property_identifier) @property
(shorthand_property_identifier) @property
(shorthand_property_identifier_pattern) @property
; Function and method calls
(call_expression
function: (identifier) @function)
(call_expression
function: (member_expression
property: (property_identifier) @function.method))
; Function and method definitions
(function_expression
name: (identifier) @function)
(function_declaration
name: (identifier) @function)
(method_definition
name: (property_identifier) @function.method)
(pair
key: (property_identifier) @function.method
value: [(function_expression) (arrow_function)])
(assignment_expression
left: (member_expression
property: (property_identifier) @function.method)
right: [(function_expression) (arrow_function)])
(variable_declarator
name: (identifier) @function
value: [(function_expression) (arrow_function)])
(assignment_expression
left: (identifier) @function
right: [(function_expression) (arrow_function)])
; Special identifiers
((identifier) @constructor
(#match? @constructor "^[A-Z]"))
((identifier) @type
(#match? @type "^[A-Z]"))
(type_identifier) @type
(predefined_type) @type.builtin
([
(identifier)
(shorthand_property_identifier)
(shorthand_property_identifier_pattern)
] @constant
(#match? @constant "^_*[A-Z_][A-Z\\d_]*$"))
; Literals
(this) @variable.special
(super) @variable.special
[
(null)
(undefined)
] @constant.builtin
[
(true)
(false)
] @boolean
(comment) @comment
[
(string)
(template_string)
(template_literal_type)
] @string
(escape_sequence) @string.escape
(regex) @string.regex
(number) @number
; Tokens
[
";"
"?."
"."
","
":"
"?"
] @punctuation.delimiter
[
"..."
"-"
"--"
"-="
"+"
"++"
"+="
"*"
"*="
"**"
"**="
"/"
"/="
"%"
"%="
"<"
"<="
"<<"
"<<="
"="
"=="
"==="
"!"
"!="
"!=="
"=>"
">"
">="
">>"
">>="
">>>"
">>>="
"~"
"^"
"&"
"|"
"^="
"&="
"|="
"&&"
"||"
"??"
"&&="
"||="
"??="
] @operator
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(ternary_expression
[
"?"
":"
] @operator
)
[
"as"
"async"
"await"
"break"
"case"
"catch"
"class"
"const"
"continue"
"debugger"
"default"
"delete"
"do"
"else"
"export"
"extends"
"finally"
"for"
"from"
"function"
"get"
"if"
"import"
"in"
"instanceof"
"is"
"let"
"new"
"of"
"return"
"satisfies"
"set"
"static"
"switch"
"target"
"throw"
"try"
"typeof"
"using"
"var"
"void"
"while"
"with"
"yield"
] @keyword
(template_substitution
"${" @punctuation.special
"}" @punctuation.special) @embedded
(template_type
"${" @punctuation.special
"}" @punctuation.special) @embedded
(type_arguments
"<" @punctuation.bracket
">" @punctuation.bracket)
; Keywords
[ "abstract"
"declare"
"enum"
"export"
"implements"
"infer"
"interface"
"keyof"
"namespace"
"private"
"protected"
"public"
"type"
"readonly"
"override"
] @keyword

View file

@ -1,15 +0,0 @@
[
(call_expression)
(assignment_expression)
(member_expression)
(lexical_declaration)
(variable_declaration)
(assignment_expression)
(if_statement)
(for_statement)
] @indent
(_ "[" "]" @end) @indent
(_ "<" ">" @end) @indent
(_ "{" "}" @end) @indent
(_ "(" ")" @end) @indent

View file

@ -1,64 +0,0 @@
(((comment) @_jsdoc_comment
(#match? @_jsdoc_comment "(?s)^/[*][*][^*].*[*]/$")) @content
(#set! "language" "jsdoc"))
(((comment) @reference
(#match? @reference "^///\\s+<reference\\s+types=\"\\S+\"\\s*/>\\s*$")) @content
(#set! "language" "html"))
((regex) @content
(#set! "language" "regex"))
(call_expression
function: (identifier) @_name (#eq? @_name "css")
arguments: (template_string (string_fragment) @content
(#set! "language" "css"))
)
(call_expression
function: (identifier) @_name (#eq? @_name "html")
arguments: (template_string) @content
(#set! "language" "html")
)
(call_expression
function: (identifier) @_name (#eq? @_name "js")
arguments: (template_string (string_fragment) @content
(#set! "language" "javascript"))
)
(call_expression
function: (identifier) @_name (#eq? @_name "json")
arguments: (template_string (string_fragment) @content
(#set! "language" "json"))
)
(call_expression
function: (identifier) @_name (#eq? @_name "sql")
arguments: (template_string (string_fragment) @content
(#set! "language" "sql"))
)
(call_expression
function: (identifier) @_name (#eq? @_name "ts")
arguments: (template_string (string_fragment) @content
(#set! "language" "typescript"))
)
(call_expression
function: (identifier) @_name (#match? @_name "^ya?ml$")
arguments: (template_string (string_fragment) @content
(#set! "language" "yaml"))
)
(call_expression
function: (identifier) @_name (#match? @_name "^g(raph)?ql$")
arguments: (template_string (string_fragment) @content
(#set! "language" "graphql"))
)
(call_expression
function: (identifier) @_name (#match? @_name "^g(raph)?ql$")
arguments: (arguments (template_string (string_fragment) @content
(#set! "language" "graphql")))
)

View file

@ -1,91 +0,0 @@
(internal_module
"namespace" @context
name: (_) @name) @item
(enum_declaration
"enum" @context
name: (_) @name) @item
(type_alias_declaration
"type" @context
name: (_) @name) @item
(function_declaration
"async"? @context
"function" @context
name: (_) @name
parameters: (formal_parameters
"(" @context
")" @context)) @item
(interface_declaration
"interface" @context
name: (_) @name) @item
(export_statement
(lexical_declaration
["let" "const"] @context
(variable_declarator
name: (_) @name) @item))
(program
(lexical_declaration
["let" "const"] @context
(variable_declarator
name: (_) @name) @item))
(class_declaration
"class" @context
name: (_) @name) @item
(abstract_class_declaration
"abstract" @context
"class" @context
name: (_) @name) @item
(method_definition
[
"get"
"set"
"async"
"*"
"readonly"
"static"
(override_modifier)
(accessibility_modifier)
]* @context
name: (_) @name
parameters: (formal_parameters
"(" @context
")" @context)) @item
(public_field_definition
[
"declare"
"readonly"
"abstract"
"static"
(accessibility_modifier)
]* @context
name: (_) @name) @item
; Add support for (node:test, bun:test and Jest) runnable
(
(call_expression
function: [
(identifier) @_name
(member_expression
object: [
(identifier) @_name
(member_expression object: (identifier) @_name)
]
)
] @context
(#any-of? @_name "it" "test" "describe")
arguments: (
arguments . (string (string_fragment) @name)
)
)
) @item
(comment) @annotation

View file

@ -1,2 +0,0 @@
(comment) @comment.inclusive
(string) @string

View file

@ -1,21 +0,0 @@
; Add support for (node:test, bun:test and Jest) runnable
; Function expression that has `it`, `test` or `describe` as the function name
(
(call_expression
function: [
(identifier) @_name
(member_expression
object: [
(identifier) @_name
(member_expression object: (identifier) @_name)
]
)
]
(#any-of? @_name "it" "test" "describe")
arguments: (
arguments . (string (string_fragment) @run)
)
) @_js-test
(#set! tag js-test)
)

View file

@ -1,79 +0,0 @@
(comment)+ @comment.around
(function_declaration
body: (_
"{"
(_)* @function.inside
"}")) @function.around
(method_definition
body: (_
"{"
(_)* @function.inside
"}")) @function.around
(function_expression
body: (_
"{"
(_)* @function.inside
"}")) @function.around
(arrow_function
body: (statement_block
"{"
(_)* @function.inside
"}")) @function.around
(arrow_function) @function.around
(function_signature) @function.around
(generator_function
body: (_
"{"
(_)* @function.inside
"}")) @function.around
(generator_function_declaration
body: (_
"{"
(_)* @function.inside
"}")) @function.around
(class_declaration
body: (_
"{"
[(_) ";"?]* @class.inside
"}" )) @class.around
(class
body: (_
"{"
(_)* @class.inside
"}" )) @class.around
(interface_declaration
body: (_
"{"
[(_) ";"?]* @class.inside
"}" )) @class.around
(enum_declaration
body: (_
"{"
[(_) ","?]* @class.inside
"}" )) @class.around
(ambient_declaration
(module
body: (_
"{"
[(_) ";"?]* @class.inside
"}" ))) @class.around
(internal_module
body: (_
"{"
[(_) ";"?]* @class.inside
"}" )) @class.around
(type_alias_declaration) @class.around