Commit graph

3067 commits

Author SHA1 Message Date
Paul Gauthier
0030615578 removed universal-ctags from docker image 2023-10-29 13:10:31 -07:00
Paul Gauthier
58d5c1e59b Updated HISTORY 2023-10-29 13:10:06 -07:00
paul-gauthier
41435228a3
Update test_commands.py 2023-10-25 16:00:20 -07:00
Paul Gauthier
b6142af12b make sure **.txt does not crash chat #293 2023-10-25 15:52:26 -07:00
Paul Gauthier
95f2b4546e fixed tests 2023-10-25 15:31:23 -07:00
Paul Gauthier
277a92b3c6 fixed tests 2023-10-25 15:30:33 -07:00
Paul Gauthier
15d3a5d581 Switch from "edit block" to "search/replace block"
Succeeded in tricky task in the grep-ast codebase:
- checkout ed714ffe58734 / tricky-search-and-replace-state
- "read and parse .gitignore once, not each time we recurse `enumerate_files`"
- was having a lot of trouble creating a head/updated block that matched the actual source code
- new search/replace block does much better

Benchmark had *best* try 1 result and *lowest* num_error_outputs ever seen on gpt-4-0613.
Low num_error_outputs means it's less likely to elide/... code in the before block (original/search).

──────────── tmp.benchmarks/2023-10-25-22-03-19--search-and-replace-and-think ─────────────
test-cases: 133
model: gpt-4
edit_format: diff
commit_hash: c9c2ddb
num_error_outputs: 6
num_user_asks: 0
num_exhausted_context_windows 0
test_timeouts: 2

50.4% correct after try 0
66.2% correct after try 1
2023-10-25 15:24:03 -07:00
Paul Gauthier
aa18d0f946 copy 2023-10-23 15:58:50 -07:00
Paul Gauthier
a12fdbcba7 grep-ast==0.2.0 2023-10-23 15:52:48 -07:00
Paul Gauthier
19f3136bfa copy 2023-10-23 08:45:27 -07:00
Paul Gauthier
c17ec92d9a copy 2023-10-22 15:09:34 -07:00
Paul Gauthier
5edf20915f updated sample map 2023-10-22 15:06:35 -07:00
Paul Gauthier
d953742696 Merge remote-tracking branch 'origin/main' 2023-10-22 11:57:43 -07:00
Paul Gauthier
b0c6e4c114 Updated HISTORY 2023-10-22 11:56:23 -07:00
Paul Gauthier
3299d90317 Handle successive editblocks from same file w/o filename #267 2023-10-22 11:28:22 -07:00
Paul Gauthier
ebbb5bd442 simplify 2023-10-22 11:26:37 -07:00
Paul Gauthier
33cf55e5ae aider: Add build-essential package to Dockerfile.
# Aider chat conversation:

ASSISTANT: To install the core tools needed to build Python wheels, we need to modify the Dockerfile. We will add a new line to install the build-essential package, which includes gcc and other necessary tools.

Here is the edit block for the Dockerfile:

```Dockerfile
benchmark/Dockerfile
<<<<<<< HEAD
FROM python:3.10-slim
RUN apt-get update && apt-get install -y less git
COPY requirements.txt /aider/requirements.txt
RUN pip install --upgrade pip
RUN pip install lox typer pandas matplotlib imgcat aider-chat
RUN pip install -r /aider/requirements.txt
RUN git config --global --add safe.directory /aider
WORKDIR /aider
=======
FROM python:3.10-slim
RUN apt-get update && apt-get install -y less git build-essential
COPY requirements.txt /aider/requirements.txt
RUN pip install --upgrade pip
RUN pip install lox typer pandas matplotlib imgcat aider-chat
RUN pip install -r /aider/requirements.txt
RUN git config --global --add safe.directory /aider
WORKDIR /aider
>>>>>>> updated
```

This change will install the build-essential package after updating the package lists for upgrades and new packages.
2023-10-22 11:22:18 -07:00
Paul Gauthier
98a6d383ab Updated Dockerfile to upgrade pip before installing dependencies. 2023-10-22 11:22:17 -07:00
Paul Gauthier
7871186e0f Stronger prompt to include file path 2023-10-22 11:18:41 -07:00
paul-gauthier
5b1e360223
Update repomap.md 2023-10-20 19:58:23 -07:00
paul-gauthier
1a690c731e
Update repomap.md 2023-10-20 19:55:58 -07:00
paul-gauthier
c005e6692d
Update repomap.md 2023-10-20 19:50:14 -07:00
paul-gauthier
b28c415473
Update repomap.md 2023-10-20 19:44:54 -07:00
paul-gauthier
0e4555203d
Update repomap.md 2023-10-20 19:35:53 -07:00
paul-gauthier
d038c150ad
Update repomap.md 2023-10-20 18:38:24 -07:00
Paul Gauthier
e75d9f2fc4 new thumbnail 2023-10-20 14:09:41 -07:00
Paul Gauthier
a5bdf2b7ad copy 2023-10-20 13:47:02 -07:00
Paul Gauthier
06e6bf95e0 copy 2023-10-20 13:45:08 -07:00
Paul Gauthier
51c8bf0614 copy 2023-10-20 11:45:48 -07:00
Paul Gauthier
fed7e9b408 copy 2023-10-20 10:15:35 -07:00
Paul Gauthier
458f1fb872 aider: Turned all the links in the credits list into actual links.
# Aider chat conversation:

