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

Add dart support #2236

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
91 changes: 91 additions & 0 deletions aider/queries/tree-sitter-dart-tags.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
(class_definition
name: (identifier) @name.definition.class) @definition.class

(method_signature
(function_signature)) @definition.method

(type_alias
(type_identifier) @name.definition.type) @definition.type

(method_signature
(getter_signature
name: (identifier) @name.definition.method)) @definition.method

(method_signature
(setter_signature
name: (identifier) @name.definition.method)) @definition.method

(method_signature
(function_signature
name: (identifier) @name.definition.method)) @definition.method

(method_signature
(factory_constructor_signature
(identifier) @name.definition.method)) @definition.method

(method_signature
(constructor_signature
name: (identifier) @name.definition.method)) @definition.method

(method_signature
(operator_signature)) @definition.method

(method_signature) @definition.method

(mixin_declaration
(mixin)
(identifier) @name.definition.mixin) @definition.mixin

(extension_declaration
name: (identifier) @name.definition.extension) @definition.extension

(enum_declaration
name: (identifier) @name.definition.enum) @definition.enum

(function_signature
name: (identifier) @name.definition.function) @definition.function

(new_expression
(type_identifier) @name.reference.class) @reference.class

(initialized_variable_definition
name: (identifier)
value: (identifier) @name.reference.class
value: (selector
"!"?
(argument_part
(arguments
(argument)*))?)?) @reference.class

(assignment_expression
left: (assignable_expression
(identifier)
(unconditional_assignable_selector
"."
(identifier) @name.reference.call))) @reference.call

(assignment_expression
left: (assignable_expression
(identifier)
(conditional_assignable_selector
"?."
(identifier) @name.reference.call))) @reference.call

((identifier) @name
(selector
"!"?
(conditional_assignable_selector
"?." (identifier) @name.reference.call)?
(unconditional_assignable_selector
"."? (identifier) @name.reference.call)?
(argument_part
(arguments
(argument)*))?)*
(cascade_section
(cascade_selector
(identifier)) @name.reference.call
(argument_part
(arguments
(argument)*))?)?) @reference.call


1 change: 1 addition & 0 deletions aider/website/docs/languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ cog.out(get_supported_languages_md())
| cpp | .cc |||
| cpp | .cpp |||
| css | .css | ||
| dart | .dart || |
| dockerfile | .dockerfile | ||
| dot | .dot | ||
| elisp | .el |||
Expand Down