move queries to extensions/vscode

This commit is contained in:
Jacob Kim 2025-06-28 19:54:19 -07:00
parent 1717fca231
commit 4e97c922d5
8 changed files with 0 additions and 79 deletions

View file

@ -1,36 +0,0 @@
export const TYPESCRIPT_HOLE_QUERY = `;; Capture the variable/function name
(variable_declarator
name: (identifier) @function.name
type: (type_annotation
(function_type) @function.type))
;; Capture the full parameter list
(function_type
parameters: (formal_parameters) @function.params)
;; Capture the type identifiers used in the parameters
(formal_parameters
(required_parameter
type: (type_annotation
(type_identifier) @param.type))
(required_parameter
type: (type_annotation
(type_identifier) @param.type)))
;; Capture the return type of the function
(function_type
return_type: (type_identifier) @return.type)
;; Capture any parse errors (e.g., the '?? ')
(ERROR) @error.node
;; Capture the entire function declaration line
(lexical_declaration) @function.decl
;; Matches import declarations like: import { A, B } from "module";
(import_statement
(import_clause
(named_imports
(import_specifier
name: (identifier) @import.name)))
source: (string) @import.source)`;

View file

@ -1,22 +0,0 @@
export const TYPESCRIPT_GET_TOPLEVEL_HEADERS = `;; Match top-level 'var', 'let', or 'const' declarations
(lexical_declaration
(variable_declarator
name: (identifier) @top.var.name
type: (type_annotation
(_) @top.var.type))) @top.var.decl
(variable_declaration
(variable_declarator
name: (identifier) @top.var.name
type: (type_annotation
(_) @top.var.type))) @top.var.decl
;; Match function declarations
(function_declaration
name: (identifier) @top.fn.name
parameters: (formal_parameters
(required_parameter
pattern: (identifier) @top.fn.param.name
type: (type_annotation (_) @top.fn.param.type)))*
return_type: (type_annotation (_) @top.fn.type)?) @top.fn.decl`

View file

@ -1,10 +0,0 @@
export const TYPESCRIPT_EXTRACT_IDENTIFIERS = `;; Capture the type alias name (left-hand side)
; (type_alias_declaration
; name: (type_identifier) @type.name)
;; Capture all identifiers on the right-hand side (value), recursively
; (type_alias_declaration
; value: (_) @type.value)
;; Match all identifiers inside the type value — deeply nested
(type_identifier) @type.identifier`;

View file

@ -1,11 +0,0 @@
export const TYPESCRIPT_FIND_TYPEDECL_GIVEN_TYPEIDENTIFIER = `(type_alias_declaration
name: (type_identifier) @type.identifier
value: (_) @type.value)
(interface_declaration
name: (type_identifier) @type.identifier
body: (_) @type.value)
(enum_declaration
name: (type_identifier) @type.identifier
body: (_) @type.value)`;