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)
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"

View file

@ -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.
<!--[[[cog
from aider.repomap import get_supported_languages_md
@ -32,55 +24,25 @@ cog.out(get_supported_languages_md())
| Language | File extension |
|:--------:|:--------------:|
| bash | .bash |
| c | .c |
| c_sharp | .cs |
| commonlisp | .cl |
| cpp | .cc |
| cpp | .cpp |
| css | .css |
| dockerfile | .dockerfile |
| dot | .dot |
| elisp | .el |
| elixir | .ex |
| elm | .elm |
| embedded_template | .et |
| erlang | .erl |
| go | .go |
| gomod | .gomod |
| hack | .hack |
| haskell | .hs |
| hcl | .hcl |
| html | .html |
| java | .java |
| javascript | .js |
| javascript | .mjs |
| jsdoc | .jsdoc |
| json | .json |
| julia | .jl |
| kotlin | .kt |
| lua | .lua |
| make | .mk |
| objc | .m |
| ocaml | .ml |
| perl | .pl |
| php | .php |
| python | .py |
| ql | .ql |
| r | .R |
| r | .r |
| regex | .regex |
| rst | .rst |
| ruby | .rb |
| rust | .rs |
| scala | .scala |
| sql | .sql |
| sqlite | .sqlite |
| toml | .toml |
| tsq | .tsq |
| typescript | .ts |
| typescript | .tsx |
| yaml | .yaml |
<!--[[[end]]]-->