From 859a13eb70fe7d3fbb2806c786a09c9b7014c3ca Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 24 Jul 2024 11:28:37 +0200 Subject: [PATCH] Updated languages doc to correctly list repo map supported langs --- aider/repomap.py | 21 ++++++++------- aider/website/docs/languages.md | 48 ++++----------------------------- 2 files changed, 17 insertions(+), 52 deletions(-) diff --git a/aider/repomap.py b/aider/repomap.py index 976cdfbfa..e8d8b22aa 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -162,14 +162,7 @@ class RepoMap: language = get_language(lang) parser = get_parser(lang) - # Load the tags queries - try: - scm_fname = resources.files(__package__).joinpath( - "queries", f"tree-sitter-{lang}-tags.scm" - ) - except KeyError: - return - query_scm = scm_fname + query_scm = get_scm_fname(lang) if not query_scm.exists(): return query_scm = query_scm.read_text() @@ -514,6 +507,14 @@ def get_random_color(): return res +def get_scm_fname(lang): + # Load the tags queries + try: + return resources.files(__package__).joinpath("queries", f"tree-sitter-{lang}-tags.scm") + except KeyError: + return + + def get_supported_languages_md(): from grep_ast.parsers import PARSERS @@ -523,7 +524,9 @@ def get_supported_languages_md(): """ data = sorted((lang, ex) for ex, lang in PARSERS.items()) for lang, ext in data: - res += f"| {lang:20} | {ext:20} |\n" + fn = get_scm_fname(lang) + if Path(fn).exists(): + res += f"| {lang:20} | {ext:20} |\n" res += "\n" diff --git a/aider/website/docs/languages.md b/aider/website/docs/languages.md index fa8f43003..dad1c9242 100644 --- a/aider/website/docs/languages.md +++ b/aider/website/docs/languages.md @@ -5,25 +5,17 @@ description: Aider supports pretty much all popular coding languages. --- # Supported languages -Aider supports pretty much all the popular coding languages. -This is partly because top LLMs are fluent in most mainstream languages, +Aider supports almost all popular coding languages. +This is because top LLMs are fluent in most mainstream languages, and familiar with popular libraries, packages and frameworks. -In fact, coding with aider is sometimes the most magical -when you're working in a language that you -are less familiar with. -the LLM often knows the language better than you, -and can generate all the boilerplate to get to the heart of your -problem. -The LLM will often solve your problem in an elegant way -using a library or package that you weren't even aware of. - Aider uses tree-sitter to do code analysis and help the LLM navigate larger code bases by producing a [repository map](https://aider.chat/docs/repomap.html). +Aider can currently produce repository maps for many popular +mainstream languages, listed below. -Aider can currently produce repository maps for most mainstream languages, listed below. -But aider should work quite well for other languages, even without repo map support. +Aider should work quite well for other languages, even without repo map support.