From 5870c7947ad888b9e8a47874c602355f16ef4f18 Mon Sep 17 00:00:00 2001 From: Tyler Burnett <11090043+TylerBurnett@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:29:34 +1000 Subject: [PATCH] feat(scheduler, docs): Add repo context support for C#, added language to supported list in docs --- Cargo.lock | 11 +++++++++++ crates/tabby-scheduler/Cargo.toml | 1 + crates/tabby-scheduler/queries/csharp.scm | 19 +++++++++++++++++++ crates/tabby-scheduler/src/dataset/tags.rs | 11 +++++++++++ website/docs/programming-languages.md | 2 +- 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 crates/tabby-scheduler/queries/csharp.scm diff --git a/Cargo.lock b/Cargo.lock index 7d872e0cca34..e2605fafcf77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3901,6 +3901,7 @@ dependencies = [ "tracing", "tracing-test", "tree-sitter-c", + "tree-sitter-c-sharp", "tree-sitter-cpp", "tree-sitter-go", "tree-sitter-java", @@ -4720,6 +4721,16 @@ dependencies = [ "tree-sitter", ] +[[package]] +name = "tree-sitter-c-sharp" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ab3dc608f34924fa9e10533a95f62dbc14b6de0ddd7107722eba66fe19ae31" +dependencies = [ + "cc", + "tree-sitter", +] + [[package]] name = "tree-sitter-cpp" version = "0.20.3" diff --git a/crates/tabby-scheduler/Cargo.toml b/crates/tabby-scheduler/Cargo.toml index c9d3990be0ca..c6f4d1fb070c 100644 --- a/crates/tabby-scheduler/Cargo.toml +++ b/crates/tabby-scheduler/Cargo.toml @@ -22,6 +22,7 @@ tree-sitter-go = "0.20.0" tree-sitter-ruby = "0.20.0" tree-sitter-c = { git = "https://github.com/tree-sitter/tree-sitter-c/", rev = "212a80f" } tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "a714740" } +tree-sitter-c-sharp = "0.20.0" ignore = "0.4.20" kdam = { version = "0.5.0" } requirements = "0.3.0" diff --git a/crates/tabby-scheduler/queries/csharp.scm b/crates/tabby-scheduler/queries/csharp.scm new file mode 100644 index 000000000000..e49897aa9750 --- /dev/null +++ b/crates/tabby-scheduler/queries/csharp.scm @@ -0,0 +1,19 @@ +( + (class_declaration (identifier) @name) @definition.class +) + +( + (struct_declaration (identifier) @name) @definition.struct +) + +( + (method_declaration (identifier) @name) @definition.method +) + +( + (interface_declaration (identifier) @name) @definition.interface +) + +( + (local_function_statement (identifier) @name) @definition.function +) \ No newline at end of file diff --git a/crates/tabby-scheduler/src/dataset/tags.rs b/crates/tabby-scheduler/src/dataset/tags.rs index 57756c8f422b..1f7a85594ad5 100644 --- a/crates/tabby-scheduler/src/dataset/tags.rs +++ b/crates/tabby-scheduler/src/dataset/tags.rs @@ -142,6 +142,17 @@ lazy_static! { .unwrap(), ), ), + ( + "csharp", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_c_sharp::language(), + include_str!("../../queries/csharp.scm"), + "", + ) + .unwrap(), + ), + ), ]) }; } diff --git a/website/docs/programming-languages.md b/website/docs/programming-languages.md index bf42b9f78afa..efa8370df650 100644 --- a/website/docs/programming-languages.md +++ b/website/docs/programming-languages.md @@ -31,12 +31,12 @@ For an actual example of an issue or pull request adding the above support, plea * [Kotlin](https://www.kotlinlang.org/) * [C/C++](https://cplusplus.com/), since v0.8.0 * [PHP](https://www.php.net/): Since v0.8.0 +* [C#](https://learn.microsoft.com/en-us/dotnet/csharp/): Since v0.9.0 ## Languages Missing Certain Support | Language | Stop Words (time to contribute: <5 min) | Repository Context (time to contribute: <1 hr) | | :------: | :-------------------------------------: | :--------------------------------------------: | -| C# | 🚫 | 🚫 | | CSS | 🚫 | 🚫 | | Haskell | 🚫 | 🚫 | | Julia | 🚫 | 🚫 |