Skip to content

Commit

Permalink
feat: add stop words / repository context support for C/C++ (#744)
Browse files Browse the repository at this point in the history
  • Loading branch information
Squadrick authored Dec 16, 2023
1 parent 3a33249 commit 5c4f8de
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 3 deletions.
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions crates/tabby-common/assets/languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,43 @@ top_level_keywords = [
"self",
]

[[config]]
languages = ["c"]
line_comment = "//"
top_level_keywords = [
"const",
"enum",
"extern",
"inline",
"register",
"static",
"struct",
"typedef",
"union",
"volatile",
]

[[config]]
languages = ["cpp"]
line_comment = "//"
top_level_keywords = [
"auto",
"class",
"const",
"concept",
"enum",
"extern",
"inline",
"namespace",
"register",
"static",
"struct",
"template",
"typedef",
"union",
"volatile",
]

[[config]]
languages = ["csharp"]
line_comment = "//"
Expand Down
4 changes: 3 additions & 1 deletion crates/tabby-scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ tree-sitter-kotlin = "0.3.1"
tree-sitter-rust = "0.20.3"
tree-sitter-typescript = "0.20.3"
tree-sitter-go = "0.20.0"
tree-sitter-ruby= "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" }
ignore = "0.4.20"
kdam = { version = "0.5.0" }
requirements = "0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/tabby-scheduler/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ lazy_static! {
("csharp", vec!["cs"]),
(
"cpp",
vec!["cpp", "hpp", "c++", "h++", "cc", "hh", "C", "H"],
vec!["cpp", "hpp", "c++", "h++", "cc", "hh", "C", "H", "tcc"],
),
("css", vec!["css"]),
("dockerfile", vec!["Dockerfile"]),
Expand Down
22 changes: 22 additions & 0 deletions crates/tabby-scheduler/src/dataset/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,28 @@ lazy_static! {
.unwrap(),
),
),
(
"c",
TagsConfigurationSync(
TagsConfiguration::new(
tree_sitter_c::language(),
tree_sitter_c::TAGS_QUERY,
"",
)
.unwrap(),
),
),
(
"cpp",
TagsConfigurationSync(
TagsConfiguration::new(
tree_sitter_cpp::language(),
tree_sitter_cpp::TAGS_QUERY,
"",
)
.unwrap(),
),
),
])
};
}
2 changes: 1 addition & 1 deletion website/docs/programming-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ For an actual example of an issue or pull request adding the above support, plea
* [Ruby](https://www.ruby-lang.org/)
* [Java](https://www.java.com/)
* [Kotlin](https://www.kotlinlang.org/)
* [C/C++](https://cplusplus.com/), since v0.8.0

## Languages Missing Certain Support

| Language | Stop Words (time to contribute: <5 min) | Repository Context (time to contribute: <1 hr) |
| :------: | :-------------------------------------: | :--------------------------------------------: |
| C/C++ | 🚫 | 🚫 |
| C# | 🚫 | 🚫 |
| CSS | 🚫 | 🚫 |
| Haskell | 🚫 | 🚫 |
Expand Down

0 comments on commit 5c4f8de

Please sign in to comment.