Commit graph

55 commits

Author SHA1 Message Date
Paul Gauthier
6d1bd4fa01 Added tree-sitter-cpp-tags.scm for aider queries. 2023-10-19 11:19:05 -07:00
Paul Gauthier
4347823c36 improved debug main() func 2023-09-08 08:26:06 -07:00
Paul Gauthier
fb5616f854 aider: Updated the tags based on the grammar.
# Aider chat conversation:

USER: update the tags based on the grammar

ASSISTANT: No changes are needed.
2023-09-01 16:14:01 -07:00
Paul Gauthier
aac393f12a aider: Added queries for functions, structs, unions, and enums in the tree-sitter-c-tags.scm file.
# Aider chat conversation:

USER: I did `git reset --hard HEAD~1` to discard the last edits.

ASSISTANT: Alright. If you have any other requests or need further assistance, feel free to ask.

USER: make tags queries for the c language, following the conventions used in the c-sharp tags file. like the example, only tag definitions of *named code*, like functions, methods, classes, modules. not types, etc.

ASSISTANT: To create tags queries for the C language, we need to follow the conventions used in the C# tags file. We will create a new file named `tree-sitter-c-tags.scm` in the `aider/queries` directory.

The C language has different constructs compared to C#, so we will need to adjust the queries accordingly. For example, C doesn't have classes or interfaces, but it does have structs and unions. Also, C doesn't have namespaces, but it does have functions and variables at the global scope.

Here is the proposed content for the new file:

```scheme
aider/queries/tree-sitter-c-tags.scm
<<<<<<< HEAD
=======
(translation_unit
  (function_definition
    declarator: (function_declarator
      declarator: (identifier) @name.definition.function
    )
  ) @definition.function

  (struct_specifier
    name: (type_identifier) @name.definition.struct
  ) @definition.struct

  (union_specifier
    name: (type_identifier) @name.definition.union
  ) @definition.union

  (enum_specifier
    name: (type_identifier) @name.definition.enum
  ) @definition.enum
)
>>>>>>> updated
```

This file includes queries for functions, structs, unions, and enums. Please note that these are just the basic constructs and you might need to add more queries depending on your needs.
2023-09-01 16:02:55 -07:00
Paul Gauthier
a5e84a5302 fixed inclusion of queries for package 2023-09-01 14:14:47 -07:00