From edc0809824393fe09f6d0a4eeb43f1505130f662 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 3 Jan 2025 18:02:05 +0100 Subject: [PATCH] feat: Add support for vim script --- Cargo.lock | 10 ++++++++++ harper-comments/Cargo.toml | 1 + harper-comments/src/comment_parser.rs | 2 ++ 3 files changed, 13 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 40f47aab..3190fae7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -589,6 +589,7 @@ dependencies = [ "tree-sitter-swift", "tree-sitter-toml", "tree-sitter-typescript", + "tree-sitter-vim", ] [[package]] @@ -1870,6 +1871,15 @@ dependencies = [ "tree-sitter", ] +[[package]] +name = "tree-sitter-vim" +version = "0.3.0" +source = "git+https://github.com/tree-sitter-grammars/tree-sitter-vim.git?tag=v0.3.0#1e0f794eb3d2a7f99d98dc1e6c178ad1e94a45af" +dependencies = [ + "cc", + "tree-sitter", +] + [[package]] name = "unicase" version = "2.8.0" diff --git a/harper-comments/Cargo.toml b/harper-comments/Cargo.toml index 15539bfa..6844ebcf 100644 --- a/harper-comments/Cargo.toml +++ b/harper-comments/Cargo.toml @@ -27,6 +27,7 @@ tree-sitter-lua = "0.0.19" tree-sitter-bash = "0.20.0" tree-sitter-java = "0.20.0" tree-sitter-nix = "0.0.1" +tree-sitter-vim = { git = "https://github.com/tree-sitter-grammars/tree-sitter-vim.git", tag = "v0.3.0" } itertools = "0.13.0" tree-sitter-haskell = "0.15.0" diff --git a/harper-comments/src/comment_parser.rs b/harper-comments/src/comment_parser.rs index aa1bf757..e2fda1dc 100644 --- a/harper-comments/src/comment_parser.rs +++ b/harper-comments/src/comment_parser.rs @@ -37,6 +37,7 @@ impl CommentParser { "shellscript" => tree_sitter_bash::language(), "java" => tree_sitter_java::language(), "haskell" => tree_sitter_haskell::language(), + "vim" => tree_sitter_vim::language(), _ => return None, }; @@ -87,6 +88,7 @@ impl CommentParser { "bash" => "shellscript", "java" => "java", "hs" => "haskell", + "vim" => "vim", _ => return None, }) }