mirror of
https://github.com/openai/codex.git
synced 2026-11-05 16:29:31 +00:00
Highlight CUDA files as C++ in the TUI (#34570)
## What changed - Map `.cu` and `.cuh` extensions to the C++ syntax definition so CUDA source and header files receive syntax highlighting. - Extend syntax lookup and rendered-diff tests to cover both extensions. GitOrigin-RevId: 5484ea9e30f9e4df788b0079596ec0239e8ef8d5
This commit is contained in:
1 parent
0b175e6439
commit
726689564a
3 files changed
+42
-29
No files matched your search
@@ -539,6 +539,8 @@ fn find_syntax(lang: &str) -> Option<&'static SyntaxReference> {
|
||||
let normalized = lang.to_ascii_lowercase();
|
||||
let patched = match normalized.as_str() {
|
||||
"csharp" | "c-sharp" => "c#",
|
||||
// CUDA source (.cu) and header (.cuh) files use C++ highlighting as a fallback.
|
||||
"cu" | "cuh" => "cpp",
|
||||
"cppm" | "cxxm" | "ixx" => "cpp",
|
||||
"golang" => "go",
|
||||
"python3" => "python",
|
||||
@@ -1216,8 +1218,8 @@ mod tests {
|
||||
}
|
||||
// Patched aliases that two-face cannot resolve on its own.
|
||||
for alias in [
|
||||
"csharp", "c-sharp", "cppm", "CPPM", "cxxm", "CxXm", "ixx", "IXX", "golang", "python3",
|
||||
"shell",
|
||||
"csharp", "c-sharp", "cu", "cuh", "cppm", "CPPM", "cxxm", "CxXm", "ixx", "IXX",
|
||||
"golang", "python3", "shell",
|
||||
] {
|
||||
assert!(
|
||||
find_syntax(alias).is_some(),
|
||||
|
||||
Reference in new issue
Block a user