aider-ce 0.88.20__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aider/__init__.py +20 -0
- aider/__main__.py +4 -0
- aider/_version.py +34 -0
- aider/analytics.py +258 -0
- aider/args.py +1056 -0
- aider/args_formatter.py +228 -0
- aider/change_tracker.py +133 -0
- aider/coders/__init__.py +36 -0
- aider/coders/agent_coder.py +2166 -0
- aider/coders/agent_prompts.py +104 -0
- aider/coders/architect_coder.py +48 -0
- aider/coders/architect_prompts.py +40 -0
- aider/coders/ask_coder.py +9 -0
- aider/coders/ask_prompts.py +35 -0
- aider/coders/base_coder.py +3613 -0
- aider/coders/base_prompts.py +87 -0
- aider/coders/chat_chunks.py +64 -0
- aider/coders/context_coder.py +53 -0
- aider/coders/context_prompts.py +75 -0
- aider/coders/editblock_coder.py +657 -0
- aider/coders/editblock_fenced_coder.py +10 -0
- aider/coders/editblock_fenced_prompts.py +143 -0
- aider/coders/editblock_func_coder.py +141 -0
- aider/coders/editblock_func_prompts.py +27 -0
- aider/coders/editblock_prompts.py +175 -0
- aider/coders/editor_diff_fenced_coder.py +9 -0
- aider/coders/editor_diff_fenced_prompts.py +11 -0
- aider/coders/editor_editblock_coder.py +9 -0
- aider/coders/editor_editblock_prompts.py +21 -0
- aider/coders/editor_whole_coder.py +9 -0
- aider/coders/editor_whole_prompts.py +12 -0
- aider/coders/help_coder.py +16 -0
- aider/coders/help_prompts.py +46 -0
- aider/coders/patch_coder.py +706 -0
- aider/coders/patch_prompts.py +159 -0
- aider/coders/search_replace.py +757 -0
- aider/coders/shell.py +37 -0
- aider/coders/single_wholefile_func_coder.py +102 -0
- aider/coders/single_wholefile_func_prompts.py +27 -0
- aider/coders/udiff_coder.py +429 -0
- aider/coders/udiff_prompts.py +115 -0
- aider/coders/udiff_simple.py +14 -0
- aider/coders/udiff_simple_prompts.py +25 -0
- aider/coders/wholefile_coder.py +144 -0
- aider/coders/wholefile_func_coder.py +134 -0
- aider/coders/wholefile_func_prompts.py +27 -0
- aider/coders/wholefile_prompts.py +65 -0
- aider/commands.py +2173 -0
- aider/copypaste.py +72 -0
- aider/deprecated.py +126 -0
- aider/diffs.py +128 -0
- aider/dump.py +29 -0
- aider/editor.py +147 -0
- aider/exceptions.py +115 -0
- aider/format_settings.py +26 -0
- aider/gui.py +545 -0
- aider/help.py +163 -0
- aider/help_pats.py +19 -0
- aider/helpers/__init__.py +9 -0
- aider/helpers/similarity.py +98 -0
- aider/history.py +180 -0
- aider/io.py +1608 -0
- aider/linter.py +304 -0
- aider/llm.py +55 -0
- aider/main.py +1415 -0
- aider/mcp/__init__.py +174 -0
- aider/mcp/server.py +149 -0
- aider/mdstream.py +243 -0
- aider/models.py +1313 -0
- aider/onboarding.py +429 -0
- aider/openrouter.py +129 -0
- aider/prompts.py +56 -0
- aider/queries/tree-sitter-language-pack/README.md +7 -0
- aider/queries/tree-sitter-language-pack/arduino-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/c-tags.scm +9 -0
- aider/queries/tree-sitter-language-pack/chatito-tags.scm +16 -0
- aider/queries/tree-sitter-language-pack/clojure-tags.scm +7 -0
- aider/queries/tree-sitter-language-pack/commonlisp-tags.scm +122 -0
- aider/queries/tree-sitter-language-pack/cpp-tags.scm +15 -0
- aider/queries/tree-sitter-language-pack/csharp-tags.scm +26 -0
- aider/queries/tree-sitter-language-pack/d-tags.scm +26 -0
- aider/queries/tree-sitter-language-pack/dart-tags.scm +92 -0
- aider/queries/tree-sitter-language-pack/elisp-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/elixir-tags.scm +54 -0
- aider/queries/tree-sitter-language-pack/elm-tags.scm +19 -0
- aider/queries/tree-sitter-language-pack/gleam-tags.scm +41 -0
- aider/queries/tree-sitter-language-pack/go-tags.scm +42 -0
- aider/queries/tree-sitter-language-pack/java-tags.scm +20 -0
- aider/queries/tree-sitter-language-pack/javascript-tags.scm +88 -0
- aider/queries/tree-sitter-language-pack/lua-tags.scm +34 -0
- aider/queries/tree-sitter-language-pack/matlab-tags.scm +10 -0
- aider/queries/tree-sitter-language-pack/ocaml-tags.scm +115 -0
- aider/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +98 -0
- aider/queries/tree-sitter-language-pack/pony-tags.scm +39 -0
- aider/queries/tree-sitter-language-pack/properties-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/python-tags.scm +14 -0
- aider/queries/tree-sitter-language-pack/r-tags.scm +21 -0
- aider/queries/tree-sitter-language-pack/racket-tags.scm +12 -0
- aider/queries/tree-sitter-language-pack/ruby-tags.scm +64 -0
- aider/queries/tree-sitter-language-pack/rust-tags.scm +60 -0
- aider/queries/tree-sitter-language-pack/solidity-tags.scm +43 -0
- aider/queries/tree-sitter-language-pack/swift-tags.scm +51 -0
- aider/queries/tree-sitter-language-pack/udev-tags.scm +20 -0
- aider/queries/tree-sitter-languages/README.md +24 -0
- aider/queries/tree-sitter-languages/c-tags.scm +9 -0
- aider/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
- aider/queries/tree-sitter-languages/cpp-tags.scm +15 -0
- aider/queries/tree-sitter-languages/dart-tags.scm +91 -0
- aider/queries/tree-sitter-languages/elisp-tags.scm +8 -0
- aider/queries/tree-sitter-languages/elixir-tags.scm +54 -0
- aider/queries/tree-sitter-languages/elm-tags.scm +19 -0
- aider/queries/tree-sitter-languages/fortran-tags.scm +15 -0
- aider/queries/tree-sitter-languages/go-tags.scm +30 -0
- aider/queries/tree-sitter-languages/haskell-tags.scm +3 -0
- aider/queries/tree-sitter-languages/hcl-tags.scm +77 -0
- aider/queries/tree-sitter-languages/java-tags.scm +20 -0
- aider/queries/tree-sitter-languages/javascript-tags.scm +88 -0
- aider/queries/tree-sitter-languages/julia-tags.scm +60 -0
- aider/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
- aider/queries/tree-sitter-languages/matlab-tags.scm +10 -0
- aider/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
- aider/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
- aider/queries/tree-sitter-languages/php-tags.scm +26 -0
- aider/queries/tree-sitter-languages/python-tags.scm +12 -0
- aider/queries/tree-sitter-languages/ql-tags.scm +26 -0
- aider/queries/tree-sitter-languages/ruby-tags.scm +64 -0
- aider/queries/tree-sitter-languages/rust-tags.scm +60 -0
- aider/queries/tree-sitter-languages/scala-tags.scm +65 -0
- aider/queries/tree-sitter-languages/typescript-tags.scm +41 -0
- aider/queries/tree-sitter-languages/zig-tags.scm +3 -0
- aider/reasoning_tags.py +82 -0
- aider/repo.py +621 -0
- aider/repomap.py +1174 -0
- aider/report.py +260 -0
- aider/resources/__init__.py +3 -0
- aider/resources/model-metadata.json +776 -0
- aider/resources/model-settings.yml +2068 -0
- aider/run_cmd.py +133 -0
- aider/scrape.py +293 -0
- aider/sendchat.py +242 -0
- aider/sessions.py +256 -0
- aider/special.py +203 -0
- aider/tools/__init__.py +72 -0
- aider/tools/command.py +105 -0
- aider/tools/command_interactive.py +122 -0
- aider/tools/delete_block.py +182 -0
- aider/tools/delete_line.py +155 -0
- aider/tools/delete_lines.py +184 -0
- aider/tools/extract_lines.py +341 -0
- aider/tools/finished.py +48 -0
- aider/tools/git_branch.py +129 -0
- aider/tools/git_diff.py +60 -0
- aider/tools/git_log.py +57 -0
- aider/tools/git_remote.py +53 -0
- aider/tools/git_show.py +51 -0
- aider/tools/git_status.py +46 -0
- aider/tools/grep.py +256 -0
- aider/tools/indent_lines.py +221 -0
- aider/tools/insert_block.py +288 -0
- aider/tools/list_changes.py +86 -0
- aider/tools/ls.py +93 -0
- aider/tools/make_editable.py +85 -0
- aider/tools/make_readonly.py +69 -0
- aider/tools/remove.py +91 -0
- aider/tools/replace_all.py +126 -0
- aider/tools/replace_line.py +173 -0
- aider/tools/replace_lines.py +217 -0
- aider/tools/replace_text.py +187 -0
- aider/tools/show_numbered_context.py +147 -0
- aider/tools/tool_utils.py +313 -0
- aider/tools/undo_change.py +95 -0
- aider/tools/update_todo_list.py +156 -0
- aider/tools/view.py +57 -0
- aider/tools/view_files_matching.py +141 -0
- aider/tools/view_files_with_symbol.py +129 -0
- aider/urls.py +17 -0
- aider/utils.py +456 -0
- aider/versioncheck.py +113 -0
- aider/voice.py +205 -0
- aider/waiting.py +38 -0
- aider/watch.py +318 -0
- aider/watch_prompts.py +12 -0
- aider/website/Gemfile +8 -0
- aider/website/_includes/blame.md +162 -0
- aider/website/_includes/get-started.md +22 -0
- aider/website/_includes/help-tip.md +5 -0
- aider/website/_includes/help.md +24 -0
- aider/website/_includes/install.md +5 -0
- aider/website/_includes/keys.md +4 -0
- aider/website/_includes/model-warnings.md +67 -0
- aider/website/_includes/multi-line.md +22 -0
- aider/website/_includes/python-m-aider.md +5 -0
- aider/website/_includes/recording.css +228 -0
- aider/website/_includes/recording.md +34 -0
- aider/website/_includes/replit-pipx.md +9 -0
- aider/website/_includes/works-best.md +1 -0
- aider/website/_sass/custom/custom.scss +103 -0
- aider/website/docs/config/adv-model-settings.md +2261 -0
- aider/website/docs/config/agent-mode.md +194 -0
- aider/website/docs/config/aider_conf.md +548 -0
- aider/website/docs/config/api-keys.md +90 -0
- aider/website/docs/config/dotenv.md +493 -0
- aider/website/docs/config/editor.md +127 -0
- aider/website/docs/config/mcp.md +95 -0
- aider/website/docs/config/model-aliases.md +104 -0
- aider/website/docs/config/options.md +890 -0
- aider/website/docs/config/reasoning.md +210 -0
- aider/website/docs/config.md +44 -0
- aider/website/docs/faq.md +384 -0
- aider/website/docs/git.md +76 -0
- aider/website/docs/index.md +47 -0
- aider/website/docs/install/codespaces.md +39 -0
- aider/website/docs/install/docker.md +57 -0
- aider/website/docs/install/optional.md +100 -0
- aider/website/docs/install/replit.md +8 -0
- aider/website/docs/install.md +115 -0
- aider/website/docs/languages.md +264 -0
- aider/website/docs/legal/contributor-agreement.md +111 -0
- aider/website/docs/legal/privacy.md +104 -0
- aider/website/docs/llms/anthropic.md +77 -0
- aider/website/docs/llms/azure.md +48 -0
- aider/website/docs/llms/bedrock.md +132 -0
- aider/website/docs/llms/cohere.md +34 -0
- aider/website/docs/llms/deepseek.md +32 -0
- aider/website/docs/llms/gemini.md +49 -0
- aider/website/docs/llms/github.md +111 -0
- aider/website/docs/llms/groq.md +36 -0
- aider/website/docs/llms/lm-studio.md +39 -0
- aider/website/docs/llms/ollama.md +75 -0
- aider/website/docs/llms/openai-compat.md +39 -0
- aider/website/docs/llms/openai.md +58 -0
- aider/website/docs/llms/openrouter.md +78 -0
- aider/website/docs/llms/other.md +117 -0
- aider/website/docs/llms/vertex.md +50 -0
- aider/website/docs/llms/warnings.md +10 -0
- aider/website/docs/llms/xai.md +53 -0
- aider/website/docs/llms.md +54 -0
- aider/website/docs/more/analytics.md +127 -0
- aider/website/docs/more/edit-formats.md +116 -0
- aider/website/docs/more/infinite-output.md +165 -0
- aider/website/docs/more-info.md +8 -0
- aider/website/docs/recordings/auto-accept-architect.md +31 -0
- aider/website/docs/recordings/dont-drop-original-read-files.md +35 -0
- aider/website/docs/recordings/index.md +21 -0
- aider/website/docs/recordings/model-accepts-settings.md +69 -0
- aider/website/docs/recordings/tree-sitter-language-pack.md +80 -0
- aider/website/docs/repomap.md +112 -0
- aider/website/docs/scripting.md +100 -0
- aider/website/docs/sessions.md +203 -0
- aider/website/docs/troubleshooting/aider-not-found.md +24 -0
- aider/website/docs/troubleshooting/edit-errors.md +76 -0
- aider/website/docs/troubleshooting/imports.md +62 -0
- aider/website/docs/troubleshooting/models-and-keys.md +54 -0
- aider/website/docs/troubleshooting/support.md +79 -0
- aider/website/docs/troubleshooting/token-limits.md +96 -0
- aider/website/docs/troubleshooting/warnings.md +12 -0
- aider/website/docs/troubleshooting.md +11 -0
- aider/website/docs/usage/browser.md +57 -0
- aider/website/docs/usage/caching.md +49 -0
- aider/website/docs/usage/commands.md +133 -0
- aider/website/docs/usage/conventions.md +119 -0
- aider/website/docs/usage/copypaste.md +121 -0
- aider/website/docs/usage/images-urls.md +48 -0
- aider/website/docs/usage/lint-test.md +118 -0
- aider/website/docs/usage/modes.md +211 -0
- aider/website/docs/usage/not-code.md +179 -0
- aider/website/docs/usage/notifications.md +87 -0
- aider/website/docs/usage/tips.md +79 -0
- aider/website/docs/usage/tutorials.md +30 -0
- aider/website/docs/usage/voice.md +121 -0
- aider/website/docs/usage/watch.md +294 -0
- aider/website/docs/usage.md +102 -0
- aider/website/share/index.md +101 -0
- aider_ce-0.88.20.dist-info/METADATA +187 -0
- aider_ce-0.88.20.dist-info/RECORD +279 -0
- aider_ce-0.88.20.dist-info/WHEEL +5 -0
- aider_ce-0.88.20.dist-info/entry_points.txt +2 -0
- aider_ce-0.88.20.dist-info/licenses/LICENSE.txt +202 -0
- aider_ce-0.88.20.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
(class_definition
|
|
2
|
+
name: (identifier) @name.definition.class) @definition.class
|
|
3
|
+
|
|
4
|
+
(method_signature
|
|
5
|
+
(function_signature)) @definition.method
|
|
6
|
+
|
|
7
|
+
(type_alias
|
|
8
|
+
(type_identifier) @name.definition.type) @definition.type
|
|
9
|
+
|
|
10
|
+
(method_signature
|
|
11
|
+
(getter_signature
|
|
12
|
+
name: (identifier) @name.definition.method)) @definition.method
|
|
13
|
+
|
|
14
|
+
(method_signature
|
|
15
|
+
(setter_signature
|
|
16
|
+
name: (identifier) @name.definition.method)) @definition.method
|
|
17
|
+
|
|
18
|
+
(method_signature
|
|
19
|
+
(function_signature
|
|
20
|
+
name: (identifier) @name.definition.method)) @definition.method
|
|
21
|
+
|
|
22
|
+
(method_signature
|
|
23
|
+
(factory_constructor_signature
|
|
24
|
+
(identifier) @name.definition.method)) @definition.method
|
|
25
|
+
|
|
26
|
+
(method_signature
|
|
27
|
+
(constructor_signature
|
|
28
|
+
name: (identifier) @name.definition.method)) @definition.method
|
|
29
|
+
|
|
30
|
+
(method_signature
|
|
31
|
+
(operator_signature)) @definition.method
|
|
32
|
+
|
|
33
|
+
(method_signature) @definition.method
|
|
34
|
+
|
|
35
|
+
(mixin_declaration
|
|
36
|
+
(mixin)
|
|
37
|
+
(identifier) @name.definition.mixin) @definition.mixin
|
|
38
|
+
|
|
39
|
+
(extension_declaration
|
|
40
|
+
name: (identifier) @name.definition.extension) @definition.extension
|
|
41
|
+
|
|
42
|
+
(enum_declaration
|
|
43
|
+
name: (identifier) @name.definition.enum) @definition.enum
|
|
44
|
+
|
|
45
|
+
(function_signature
|
|
46
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
47
|
+
|
|
48
|
+
(new_expression
|
|
49
|
+
(type_identifier) @name.reference.class) @reference.class
|
|
50
|
+
|
|
51
|
+
(initialized_variable_definition
|
|
52
|
+
name: (identifier)
|
|
53
|
+
value: (identifier) @name.reference.class
|
|
54
|
+
value: (selector
|
|
55
|
+
"!"?
|
|
56
|
+
(argument_part
|
|
57
|
+
(arguments
|
|
58
|
+
(argument)*))?)?) @reference.class
|
|
59
|
+
|
|
60
|
+
(assignment_expression
|
|
61
|
+
left: (assignable_expression
|
|
62
|
+
(identifier)
|
|
63
|
+
(unconditional_assignable_selector
|
|
64
|
+
"."
|
|
65
|
+
(identifier) @name.reference.call))) @reference.call
|
|
66
|
+
|
|
67
|
+
(assignment_expression
|
|
68
|
+
left: (assignable_expression
|
|
69
|
+
(identifier)
|
|
70
|
+
(conditional_assignable_selector
|
|
71
|
+
"?."
|
|
72
|
+
(identifier) @name.reference.call))) @reference.call
|
|
73
|
+
|
|
74
|
+
((identifier) @name
|
|
75
|
+
(selector
|
|
76
|
+
"!"?
|
|
77
|
+
(conditional_assignable_selector
|
|
78
|
+
"?." (identifier) @name.reference.call)?
|
|
79
|
+
(unconditional_assignable_selector
|
|
80
|
+
"."? (identifier) @name.reference.call)?
|
|
81
|
+
(argument_part
|
|
82
|
+
(arguments
|
|
83
|
+
(argument)*))?)*
|
|
84
|
+
(cascade_section
|
|
85
|
+
(cascade_selector
|
|
86
|
+
(identifier)) @name.reference.call
|
|
87
|
+
(argument_part
|
|
88
|
+
(arguments
|
|
89
|
+
(argument)*))?)?) @reference.call
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
;; defun/defsubst
|
|
2
|
+
(function_definition name: (symbol) @name.definition.function) @definition.function
|
|
3
|
+
|
|
4
|
+
;; Treat macros as function definitions for the sake of TAGS.
|
|
5
|
+
(macro_definition name: (symbol) @name.definition.function) @definition.function
|
|
6
|
+
|
|
7
|
+
;; Match function calls
|
|
8
|
+
(list (symbol) @name.reference.function) @reference.function
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
; Definitions
|
|
2
|
+
|
|
3
|
+
; * modules and protocols
|
|
4
|
+
(call
|
|
5
|
+
target: (identifier) @ignore
|
|
6
|
+
(arguments (alias) @name.definition.module)
|
|
7
|
+
(#match? @ignore "^(defmodule|defprotocol)$")) @definition.module
|
|
8
|
+
|
|
9
|
+
; * functions/macros
|
|
10
|
+
(call
|
|
11
|
+
target: (identifier) @ignore
|
|
12
|
+
(arguments
|
|
13
|
+
[
|
|
14
|
+
; zero-arity functions with no parentheses
|
|
15
|
+
(identifier) @name.definition.function
|
|
16
|
+
; regular function clause
|
|
17
|
+
(call target: (identifier) @name.definition.function)
|
|
18
|
+
; function clause with a guard clause
|
|
19
|
+
(binary_operator
|
|
20
|
+
left: (call target: (identifier) @name.definition.function)
|
|
21
|
+
operator: "when")
|
|
22
|
+
])
|
|
23
|
+
(#match? @ignore "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @definition.function
|
|
24
|
+
|
|
25
|
+
; References
|
|
26
|
+
|
|
27
|
+
; ignore calls to kernel/special-forms keywords
|
|
28
|
+
(call
|
|
29
|
+
target: (identifier) @ignore
|
|
30
|
+
(#match? @ignore "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp|defmodule|defprotocol|defimpl|defstruct|defexception|defoverridable|alias|case|cond|else|for|if|import|quote|raise|receive|require|reraise|super|throw|try|unless|unquote|unquote_splicing|use|with)$"))
|
|
31
|
+
|
|
32
|
+
; ignore module attributes
|
|
33
|
+
(unary_operator
|
|
34
|
+
operator: "@"
|
|
35
|
+
operand: (call
|
|
36
|
+
target: (identifier) @ignore))
|
|
37
|
+
|
|
38
|
+
; * function call
|
|
39
|
+
(call
|
|
40
|
+
target: [
|
|
41
|
+
; local
|
|
42
|
+
(identifier) @name.reference.call
|
|
43
|
+
; remote
|
|
44
|
+
(dot
|
|
45
|
+
right: (identifier) @name.reference.call)
|
|
46
|
+
]) @reference.call
|
|
47
|
+
|
|
48
|
+
; * pipe into function call
|
|
49
|
+
(binary_operator
|
|
50
|
+
operator: "|>"
|
|
51
|
+
right: (identifier) @name.reference.call) @reference.call
|
|
52
|
+
|
|
53
|
+
; * modules
|
|
54
|
+
(alias) @name.reference.module @reference.module
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
(value_declaration (function_declaration_left (lower_case_identifier) @name.definition.function)) @definition.function
|
|
2
|
+
|
|
3
|
+
(function_call_expr (value_expr (value_qid) @name.reference.function)) @reference.function
|
|
4
|
+
(exposed_value (lower_case_identifier) @name.reference.function) @reference.function
|
|
5
|
+
(type_annotation ((lower_case_identifier) @name.reference.function) (colon)) @reference.function
|
|
6
|
+
|
|
7
|
+
(type_declaration ((upper_case_identifier) @name.definition.type)) @definition.type
|
|
8
|
+
|
|
9
|
+
(type_ref (upper_case_qid (upper_case_identifier) @name.reference.type)) @reference.type
|
|
10
|
+
(exposed_type (upper_case_identifier) @name.reference.type) @reference.type
|
|
11
|
+
|
|
12
|
+
(type_declaration (union_variant (upper_case_identifier) @name.definition.union)) @definition.union
|
|
13
|
+
|
|
14
|
+
(value_expr (upper_case_qid (upper_case_identifier) @name.reference.union)) @reference.union
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
(module_declaration
|
|
18
|
+
(upper_case_qid (upper_case_identifier)) @name.definition.module
|
|
19
|
+
) @definition.module
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
;; derived from: https://github.com/stadelmanma/tree-sitter-fortran
|
|
2
|
+
;; License: MIT
|
|
3
|
+
|
|
4
|
+
(module_statement
|
|
5
|
+
(name) @name.definition.class) @definition.class
|
|
6
|
+
|
|
7
|
+
(function_statement
|
|
8
|
+
name: (name) @name.definition.function) @definition.function
|
|
9
|
+
|
|
10
|
+
(subroutine_statement
|
|
11
|
+
name: (name) @name.definition.function) @definition.function
|
|
12
|
+
|
|
13
|
+
(module_procedure_statement
|
|
14
|
+
name: (name) @name.definition.function) @definition.function
|
|
15
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(
|
|
2
|
+
(comment)* @doc
|
|
3
|
+
.
|
|
4
|
+
(function_declaration
|
|
5
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
6
|
+
(#strip! @doc "^//\\s*")
|
|
7
|
+
(#set-adjacent! @doc @definition.function)
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
(
|
|
11
|
+
(comment)* @doc
|
|
12
|
+
.
|
|
13
|
+
(method_declaration
|
|
14
|
+
name: (field_identifier) @name.definition.method) @definition.method
|
|
15
|
+
(#strip! @doc "^//\\s*")
|
|
16
|
+
(#set-adjacent! @doc @definition.method)
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
(call_expression
|
|
20
|
+
function: [
|
|
21
|
+
(identifier) @name.reference.call
|
|
22
|
+
(parenthesized_expression (identifier) @name.reference.call)
|
|
23
|
+
(selector_expression field: (field_identifier) @name.reference.call)
|
|
24
|
+
(parenthesized_expression (selector_expression field: (field_identifier) @name.reference.call))
|
|
25
|
+
]) @reference.call
|
|
26
|
+
|
|
27
|
+
(type_spec
|
|
28
|
+
name: (type_identifier) @name.definition.type) @definition.type
|
|
29
|
+
|
|
30
|
+
(type_identifier) @name.reference.type @reference.type
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
;; Based on https://github.com/tree-sitter-grammars/tree-sitter-hcl/blob/main/make_grammar.js
|
|
2
|
+
;; Which has Apache 2.0 License
|
|
3
|
+
;; tags.scm for Terraform (tree-sitter-hcl)
|
|
4
|
+
|
|
5
|
+
; === Definitions: Terraform Blocks ===
|
|
6
|
+
(block
|
|
7
|
+
(identifier) @block_type
|
|
8
|
+
(string_lit (template_literal) @resource_type)
|
|
9
|
+
(string_lit (template_literal) @name.definition.resource)
|
|
10
|
+
(body) @definition.resource
|
|
11
|
+
) (#eq? @block_type "resource")
|
|
12
|
+
|
|
13
|
+
(block
|
|
14
|
+
(identifier) @block_type
|
|
15
|
+
(string_lit (template_literal) @name.definition.module)
|
|
16
|
+
(body) @definition.module
|
|
17
|
+
) (#eq? @block_type "module")
|
|
18
|
+
|
|
19
|
+
(block
|
|
20
|
+
(identifier) @block_type
|
|
21
|
+
(string_lit (template_literal) @name.definition.variable)
|
|
22
|
+
(body) @definition.variable
|
|
23
|
+
) (#eq? @block_type "variable")
|
|
24
|
+
|
|
25
|
+
(block
|
|
26
|
+
(identifier) @block_type
|
|
27
|
+
(string_lit (template_literal) @name.definition.output)
|
|
28
|
+
(body) @definition.output
|
|
29
|
+
) (#eq? @block_type "output")
|
|
30
|
+
|
|
31
|
+
(block
|
|
32
|
+
(identifier) @block_type
|
|
33
|
+
(string_lit (template_literal) @name.definition.provider)
|
|
34
|
+
(body) @definition.provider
|
|
35
|
+
) (#eq? @block_type "provider")
|
|
36
|
+
|
|
37
|
+
(block
|
|
38
|
+
(identifier) @block_type
|
|
39
|
+
(body
|
|
40
|
+
(attribute
|
|
41
|
+
(identifier) @name.definition.local
|
|
42
|
+
(expression) @definition.local
|
|
43
|
+
)+
|
|
44
|
+
)
|
|
45
|
+
) (#eq? @block_type "locals")
|
|
46
|
+
|
|
47
|
+
; === References: Variables, Locals, Modules, Data, Resources ===
|
|
48
|
+
((variable_expr) @ref_type
|
|
49
|
+
(get_attr (identifier) @name.reference.variable)
|
|
50
|
+
) @reference.variable
|
|
51
|
+
(#eq? @ref_type "var")
|
|
52
|
+
|
|
53
|
+
((variable_expr) @ref_type
|
|
54
|
+
(get_attr (identifier) @name.reference.local)
|
|
55
|
+
) @reference.local
|
|
56
|
+
(#eq? @ref_type "local")
|
|
57
|
+
|
|
58
|
+
((variable_expr) @ref_type
|
|
59
|
+
(get_attr (identifier) @name.reference.module)
|
|
60
|
+
) @reference.module
|
|
61
|
+
(#eq? @ref_type "module")
|
|
62
|
+
|
|
63
|
+
((variable_expr) @ref_type
|
|
64
|
+
(get_attr (identifier) @data_source_type)
|
|
65
|
+
(get_attr (identifier) @name.reference.data)
|
|
66
|
+
) @reference.data
|
|
67
|
+
(#eq? @ref_type "data")
|
|
68
|
+
|
|
69
|
+
((variable_expr) @resource_type
|
|
70
|
+
(get_attr (identifier) @name.reference.resource)
|
|
71
|
+
) @reference.resource
|
|
72
|
+
(#not-eq? @resource_type "var")
|
|
73
|
+
(#not-eq? @resource_type "local")
|
|
74
|
+
(#not-eq? @resource_type "module")
|
|
75
|
+
(#not-eq? @resource_type "data")
|
|
76
|
+
(#not-eq? @resource_type "provider")
|
|
77
|
+
(#not-eq? @resource_type "output")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
(class_declaration
|
|
2
|
+
name: (identifier) @name.definition.class) @definition.class
|
|
3
|
+
|
|
4
|
+
(method_declaration
|
|
5
|
+
name: (identifier) @name.definition.method) @definition.method
|
|
6
|
+
|
|
7
|
+
(method_invocation
|
|
8
|
+
name: (identifier) @name.reference.call
|
|
9
|
+
arguments: (argument_list) @reference.call)
|
|
10
|
+
|
|
11
|
+
(interface_declaration
|
|
12
|
+
name: (identifier) @name.definition.interface) @definition.interface
|
|
13
|
+
|
|
14
|
+
(type_list
|
|
15
|
+
(type_identifier) @name.reference.implementation) @reference.implementation
|
|
16
|
+
|
|
17
|
+
(object_creation_expression
|
|
18
|
+
type: (type_identifier) @name.reference.class) @reference.class
|
|
19
|
+
|
|
20
|
+
(superclass (type_identifier) @name.reference.class) @reference.class
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
(
|
|
2
|
+
(comment)* @doc
|
|
3
|
+
.
|
|
4
|
+
(method_definition
|
|
5
|
+
name: (property_identifier) @name.definition.method) @definition.method
|
|
6
|
+
(#not-eq? @name.definition.method "constructor")
|
|
7
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
8
|
+
(#select-adjacent! @doc @definition.method)
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
(
|
|
12
|
+
(comment)* @doc
|
|
13
|
+
.
|
|
14
|
+
[
|
|
15
|
+
(class
|
|
16
|
+
name: (_) @name.definition.class)
|
|
17
|
+
(class_declaration
|
|
18
|
+
name: (_) @name.definition.class)
|
|
19
|
+
] @definition.class
|
|
20
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
21
|
+
(#select-adjacent! @doc @definition.class)
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
(
|
|
25
|
+
(comment)* @doc
|
|
26
|
+
.
|
|
27
|
+
[
|
|
28
|
+
(function
|
|
29
|
+
name: (identifier) @name.definition.function)
|
|
30
|
+
(function_declaration
|
|
31
|
+
name: (identifier) @name.definition.function)
|
|
32
|
+
(generator_function
|
|
33
|
+
name: (identifier) @name.definition.function)
|
|
34
|
+
(generator_function_declaration
|
|
35
|
+
name: (identifier) @name.definition.function)
|
|
36
|
+
] @definition.function
|
|
37
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
38
|
+
(#select-adjacent! @doc @definition.function)
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
(
|
|
42
|
+
(comment)* @doc
|
|
43
|
+
.
|
|
44
|
+
(lexical_declaration
|
|
45
|
+
(variable_declarator
|
|
46
|
+
name: (identifier) @name.definition.function
|
|
47
|
+
value: [(arrow_function) (function)]) @definition.function)
|
|
48
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
49
|
+
(#select-adjacent! @doc @definition.function)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
(
|
|
53
|
+
(comment)* @doc
|
|
54
|
+
.
|
|
55
|
+
(variable_declaration
|
|
56
|
+
(variable_declarator
|
|
57
|
+
name: (identifier) @name.definition.function
|
|
58
|
+
value: [(arrow_function) (function)]) @definition.function)
|
|
59
|
+
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
|
|
60
|
+
(#select-adjacent! @doc @definition.function)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
(assignment_expression
|
|
64
|
+
left: [
|
|
65
|
+
(identifier) @name.definition.function
|
|
66
|
+
(member_expression
|
|
67
|
+
property: (property_identifier) @name.definition.function)
|
|
68
|
+
]
|
|
69
|
+
right: [(arrow_function) (function)]
|
|
70
|
+
) @definition.function
|
|
71
|
+
|
|
72
|
+
(pair
|
|
73
|
+
key: (property_identifier) @name.definition.function
|
|
74
|
+
value: [(arrow_function) (function)]) @definition.function
|
|
75
|
+
|
|
76
|
+
(
|
|
77
|
+
(call_expression
|
|
78
|
+
function: (identifier) @name.reference.call) @reference.call
|
|
79
|
+
(#not-match? @name.reference.call "^(require)$")
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
(call_expression
|
|
83
|
+
function: (member_expression
|
|
84
|
+
property: (property_identifier) @name.reference.call)
|
|
85
|
+
arguments: (_) @reference.call)
|
|
86
|
+
|
|
87
|
+
(new_expression
|
|
88
|
+
constructor: (_) @name.reference.class) @reference.class
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
;; derived from: https://github.com/tree-sitter/tree-sitter-julia
|
|
2
|
+
;; License: MIT
|
|
3
|
+
|
|
4
|
+
(module
|
|
5
|
+
name: (identifier) @name.definition.module) @definition.module
|
|
6
|
+
|
|
7
|
+
(module
|
|
8
|
+
name: (scoped_identifier) @name.definition.module) @definition.module
|
|
9
|
+
|
|
10
|
+
(struct_definition
|
|
11
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
12
|
+
|
|
13
|
+
(mutable_struct_definition
|
|
14
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
15
|
+
|
|
16
|
+
(abstract_type_declaration
|
|
17
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
18
|
+
|
|
19
|
+
(constant_assignment
|
|
20
|
+
left: (identifier) @name.definition.class) @definition.class
|
|
21
|
+
|
|
22
|
+
(function_definition
|
|
23
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
24
|
+
|
|
25
|
+
(function_definition
|
|
26
|
+
name: (scoped_identifier) @name.definition.function) @definition.function
|
|
27
|
+
|
|
28
|
+
(assignment
|
|
29
|
+
left: (call_expression
|
|
30
|
+
function: (identifier) @name.definition.function)) @definition.function
|
|
31
|
+
|
|
32
|
+
(method_definition
|
|
33
|
+
name: (identifier) @name.definition.method) @definition.method
|
|
34
|
+
|
|
35
|
+
(macro_definition
|
|
36
|
+
name: (identifier) @name.definition.macro) @definition.macro
|
|
37
|
+
|
|
38
|
+
(macro_call
|
|
39
|
+
name: (identifier) @name.reference.call) @reference.call
|
|
40
|
+
|
|
41
|
+
(call_expression
|
|
42
|
+
function: (identifier) @name.reference.call) @reference.call
|
|
43
|
+
|
|
44
|
+
(call_expression
|
|
45
|
+
function: (scoped_identifier) @name.reference.call) @reference.call
|
|
46
|
+
|
|
47
|
+
(type_expression
|
|
48
|
+
name: (type_identifier) @name.reference.type) @reference.type
|
|
49
|
+
|
|
50
|
+
(constant_assignment
|
|
51
|
+
left: (identifier) @name.definition.constant) @definition.constant
|
|
52
|
+
|
|
53
|
+
(export_statement
|
|
54
|
+
(identifier) @name.reference.export) @reference.export
|
|
55
|
+
|
|
56
|
+
(using_statement
|
|
57
|
+
(identifier) @name.reference.module) @reference.module
|
|
58
|
+
|
|
59
|
+
(import_statement
|
|
60
|
+
(identifier) @name.reference.module) @reference.module
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
; Definitions
|
|
2
|
+
|
|
3
|
+
(class_declaration
|
|
4
|
+
(type_identifier) @name.definition.class) @definition.class
|
|
5
|
+
|
|
6
|
+
(function_declaration
|
|
7
|
+
(simple_identifier) @name.definition.function) @definition.function
|
|
8
|
+
|
|
9
|
+
(object_declaration
|
|
10
|
+
(type_identifier) @name.definition.object) @definition.object
|
|
11
|
+
|
|
12
|
+
; References
|
|
13
|
+
|
|
14
|
+
(call_expression
|
|
15
|
+
[
|
|
16
|
+
(simple_identifier) @name.reference.call
|
|
17
|
+
(navigation_expression
|
|
18
|
+
(navigation_suffix
|
|
19
|
+
(simple_identifier) @name.reference.call))
|
|
20
|
+
]) @reference.call
|
|
21
|
+
|
|
22
|
+
(delegation_specifier
|
|
23
|
+
[
|
|
24
|
+
(user_type) @name.reference.type
|
|
25
|
+
(constructor_invocation
|
|
26
|
+
(user_type) @name.reference.type)
|
|
27
|
+
]) @reference.type
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
(class_definition
|
|
2
|
+
name: (identifier) @name.definition.class) @definition.class
|
|
3
|
+
|
|
4
|
+
(function_definition
|
|
5
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
6
|
+
|
|
7
|
+
(function_call
|
|
8
|
+
name: (identifier) @name.reference.call) @reference.call
|
|
9
|
+
|
|
10
|
+
(command (command_name) @name.reference.call) @reference.call
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
; Modules
|
|
2
|
+
;--------
|
|
3
|
+
|
|
4
|
+
(
|
|
5
|
+
(comment)? @doc .
|
|
6
|
+
(module_definition (module_binding (module_name) @name.definition.module) @definition.module)
|
|
7
|
+
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
(module_path (module_name) @name.reference.module) @reference.module
|
|
11
|
+
|
|
12
|
+
; Module types
|
|
13
|
+
;--------------
|
|
14
|
+
|
|
15
|
+
(
|
|
16
|
+
(comment)? @doc .
|
|
17
|
+
(module_type_definition (module_type_name) @name.definition.interface) @definition.interface
|
|
18
|
+
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
(module_type_path (module_type_name) @name.reference.implementation) @reference.implementation
|
|
22
|
+
|
|
23
|
+
; Functions
|
|
24
|
+
;----------
|
|
25
|
+
|
|
26
|
+
(
|
|
27
|
+
(comment)? @doc .
|
|
28
|
+
(value_definition
|
|
29
|
+
[
|
|
30
|
+
(let_binding
|
|
31
|
+
pattern: (value_name) @name.definition.function
|
|
32
|
+
(parameter))
|
|
33
|
+
(let_binding
|
|
34
|
+
pattern: (value_name) @name.definition.function
|
|
35
|
+
body: [(fun_expression) (function_expression)])
|
|
36
|
+
] @definition.function
|
|
37
|
+
)
|
|
38
|
+
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
(
|
|
42
|
+
(comment)? @doc .
|
|
43
|
+
(external (value_name) @name.definition.function) @definition.function
|
|
44
|
+
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
(application_expression
|
|
48
|
+
function: (value_path (value_name) @name.reference.call)) @reference.call
|
|
49
|
+
|
|
50
|
+
(infix_expression
|
|
51
|
+
left: (value_path (value_name) @name.reference.call)
|
|
52
|
+
operator: (concat_operator) @reference.call
|
|
53
|
+
(#eq? @reference.call "@@"))
|
|
54
|
+
|
|
55
|
+
(infix_expression
|
|
56
|
+
operator: (rel_operator) @reference.call
|
|
57
|
+
right: (value_path (value_name) @name.reference.call)
|
|
58
|
+
(#eq? @reference.call "|>"))
|
|
59
|
+
|
|
60
|
+
; Operator
|
|
61
|
+
;---------
|
|
62
|
+
|
|
63
|
+
(
|
|
64
|
+
(comment)? @doc .
|
|
65
|
+
(value_definition
|
|
66
|
+
(let_binding
|
|
67
|
+
pattern: (parenthesized_operator (_) @name.definition.function)) @definition.function)
|
|
68
|
+
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
[
|
|
72
|
+
(prefix_operator)
|
|
73
|
+
(sign_operator)
|
|
74
|
+
(pow_operator)
|
|
75
|
+
(mult_operator)
|
|
76
|
+
(add_operator)
|
|
77
|
+
(concat_operator)
|
|
78
|
+
(rel_operator)
|
|
79
|
+
(and_operator)
|
|
80
|
+
(or_operator)
|
|
81
|
+
(assign_operator)
|
|
82
|
+
(hash_operator)
|
|
83
|
+
(indexing_operator)
|
|
84
|
+
(let_operator)
|
|
85
|
+
(let_and_operator)
|
|
86
|
+
(match_operator)
|
|
87
|
+
] @name.reference.call @reference.call
|
|
88
|
+
|
|
89
|
+
; Classes
|
|
90
|
+
;--------
|
|
91
|
+
|
|
92
|
+
(
|
|
93
|
+
(comment)? @doc .
|
|
94
|
+
[
|
|
95
|
+
(class_definition (class_binding (class_name) @name.definition.class) @definition.class)
|
|
96
|
+
(class_type_definition (class_type_binding (class_type_name) @name.definition.class) @definition.class)
|
|
97
|
+
]
|
|
98
|
+
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
[
|
|
102
|
+
(class_path (class_name) @name.reference.class)
|
|
103
|
+
(class_type_path (class_type_name) @name.reference.class)
|
|
104
|
+
] @reference.class
|
|
105
|
+
|
|
106
|
+
; Methods
|
|
107
|
+
;--------
|
|
108
|
+
|
|
109
|
+
(
|
|
110
|
+
(comment)? @doc .
|
|
111
|
+
(method_definition (method_name) @name.definition.method) @definition.method
|
|
112
|
+
(#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
(method_invocation (method_name) @name.reference.call) @reference.call
|