From 6c4e66025e6163e423a199166d72fcb0767741c1 Mon Sep 17 00:00:00 2001 From: tingerrr Date: Fri, 17 May 2024 23:04:47 +0200 Subject: [PATCH 1/3] Add `py` as valid python injection regex --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 8776947a8c50..0f878a9ff928 100644 --- a/languages.toml +++ b/languages.toml @@ -824,7 +824,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-html", rev = "29f53 [[language]] name = "python" scope = "source.python" -injection-regex = "python" +injection-regex = "py(thon)?" 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"] From 4175a64dc0cabdcd63991be7b3d13805d5e5d3ad Mon Sep 17 00:00:00 2001 From: tingerrr Date: Fri, 17 May 2024 23:16:56 +0200 Subject: [PATCH 2/3] Add `hs` and `rs` for `haskell` and `rust` --- languages.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 0f878a9ff928..23305b1cb71f 100644 --- a/languages.toml +++ b/languages.toml @@ -223,7 +223,7 @@ mode = "location" [[language]] name = "rust" scope = "source.rust" -injection-regex = "rust" +injection-regex = "rs|rust" file-types = ["rs"] roots = ["Cargo.toml", "Cargo.lock"] shebangs = ["rust-script", "cargo"] @@ -1265,7 +1265,7 @@ source = { git = "https://github.com/ikatyang/tree-sitter-yaml", rev = "0e36bed1 [[language]] name = "haskell" scope = "source.haskell" -injection-regex = "haskell" +injection-regex = "hs|haskell" file-types = ["hs", "hs-boot"] roots = ["Setup.hs", "stack.yaml", "cabal.project"] comment-token = "--" From cee5515f249b3ddd3be4dfa3088a3e411128c79e Mon Sep 17 00:00:00 2001 From: tingerrr Date: Mon, 3 Jun 2024 11:47:53 +0200 Subject: [PATCH 3/3] Add `typ` injection regex for `typst` --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 23305b1cb71f..1e07a32dfd96 100644 --- a/languages.toml +++ b/languages.toml @@ -3155,7 +3155,7 @@ grammar = "html" [[language]] name = "typst" scope = "source.typst" -injection-regex = "typst" +injection-regex = "typ(st)?" file-types = ["typst", "typ"] comment-token = "//" language-servers = ["tinymist", "typst-lsp"]