-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
;; Copied from https://github.com/JoranHonig/tree-sitter-solidity/blob/master/queries/tags.scm | ||
;; | ||
;; Method and Function declarations | ||
(contract_declaration (_ | ||
(function_definition | ||
name: (identifier) @name) @definition.method)) | ||
|
||
(source_file | ||
(function_definition | ||
name: (identifier) @name) @definition.function) | ||
|
||
;; Contract, struct, enum and interface declarations | ||
(contract_declaration | ||
name: (identifier) @name) @definition.class | ||
|
||
(interface_declaration | ||
name: (identifier) @name) @definition.interface | ||
|
||
(library_declaration | ||
name: (identifier) @name) @definition.interface | ||
|
||
(struct_declaration name: (identifier) @name) @definition.class | ||
(enum_declaration name: (identifier) @name) @definition.class | ||
(event_definition name: (identifier) @name) @definition.class | ||
|
||
;; Function calls | ||
(call_expression (identifier) @name ) @reference.call | ||
|
||
(call_expression | ||
(member_expression | ||
property: (identifier) @name )) @reference.call | ||
|
||
;; Log emit | ||
(emit_statement name: (identifier) @name) @reference.class | ||
|
||
|
||
;; Inheritance | ||
|
||
(inheritance_specifier | ||
ancestor: (user_defined_type (identifier) @name . )) @reference.class | ||
|
||
|
||
;; Imports ( note that unknown is not standardised ) | ||
(import_directive | ||
import_name: (identifier) @name ) @reference.unknown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters