mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
initial
This commit is contained in:
parent
6b41581f91
commit
94c8ce117d
1 changed files with 58 additions and 0 deletions
58
aider/parsers.py
Normal file
58
aider/parsers.py
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Updated mapping of file extensions to parsers
|
||||||
|
PARSERS = {
|
||||||
|
".py": "python",
|
||||||
|
".js": "javascript",
|
||||||
|
".go": "go",
|
||||||
|
".bash": "bash",
|
||||||
|
".c": "c",
|
||||||
|
".cs": "c-sharp",
|
||||||
|
".cl": "commonlisp",
|
||||||
|
".cpp": "cpp",
|
||||||
|
".css": "css",
|
||||||
|
".dockerfile": "dockerfile",
|
||||||
|
".dot": "dot",
|
||||||
|
".el": "elisp",
|
||||||
|
".ex": "elixir",
|
||||||
|
".elm": "elm",
|
||||||
|
".et": "embedded-template",
|
||||||
|
".erl": "erlang",
|
||||||
|
".gomod": "go-mod",
|
||||||
|
".hack": "hack",
|
||||||
|
".hs": "haskell",
|
||||||
|
".hcl": "hcl",
|
||||||
|
".html": "html",
|
||||||
|
".java": "java",
|
||||||
|
".jsdoc": "jsdoc",
|
||||||
|
".json": "json",
|
||||||
|
".jl": "julia",
|
||||||
|
".kt": "kotlin",
|
||||||
|
".lua": "lua",
|
||||||
|
".mk": "make",
|
||||||
|
# ".md": "markdown",
|
||||||
|
".m": "objc",
|
||||||
|
".ml": "ocaml",
|
||||||
|
".pl": "perl",
|
||||||
|
".php": "php",
|
||||||
|
".ql": "ql",
|
||||||
|
".r": "r",
|
||||||
|
".regex": "regex",
|
||||||
|
".rst": "rst",
|
||||||
|
".rb": "ruby",
|
||||||
|
".rs": "rust",
|
||||||
|
".scala": "scala",
|
||||||
|
".sql": "sql",
|
||||||
|
".sqlite": "sqlite",
|
||||||
|
".toml": "toml",
|
||||||
|
".tsq": "tsq",
|
||||||
|
".tsx": "typescript",
|
||||||
|
".ts": "typescript",
|
||||||
|
".yaml": "yaml",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def filename_to_lang(filename):
|
||||||
|
file_extension = os.path.splitext(filename)[1]
|
||||||
|
lang = PARSERS.get(file_extension)
|
||||||
|
return lang
|
Loading…
Add table
Add a link
Reference in a new issue