fix(ts): remove unused files
This commit is contained in:
@@ -1,216 +0,0 @@
|
||||
; Modified from nvim-treesitter (https://github.com/nvim-treesitter/nvim-treesitter)
|
||||
; Modifications Copyright 2026 Oscar Wallberg
|
||||
; Licensed under Apache-2.0
|
||||
|
||||
[
|
||||
(import_from_statement)
|
||||
(generator_expression)
|
||||
(list_comprehension)
|
||||
(set_comprehension)
|
||||
(dictionary_comprehension)
|
||||
(tuple_pattern)
|
||||
(list_pattern)
|
||||
(binary_operator)
|
||||
(lambda)
|
||||
(concatenated_string)
|
||||
] @indent.begin
|
||||
|
||||
((list) @indent.align
|
||||
(#set! indent.open_delimiter "[")
|
||||
(#set! indent.close_delimiter "]"))
|
||||
|
||||
((dictionary) @indent.align
|
||||
(#set! indent.open_delimiter "{")
|
||||
(#set! indent.close_delimiter "}"))
|
||||
|
||||
((set) @indent.align
|
||||
(#set! indent.open_delimiter "{")
|
||||
(#set! indent.close_delimiter "}"))
|
||||
|
||||
((parenthesized_expression) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
((for_statement) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
((if_statement) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
((while_statement) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
((try_statement) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
(ERROR
|
||||
"try"
|
||||
.
|
||||
":"
|
||||
(#set! indent.immediate 1)) @indent.begin
|
||||
|
||||
(ERROR
|
||||
"try"
|
||||
.
|
||||
":"
|
||||
(ERROR
|
||||
(block
|
||||
(identifier) @_except @indent.branch))
|
||||
(#eq? @_except "except"))
|
||||
|
||||
((function_definition) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
((class_definition) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
((with_statement) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
((match_statement) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
((case_clause) @indent.begin
|
||||
(#set! indent.immediate 1))
|
||||
|
||||
; if (cond1
|
||||
; or cond2
|
||||
; or cond3):
|
||||
; pass
|
||||
;
|
||||
(if_statement
|
||||
condition: (parenthesized_expression) @indent.align
|
||||
(#lua-match? @indent.align "^%([^\n]")
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")")
|
||||
(#set! indent.avoid_last_matching_next 1))
|
||||
|
||||
; while (
|
||||
; cond1
|
||||
; or cond2
|
||||
; or cond3):
|
||||
; pass
|
||||
;
|
||||
(while_statement
|
||||
condition: (parenthesized_expression) @indent.align
|
||||
(#lua-match? @indent.align "[^\n ]%)$")
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")")
|
||||
(#set! indent.avoid_last_matching_next 1))
|
||||
|
||||
; if (
|
||||
; cond1
|
||||
; or cond2
|
||||
; or cond3):
|
||||
; pass
|
||||
;
|
||||
(if_statement
|
||||
condition: (parenthesized_expression) @indent.align
|
||||
(#lua-match? @indent.align "[^\n ]%)$")
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")")
|
||||
(#set! indent.avoid_last_matching_next 1))
|
||||
|
||||
(ERROR
|
||||
"(" @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")")
|
||||
.
|
||||
(_))
|
||||
|
||||
((argument_list) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
((parameters) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
((parameters) @indent.align
|
||||
(#lua-match? @indent.align "[^\n ]%)$")
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")")
|
||||
(#set! indent.avoid_last_matching_next 1))
|
||||
|
||||
((tuple) @indent.align
|
||||
(#set! indent.open_delimiter "(")
|
||||
(#set! indent.close_delimiter ")"))
|
||||
|
||||
(ERROR
|
||||
"[" @indent.align
|
||||
(#set! indent.open_delimiter "[")
|
||||
(#set! indent.close_delimiter "]")
|
||||
.
|
||||
(_))
|
||||
|
||||
(ERROR
|
||||
"{" @indent.align
|
||||
(#set! indent.open_delimiter "{")
|
||||
(#set! indent.close_delimiter "}")
|
||||
.
|
||||
(_))
|
||||
|
||||
[
|
||||
(break_statement)
|
||||
(continue_statement)
|
||||
] @indent.dedent
|
||||
|
||||
(ERROR
|
||||
(_) @indent.branch
|
||||
":"
|
||||
.
|
||||
(#lua-match? @indent.branch "^else"))
|
||||
|
||||
(ERROR
|
||||
(_) @indent.branch @indent.dedent
|
||||
":"
|
||||
.
|
||||
(#lua-match? @indent.branch "^elif"))
|
||||
|
||||
(generator_expression
|
||||
")" @indent.end)
|
||||
|
||||
(list_comprehension
|
||||
"]" @indent.end)
|
||||
|
||||
(set_comprehension
|
||||
"}" @indent.end)
|
||||
|
||||
(dictionary_comprehension
|
||||
"}" @indent.end)
|
||||
|
||||
(tuple_pattern
|
||||
")" @indent.end)
|
||||
|
||||
(list_pattern
|
||||
"]" @indent.end)
|
||||
|
||||
(return_statement
|
||||
[
|
||||
(_) @indent.end
|
||||
(_
|
||||
[
|
||||
(_)
|
||||
")"
|
||||
"}"
|
||||
"]"
|
||||
] @indent.end .)
|
||||
(attribute
|
||||
attribute: (_) @indent.end)
|
||||
(call
|
||||
arguments: (_
|
||||
")" @indent.end))
|
||||
"return" @indent.end
|
||||
] .)
|
||||
|
||||
[
|
||||
")"
|
||||
"]"
|
||||
"}"
|
||||
(elif_clause)
|
||||
(else_clause)
|
||||
(except_clause)
|
||||
(finally_clause)
|
||||
] @indent.branch
|
||||
|
||||
(string) @indent.auto
|
||||
@@ -1,124 +0,0 @@
|
||||
; Program structure
|
||||
(module) @local.scope
|
||||
|
||||
(class_definition
|
||||
body: (block
|
||||
(expression_statement
|
||||
(assignment
|
||||
left: (identifier) @local.definition.field)))) @local.scope
|
||||
|
||||
(class_definition
|
||||
body: (block
|
||||
(expression_statement
|
||||
(assignment
|
||||
left: (_
|
||||
(identifier) @local.definition.field))))) @local.scope
|
||||
|
||||
; Imports
|
||||
(aliased_import
|
||||
alias: (identifier) @local.definition.import) @local.scope
|
||||
|
||||
(import_statement
|
||||
name: (dotted_name
|
||||
(identifier) @local.definition.import)) @local.scope
|
||||
|
||||
(import_from_statement
|
||||
name: (dotted_name
|
||||
(identifier) @local.definition.import)) @local.scope
|
||||
|
||||
; Function with parameters, defines parameters
|
||||
(parameters
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
(default_parameter
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
(typed_parameter
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
(typed_default_parameter
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
; *args parameter
|
||||
(parameters
|
||||
(list_splat_pattern
|
||||
(identifier) @local.definition.parameter))
|
||||
|
||||
; **kwargs parameter
|
||||
(parameters
|
||||
(dictionary_splat_pattern
|
||||
(identifier) @local.definition.parameter))
|
||||
|
||||
; Function defines function and scope
|
||||
((function_definition
|
||||
name: (identifier) @local.definition.function) @local.scope
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
||||
((class_definition
|
||||
name: (identifier) @local.definition.type) @local.scope
|
||||
(#set! definition.type.scope "parent"))
|
||||
|
||||
(class_definition
|
||||
body: (block
|
||||
(function_definition
|
||||
name: (identifier) @local.definition.method)))
|
||||
|
||||
; Loops
|
||||
; not a scope!
|
||||
(for_statement
|
||||
left: (pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(for_statement
|
||||
left: (tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(for_statement
|
||||
left: (identifier) @local.definition.var)
|
||||
|
||||
; not a scope!
|
||||
;(while_statement) @local.scope
|
||||
; for in list comprehension
|
||||
(for_in_clause
|
||||
left: (identifier) @local.definition.var)
|
||||
|
||||
(for_in_clause
|
||||
left: (tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(for_in_clause
|
||||
left: (pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(dictionary_comprehension) @local.scope
|
||||
|
||||
(list_comprehension) @local.scope
|
||||
|
||||
(set_comprehension) @local.scope
|
||||
|
||||
; Assignments
|
||||
(assignment
|
||||
left: (identifier) @local.definition.var)
|
||||
|
||||
(assignment
|
||||
left: (pattern_list
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(assignment
|
||||
left: (tuple_pattern
|
||||
(identifier) @local.definition.var))
|
||||
|
||||
(assignment
|
||||
left: (attribute
|
||||
(identifier)
|
||||
(identifier) @local.definition.field))
|
||||
|
||||
; Walrus operator x := 1
|
||||
(named_expression
|
||||
(identifier) @local.definition.var)
|
||||
|
||||
(as_pattern
|
||||
alias: (as_pattern_target) @local.definition.var)
|
||||
|
||||
; REFERENCES
|
||||
(identifier) @local.reference
|
||||
Reference in New Issue
Block a user