Skip to content

Commit

Permalink
recognize more files and shebangs (#10120)
Browse files Browse the repository at this point in the history
* recognize `.node_repl_history` as JS

* recognize `bun` shebang

also add comments explaining Deno & Bun history files

* recognize `.python_history` file and `python3` shebang

* recognize more shells

* rm Py3 shebang

Co-authored-by: ath3 <[email protected]>

* rm non-standard deno/bun hist recognition

---------

Co-authored-by: ath3 <[email protected]>
  • Loading branch information
Rudxain and ath3 authored Apr 5, 2024
1 parent a2ee2e6 commit 1ba5763
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ name = "javascript"
scope = "source.js"
injection-regex = "(js|javascript)"
language-id = "javascript"
file-types = ["js", "mjs", "cjs", "rules", "es6", "pac", { glob = "jakefile" }]
file-types = ["js", "mjs", "cjs", "rules", "es6", "pac", { glob = ".node_repl_history" }, { glob = "jakefile" }]
shebangs = ["node"]
comment-token = "//"
block-comment-tokens = { start = "/*", end = "*/" }
Expand Down Expand Up @@ -709,9 +709,9 @@ grammar = "javascript"
name = "typescript"
scope = "source.ts"
injection-regex = "(ts|typescript)"
file-types = ["ts", "mts", "cts"]
language-id = "typescript"
shebangs = ["deno", "ts-node"]
file-types = ["ts", "mts", "cts"]
shebangs = ["deno", "bun", "ts-node"]
comment-token = "//"
block-comment-tokens = { start = "/*", end = "*/" }
language-servers = [ "typescript-language-server" ]
Expand Down Expand Up @@ -782,7 +782,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-html", rev = "29f53
name = "python"
scope = "source.python"
injection-regex = "python"
file-types = ["py", "pyi", "py3", "pyw", "ptl", "rpy", "cpy", "ipy", "pyt", { glob = ".pythonstartup" }, { glob = ".pythonrc" }, { glob = "SConstruct" }, { glob = "SConscript" }]
file-types = ["py", "pyi", "py3", "pyw", "ptl", "rpy", "cpy", "ipy", "pyt", { glob = ".python_history" }, { glob = ".pythonstartup" }, { glob = ".pythonrc" }, { glob = "SConstruct" }, { glob = "SConscript" }]
shebangs = ["python"]
roots = ["pyproject.toml", "setup.py", "poetry.lock", "pyrightconfig.json"]
comment-token = "#"
Expand Down Expand Up @@ -884,6 +884,10 @@ injection-regex = "(shell|bash|zsh|sh)"
file-types = [
"sh",
"bash",
"ash",
"dash",
"ksh",
"mksh",
"zsh",
"zshenv",
"zlogin",
Expand All @@ -895,7 +899,6 @@ file-types = [
"bazelrc",
"Renviron",
"zsh-theme",
"ksh",
"cshrc",
"tcshrc",
"bashrc_Apple_Terminal",
Expand Down

0 comments on commit 1ba5763

Please sign in to comment.