diff --git a/download_parse.sh b/download_parse.sh index 6b493f7..0645011 100755 --- a/download_parse.sh +++ b/download_parse.sh @@ -2,7 +2,7 @@ set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" -VERSION="v0.0.15" +VERSION="v0.0.16" rm -f parse.gz parse curl -Lo parse.gz "https://github.com/Exafunction/codeium-parse/releases/download/$VERSION/parse.gz" gzip -d parse.gz diff --git a/goldens/test.c.golden b/goldens/test.c.golden index 38e2422..3ef2510 100644 --- a/goldens/test.c.golden +++ b/goldens/test.c.golden @@ -3,7 +3,6 @@ Definition (definition.import): #include "runtime/parser.h" - Name: parser__push Parameters: (Parser* self, StackVersion version, Tree* tree, TSStateId state) diff --git a/queries/c_tags.scm b/queries/c_tags.scm index 8ce496a..3d28b43 100644 --- a/queries/c_tags.scm +++ b/queries/c_tags.scm @@ -10,7 +10,7 @@ ) body: (_)? @body ) @definition.function - (select-adjacent! @doc @definition.function) + (#select-adjacent! @doc @definition.function) ) ;; Function to pointer @@ -27,7 +27,7 @@ ) body: (_)? @body ) @definition.function - (select-adjacent! @doc @definition.function) + (#select-adjacent! @doc @definition.function) ) ;; Imports diff --git a/queries/go_tags.scm b/queries/go_tags.scm index aeef46f..97d7798 100644 --- a/queries/go_tags.scm +++ b/queries/go_tags.scm @@ -88,7 +88,7 @@ ( (comment)* @doc . - (method_spec + (method_elem name: (field_identifier) @name parameters: (parameter_list) @codeium.parameters result: _? @codeium.return_type diff --git a/queries/javascript_functions.scm b/queries/javascript_functions.scm index cab9419..7417b2f 100644 --- a/queries/javascript_functions.scm +++ b/queries/javascript_functions.scm @@ -56,7 +56,7 @@ (arrow_function parameters: (formal_parameters) @codeium.parameters body: (_) @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters body: (_) @body) ])) @definition.function @@ -75,7 +75,7 @@ (arrow_function parameters: (formal_parameters) @codeium.parameters body: (_) @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters body: (_) @body) ])) @_) @definition.function @@ -99,7 +99,7 @@ (arrow_function parameters: (formal_parameters) @codeium.parameters body: (_) @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters body: (_) @body) ] @@ -117,7 +117,7 @@ (arrow_function parameters: (formal_parameters) @codeium.parameters body: (_) @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters body: (_) @body) ]) @definition.function diff --git a/queries/kotlin_tags.scm b/queries/kotlin_tags.scm index 2eaa385..578df95 100644 --- a/queries/kotlin_tags.scm +++ b/queries/kotlin_tags.scm @@ -7,9 +7,9 @@ ]* @doc . (function_declaration - name: (simple_identifier) @name - parameters: (function_value_parameters) @codeium.parameters - body: (function_body)? @body + (simple_identifier) @name + (function_value_parameters) @codeium.parameters + (function_body)? @body ) @definition.function (#select-adjacent! @doc @definition.function) ) @@ -24,7 +24,7 @@ . (secondary_constructor "constructor" @name - parameters: (function_value_parameters) @codeium.parameters + (function_value_parameters) @codeium.parameters ) @definition.constructor (#select-adjacent! @doc @definition.constructor) ) @@ -38,8 +38,8 @@ ]* @doc . (class_declaration - name: (type_identifier) @name - body: (class_body)? @body + (type_identifier) @name + (class_body)? @body ) @definition.class (#select-adjacent! @doc @definition.class) ) diff --git a/queries/perl_tags.scm b/queries/perl_tags.scm index 324ec88..ed4c516 100644 --- a/queries/perl_tags.scm +++ b/queries/perl_tags.scm @@ -14,11 +14,17 @@ [ (subroutine_declaration_statement name: (bareword) @name - (prototype_or_signature)? @codeium.parameters + [ + (prototype) + (signature) + ]? @codeium.parameters body: (block) @body) @definition.function (method_declaration_statement name: (bareword) @name - (prototype_or_signature)? @codeium.parameters + [ + (prototype) + (signature) + ]? @codeium.parameters body: (block) @body) @definition.function ] (#select-adjacent! @doc @definition.function) diff --git a/queries/typescript_class_fields.scm b/queries/typescript_class_fields.scm index 3e141d2..9f76b27 100644 --- a/queries/typescript_class_fields.scm +++ b/queries/typescript_class_fields.scm @@ -6,7 +6,7 @@ ]) @field ) ) -;; For type_alias_declaration and interface_declaration, whose body is an object_type +;; For type_alias_declaration, whose body is an object_type ( (object_type [ @@ -16,3 +16,13 @@ ] ) ) +;; For interface_declaration, whose body is an object_type +( + (interface_body + [ + (property_signature) @field + (construct_signature) @definition.constructor + (_) + ] + ) +) diff --git a/queries/typescript_constructors.scm b/queries/typescript_constructors.scm index 50c8b69..dce8909 100644 --- a/queries/typescript_constructors.scm +++ b/queries/typescript_constructors.scm @@ -6,7 +6,7 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @definition.constructor diff --git a/queries/typescript_tags.scm b/queries/typescript_tags.scm index e5c38e8..49834f9 100644 --- a/queries/typescript_tags.scm +++ b/queries/typescript_tags.scm @@ -7,7 +7,7 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @definition.method @@ -25,7 +25,7 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @definition.function @@ -42,7 +42,7 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @_) @definition.function @@ -63,15 +63,15 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @@ -92,15 +92,15 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @@ -126,15 +126,15 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @@ -154,15 +154,15 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) - (function + (function_expression parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body) @@ -181,7 +181,7 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body)) @definition.function @@ -198,7 +198,7 @@ parameters: (formal_parameters) @codeium.parameters return_type: ([ (type_annotation (_) @codeium.return_type) - (asserts (_) @codeium.return_type) + (asserts_annotation (_) @codeium.return_type) (type_predicate_annotation (_) @codeium.return_type) ])? body: (_)? @body))) @definition.function