aider: Adjusted path in repomap.py to correctly locate the queries directory in the parent directory.

# Aider chat conversation:

USER: the queries directory is currently in the parent dir of repomap.py. what should i do?

ASSISTANT: If the `queries` directory is in the parent directory of `repomap.py`, you need to adjust the path in the `resource_filename` call accordingly.

You can use `..` to refer to the parent directory. Here's how you can modify the `scm_fname` assignment in `repomap.py`:

```python
aider/repomap.py
<<<<<<< HEAD
        scm_fname = pkg_resources.resource_filename(
            __name__, f"queries/tree-sitter-{lang}-tags.scm"
        )
=======
        scm_fname = pkg_resources.resource_filename(
            __name__, f"../queries/tree-sitter-{lang}-tags.scm"
        )
>>>>>>> updated
```

Please note that this assumes that the `queries` directory is directly in the parent directory of `repomap.py`. If it's in a different location, you'll need to adjust the path accordingly.
This commit is contained in:
Paul Gauthier 2023-09-01 14:08:35 -07:00
parent 7b77dbb88d
commit b587685dc6

View file

@ -178,7 +178,7 @@ class RepoMap:
# Load the tags queries
scm_fname = pkg_resources.resource_filename(
__name__, f"queries/tree-sitter-{lang}-tags.scm"
__name__, f"../queries/tree-sitter-{lang}-tags.scm"
)
query_scm = Path(scm_fname)
if not query_scm.exists():