Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add stop words / repository context support for C/C++ #744

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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++ | 🚫 | 🚫 |
Squadrick marked this conversation as resolved.
Show resolved Hide resolved
| C# | 🚫 | 🚫 |
| CSS | 🚫 | 🚫 |
| Haskell | 🚫 | 🚫 |
Expand Down
Loading