Updated languages doc to correctly list repo map supported langs

This commit is contained in:
Paul Gauthier 2024-07-24 11:28:37 +02:00
parent c33ebf910e
commit 859a13eb70
2 changed files with 17 additions and 52 deletions

View file

@ -162,14 +162,7 @@ class RepoMap:
language = get_language(lang) language = get_language(lang)
parser = get_parser(lang) parser = get_parser(lang)
# Load the tags queries query_scm = get_scm_fname(lang)
try:
scm_fname = resources.files(__package__).joinpath(
"queries", f"tree-sitter-{lang}-tags.scm"
)
except KeyError:
return
query_scm = scm_fname
if not query_scm.exists(): if not query_scm.exists():
return return
query_scm = query_scm.read_text() query_scm = query_scm.read_text()
@ -514,6 +507,14 @@ def get_random_color():
return res 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(): def get_supported_languages_md():
from grep_ast.parsers import PARSERS 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()) data = sorted((lang, ex) for ex, lang in PARSERS.items())
for lang, ext in data: 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" res += "\n"

View file

@ -5,25 +5,17 @@ description: Aider supports pretty much all popular coding languages.
--- ---
# Supported languages # Supported languages
Aider supports pretty much all the popular coding languages. Aider supports almost all popular coding languages.
This is partly because top LLMs are fluent in most mainstream languages, This is because top LLMs are fluent in most mainstream languages,
and familiar with popular libraries, packages and frameworks. 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 Aider uses tree-sitter to do code analysis and help
the LLM navigate larger code bases by producing the LLM navigate larger code bases by producing
a [repository map](https://aider.chat/docs/repomap.html). 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. Aider should work quite well for other languages, even without repo map support.
But aider should work quite well for other languages, even without repo map support.
<!--[[[cog <!--[[[cog
from aider.repomap import get_supported_languages_md from aider.repomap import get_supported_languages_md
@ -32,55 +24,25 @@ cog.out(get_supported_languages_md())
| Language | File extension | | Language | File extension |
|:--------:|:--------------:| |:--------:|:--------------:|
| bash | .bash |
| c | .c | | c | .c |
| c_sharp | .cs | | c_sharp | .cs |
| commonlisp | .cl |
| cpp | .cc | | cpp | .cc |
| cpp | .cpp | | cpp | .cpp |
| css | .css |
| dockerfile | .dockerfile |
| dot | .dot |
| elisp | .el | | elisp | .el |
| elixir | .ex | | elixir | .ex |
| elm | .elm | | elm | .elm |
| embedded_template | .et |
| erlang | .erl |
| go | .go | | go | .go |
| gomod | .gomod |
| hack | .hack |
| haskell | .hs |
| hcl | .hcl |
| html | .html |
| java | .java | | java | .java |
| javascript | .js | | javascript | .js |
| javascript | .mjs | | javascript | .mjs |
| jsdoc | .jsdoc |
| json | .json |
| julia | .jl |
| kotlin | .kt |
| lua | .lua |
| make | .mk |
| objc | .m |
| ocaml | .ml | | ocaml | .ml |
| perl | .pl |
| php | .php | | php | .php |
| python | .py | | python | .py |
| ql | .ql | | ql | .ql |
| r | .R |
| r | .r |
| regex | .regex |
| rst | .rst |
| ruby | .rb | | ruby | .rb |
| rust | .rs | | rust | .rs |
| scala | .scala |
| sql | .sql |
| sqlite | .sqlite |
| toml | .toml |
| tsq | .tsq |
| typescript | .ts | | typescript | .ts |
| typescript | .tsx | | typescript | .tsx |
| yaml | .yaml |
<!--[[[end]]]--> <!--[[[end]]]-->