ASSISTANT: To turn all the links in the credits list into actual links, we need to modify the `docs/repomap.md` file.

Here's the step-by-step process:

1. Identify the lines that contain the URLs.
2. Add Markdown syntax to turn the URLs into clickable links.

Here are the changes:

<source>markdown
docs/repomap.md
<<<<<<< HEAD
* https://github.com/tree-sitter/tree-sitter-c — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-c-sharp — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-cpp — licensed under the MIT License.
* https://github.com/Wilfred/tree-sitter-elisp — licensed under the MIT License.
* https://github.com/elixir-lang/tree-sitter-elixir — licensed under the Apache License, Version 2.0.
* https://github.com/elm-tooling/tree-sitter-elm — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-go — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-java — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-javascript — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-ocaml — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-php — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-python — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-ql — licensed under the MIT License.
* https://github.com/r-lib/tree-sitter-r — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-ruby — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-rust — licensed under the MIT License.
* https://github.com/tree-sitter/tree-sitter-typescript — licensed under the MIT License.
=======
* [https://github.com/tree-sitter/tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-c-sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp) — licensed under the MIT License.
* [https://github.com/Wilfred/tree-sitter-elisp](https://github.com/Wilfred/tree-sitter-elisp) — licensed under the MIT License.
* [https://github.com/elixir-lang/tree-sitter-elixir](https://github.com/elixir-lang/tree-sitter-elixir) — licensed under the Apache License, Version 2.0.
* [https://github.com/elm-tooling/tree-sitter-elm](https://github.com/elm-tooling/tree-sitter-elm) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-java](https://github.com/tree-sitter/tree-sitter-java) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-javascript](https://github.com/tree-sitter/tree-sitter-javascript) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-php](https://github.com/tree-sitter/tree-sitter-php) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-python](https://github.com/tree-sitter/tree-sitter-python) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-ql](https://github.com/tree-sitter/tree-sitter-ql) — licensed under the MIT License.
* [https://github.com/r-lib/tree-sitter-r](https://github.com/r-lib/tree-sitter-r) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-ruby](https://github.com/tree-sitter/tree-sitter-ruby) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-rust](https://github.com/tree-sitter/tree-sitter-rust) — licensed under the MIT License.
* [https://github.com/tree-sitter/tree-sitter-typescript](https://github.com/tree-sitter/tree-sitter-typescript) — licensed under the MIT License.
>>>>>>> updated
</source>
2023-10-20 10:13:24 -07:00
Paul Gauthier
3a8e9a0ce5 Build the repository map automatically using tree-sitter to extract symbol definitions from source files. 2023-10-20 10:13:23 -07:00
Paul Gauthier
561f433733 copy 2023-10-20 10:09:26 -07:00
Paul Gauthier
815fdaabc3 Merge branch 'sitter-map' 2023-10-20 09:57:45 -07:00
Paul Gauthier
4fcf005481 set version to 0.15.1-dev 2023-10-20 09:55:47 -07:00
Paul Gauthier
3b7f2ad1e6 version bump to 0.15.0 2023-10-20 09:55:13 -07:00
Paul Gauthier
8862254fab Updated HISTORY 2023-10-20 09:55:03 -07:00
Paul Gauthier
c450b40e3f copy 2023-10-20 08:44:31 -07:00
Paul Gauthier
4f2fd324f1 copy 2023-10-20 08:32:52 -07:00
Paul Gauthier
4654e81241 Merge branch 'main' into sitter-map 2023-10-20 08:05:33 -07:00
Paul Gauthier
6791bc19c6 added test for --encoding 2023-10-20 08:04:02 -07:00
Paul Gauthier
ac9160ae54 aider: Add --encoding argument and pass it to InputOutput.
# Aider chat conversation:

USER: add --encoding and pass it to `InputOutput`

ASSISTANT: To add the `--encoding` argument and pass it to `InputOutput`, we need to modify the `aider/main.py` file.

Here are the steps:

1. Add a new argument `--encoding` to the `argparse.ArgumentParser` in the `main` function.
2. Pass the `args.encoding` to the `InputOutput` class instantiation.

Here are the changes:

```python
aider/main.py
<<<<<<< HEAD
    ##########
    other_group = parser.add_argument_group("Other Settings")
    other_group.add_argument(
        "--version",
        action="version",
        version=f"%(prog)s {__version__}",
        help="Show the version number and exit",
    )
    other_group.add_argument(
        "--apply",
        metavar="FILE",
        help="Apply the changes from the given file instead of running the chat (debug)",
    )
    other_group.add_argument(
        "--yes",
        action="store_true",
        help="Always say yes to every confirmation",
        default=None,
    )
    other_group.add_argument(
        "-v",
        "--verbose",
        action="store_true",
        help="Enable verbose output",
        default=False,
    )
    other_group.add_argument(
        "--show-repo-map",
        action="store_true",
        help="Print the repo map and exit (debug)",
        default=False,
    )
    other_group.add_argument(
        "--message",
        "--msg",
        "-m",
        metavar="COMMAND",
        help="Specify a single message to send GPT, process reply then exit (disables chat mode)",
    )
    other_group.add_argument(
        "-c",
        "--config",
        is_config_file=True,
        metavar="CONFIG_FILE",
        help=(
            "Specify the config file (default: search for .aider.conf.yml in git root, cwd"
            " or home directory)"
        ),
    )

    args = parser.parse_args(argv)
=======
    ##########
    other_group = parser.add_argument_group("Other Settings")
    other_group.add_argument(
        "--version",
        action="version",
        version=f"%(prog)s {__version__}",
        help="Show the version number and exit",
    )
    other_group.add_argument(
        "--apply",
        metavar="FILE",
        help="Apply the changes from the given file instead of running the chat (debug)",
    )
    other_group.add_argument(
        "--yes",
        action="store_true",
        help="Always say yes to every confirmation",
        default=None,
    )
    other_group.add_argument(
        "-v",
        "--verbose",
        action="store_true",
        help="Enable verbose output",
        default=False,
    )
    other_group.add_argument(
        "--show-repo-map",
        action="store_true",
        help="Print the repo map and exit (debug)",
        default=False,
    )
    other_group.add_argument(
        "--message",
        "--msg",
        "-m",
        metavar="COMMAND",
        help="Specify a single message to send GPT, process reply then exit (disables chat mode)",
    )
    other_group.add_argument(
        "--encoding",
        default="utf-8",
        help="Specify the encoding for input and output (default: utf-8)",
    )
    other_group.add_argument(
        "-c",
        "--config",
        is_config_file=True,
        metavar="CONFIG_FILE",
        help=(
            "Specify the config file (default: search for .aider.conf.yml in git root, cwd"
            " or home directory)"
        ),
    )

    args = parser.parse_args(argv)
>>>>>>> updated
```

```python
aider/main.py
<<<<<<< HEAD
    io = InputOutput(
        args.pretty,
        args.yes,
        args.input_history_file,
        args.chat_history_file,
        input=input,
        output=output,
        user_input_color=args.user_input_color,
        tool_output_color=args.tool_output_color,
        tool_error_color=args.tool_error_color,
        dry_run=args.dry_run,
    )
=======
    io = InputOutput(
        args.pretty,
        args.yes,
        args.input_history_file,
        args.chat_history_file,
        input=input,
        output=output,
        user_input_color=args.user_input_color,
        tool_output_color=args.tool_output_color,
        tool_error_color=args.tool_error_color,
        dry_run=args.dry_run,
        encoding=args.encoding,
    )
>>>>>>> updated
```

Please note that the `InputOutput` class should be able to handle the `encoding` argument. If it's not the case, we need to modify the `InputOutput` class as well.
2023-10-19 20:18:02 -07:00
Paul Gauthier
80c03045ef put universal ctags back into the install instructions until tree-sitter ships in a released version 2023-10-19 17:51:03 -07:00
Paul Gauthier
427dcf67b5 update references to ctags in the docs 2023-10-19 15:49:44 -07:00
Paul Gauthier
3c817e9895 copy 2023-10-19 15:47:45 -07:00
Paul Gauthier
7929e825e7 fixed test 2023-10-19 15:27:51 -07:00
Paul Gauthier
93fd53263e handle encoding 2023-10-19 13:16:53 -07:00
Paul Gauthier
a941c5cb82 cache tags 2023-10-19 13:13:48 -07:00
Paul Gauthier
5b99281d86 refac 2023-10-19 13:10:29 -07:00
Paul Gauthier
ce3099fa8b Fall back to the pygments lexer for refs if tree-sitter only provides defs 2023-10-19 12:54:27 -07:00