Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Solidity language support #665

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replaced 'block' nodes
  • Loading branch information
zeroaddresss committed Aug 5, 2024
commit e5a13a59af5c7eb4e8c0599c7f0abc5b634754fa
30 changes: 15 additions & 15 deletions queries/solidity/textobjects.scm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
; Solidity textobjects
; Functions
(function_definition
body: (block)) @function.outer
body: (_)) @function.outer

(function_definition
body: (block
body: (_
.
"{"
.
Expand All @@ -16,10 +16,10 @@

; Constructors
(constructor_definition
body: (block)) @function.outer
body: (_)) @function.outer

(constructor_definition
body: (block
body: (_
.
"{"
.
Expand All @@ -31,10 +31,10 @@

; Modifiers
(modifier_definition
body: (block)) @function.outer
body: (_)) @function.outer

(modifier_definition
body: (block
body: (_
.
"{"
.
Expand All @@ -46,23 +46,23 @@

; Contracts
(contract_declaration
body: (contract_body) @class.inner) @class.outer
body: (_) @class.inner) @class.outer

; Interfaces
(interface_declaration
body: (contract_body) @class.inner) @class.outer
body: (_) @class.inner) @class.outer

; Libraries
(library_declaration
body: (contract_body) @class.inner) @class.outer
body: (_) @class.inner) @class.outer

; Structs
(struct_declaration
body: (struct_body) @class.inner) @class.outer
body: (_) @class.inner) @class.outer

; Loops
(for_statement
body: (block
body: (_
.
"{"
.
Expand All @@ -73,7 +73,7 @@
(#make-range! "loop.inner" @_start @_end))) @loop.outer

(while_statement
body: (block
body: (_
.
"{"
.
Expand All @@ -85,7 +85,7 @@

; Conditionals
(if_statement
consequence: (block
consequence: (_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are you getting this node from? It's not in the grammar.

.
"{"
.
Expand All @@ -97,7 +97,7 @@

(if_statement
alternative: (else_clause
(block
(_
.
"{"
.
Expand Down Expand Up @@ -125,7 +125,7 @@

; Blocks
(_
(block) @block.inner) @block.outer
(_) @block.inner) @block.outer

; Parameters
(parameter_list
Expand Down
Loading