Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: feea82dc5fccfe04c26687f138ec76aba5267a31
  • Loading branch information
Copybara Bot authored and pqn committed Oct 5, 2024
1 parent 5302215 commit 2a19ccc
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 36 deletions.
2 changes: 1 addition & 1 deletion download_parse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion goldens/test.c.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Definition (definition.import):
#include "runtime/parser.h"



Name: parser__push
Parameters: (Parser* self, StackVersion version, Tree* tree,
TSStateId state)
Expand Down
4 changes: 2 additions & 2 deletions queries/c_tags.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)
body: (_)? @body
) @definition.function
(select-adjacent! @doc @definition.function)
(#select-adjacent! @doc @definition.function)
)

;; Function to pointer
Expand All @@ -27,7 +27,7 @@
)
body: (_)? @body
) @definition.function
(select-adjacent! @doc @definition.function)
(#select-adjacent! @doc @definition.function)
)

;; Imports
Expand Down
2 changes: 1 addition & 1 deletion queries/go_tags.scm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
(
(comment)* @doc
.
(method_spec
(method_elem
name: (field_identifier) @name
parameters: (parameter_list) @codeium.parameters
result: _? @codeium.return_type
Expand Down
8 changes: 4 additions & 4 deletions queries/javascript_functions.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -99,7 +99,7 @@
(arrow_function
parameters: (formal_parameters) @codeium.parameters
body: (_) @body)
(function
(function_expression
parameters: (formal_parameters) @codeium.parameters
body: (_) @body)
]
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions queries/kotlin_tags.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand All @@ -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)
)
Expand All @@ -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)
)
Expand Down
10 changes: 8 additions & 2 deletions queries/perl_tags.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 11 additions & 1 deletion queries/typescript_class_fields.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
[
Expand All @@ -16,3 +16,13 @@
]
)
)
;; For interface_declaration, whose body is an object_type
(
(interface_body
[
(property_signature) @field
(construct_signature) @definition.constructor
(_)
]
)
)
2 changes: 1 addition & 1 deletion queries/typescript_constructors.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions queries/typescript_tags.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2a19ccc

Please sign in to comment.