From 3055dfc0683916c74835f84a29ba8d2413d02da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:30:45 -0400 Subject: [PATCH 1/6] recognize `.node_repl_history` as JS --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index b047b83ebe1d..f658a2475330 100644 --- a/languages.toml +++ b/languages.toml @@ -669,7 +669,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 = "*/" } From e29dae7ab5af12a33d1ca31498d5f462c989f2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:38:57 -0400 Subject: [PATCH 2/6] recognize `bun` shebang also add comments explaining Deno & Bun history files --- languages.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index f658a2475330..d5b16245f833 100644 --- a/languages.toml +++ b/languages.toml @@ -708,9 +708,11 @@ 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"]#, { glob = ".deno_repl_history" }, { glob = ".bun_repl_history" }] +# Deno doesn't save hist-file by default: https://deno.land/x/manual@v1.36.4/tools/repl.md?source=#deno_repl_history +# Bun doesn't (yet) have a standard REPL history file (this info wasn't verified) +shebangs = ["deno", "bun", "ts-node"] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] From da36567e120a926eca1e98d182f8e84200cefd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:42:09 -0400 Subject: [PATCH 3/6] recognize `.python_history` file and `python3` shebang --- languages.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index d5b16245f833..bfbc53b6aa08 100644 --- a/languages.toml +++ b/languages.toml @@ -783,8 +783,8 @@ 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" }] -shebangs = ["python"] +file-types = ["py", "pyi", "py3", "pyw", "ptl", "rpy", "cpy", "ipy", "pyt", { glob = ".python_history" }, { glob = ".pythonstartup" }, { glob = ".pythonrc" }, { glob = "SConstruct" }, { glob = "SConscript" }] +shebangs = ["python", "python3"] roots = ["pyproject.toml", "setup.py", "poetry.lock", "pyrightconfig.json"] comment-token = "#" language-servers = [ "pylsp" ] From ea80c33a541b0f019229403f9faa71a7622d0e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Tue, 2 Apr 2024 23:29:50 -0400 Subject: [PATCH 4/6] recognize more shells --- languages.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index bfbc53b6aa08..e6a3b31584d9 100644 --- a/languages.toml +++ b/languages.toml @@ -885,6 +885,10 @@ injection-regex = "(shell|bash|zsh|sh)" file-types = [ "sh", "bash", + "ash", + "dash", + "ksh", + "mksh", "zsh", "zshenv", "zlogin", @@ -896,7 +900,6 @@ file-types = [ "bazelrc", "Renviron", "zsh-theme", - "ksh", "cshrc", "tcshrc", "bashrc_Apple_Terminal", From c28b2965fc020be4d7e16da5b10b137bdb561931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Thu, 4 Apr 2024 00:52:48 -0400 Subject: [PATCH 5/6] rm Py3 shebang Co-authored-by: ath3 <45574139+ath3@users.noreply.github.com> --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index e6a3b31584d9..da8d66367a2c 100644 --- a/languages.toml +++ b/languages.toml @@ -784,7 +784,7 @@ name = "python" scope = "source.python" injection-regex = "python" file-types = ["py", "pyi", "py3", "pyw", "ptl", "rpy", "cpy", "ipy", "pyt", { glob = ".python_history" }, { glob = ".pythonstartup" }, { glob = ".pythonrc" }, { glob = "SConstruct" }, { glob = "SConscript" }] -shebangs = ["python", "python3"] +shebangs = ["python"] roots = ["pyproject.toml", "setup.py", "poetry.lock", "pyrightconfig.json"] comment-token = "#" language-servers = [ "pylsp" ] From 844b0d3bbf9ae048e66c3230102f5abc9b41b379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:55:07 -0400 Subject: [PATCH 6/6] rm non-standard deno/bun hist recognition --- languages.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/languages.toml b/languages.toml index da8d66367a2c..12ca6023b374 100644 --- a/languages.toml +++ b/languages.toml @@ -709,9 +709,7 @@ name = "typescript" scope = "source.ts" injection-regex = "(ts|typescript)" language-id = "typescript" -file-types = ["ts", "mts", "cts"]#, { glob = ".deno_repl_history" }, { glob = ".bun_repl_history" }] -# Deno doesn't save hist-file by default: https://deno.land/x/manual@v1.36.4/tools/repl.md?source=#deno_repl_history -# Bun doesn't (yet) have a standard REPL history file (this info wasn't verified) +file-types = ["ts", "mts", "cts"] shebangs = ["deno", "bun", "ts-node"] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" }