fix: highlight C++ header extensions (#9388)
## Description Fixes #9387. Warp already maps `.hpp` and `.hxx` files to C++ in the LSP and file icon paths, but the syntax-highlighting language resolver only handled `.cpp`, `.cxx`, `.cc`, `.h`, and `.hh`. This adds the missing C++ header extensions to `language_by_filename` so `.hpp`, `.hxx`, and uppercase `.H` files resolve to the C++ grammar for highlighting. ## Testing - Added a regression test for `.hpp`, `.hxx`, and `.H` filename resolution. - `git diff --check` - Not run: `cargo test -p languages` because this OpenClaw host does not currently have `cargo` installed. ## Agent Mode - [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode ## Changelog Entries for Stable CHANGELOG-BUG-FIX: Fixed missing syntax highlighting for C++ header files using `.hpp`, `.hxx`, or `.H` extensions.
This commit is contained in:
@@ -152,7 +152,7 @@ pub fn language_by_filename(path: &Path) -> Option<Arc<Language>> {
|
||||
"tsx" => language_by_name("tsx"),
|
||||
"ts" | "cts" | "mts" => language_by_name("typescript"),
|
||||
"java" | "groovy" | "gvy" | "gy" | "gsh" => language_by_name("java"),
|
||||
"cpp" | "cxx" | "cc" | "h" | "hh" => language_by_name("cpp"),
|
||||
"cpp" | "cxx" | "cc" | "h" | "hh" | "hpp" | "hxx" | "H" => language_by_name("cpp"),
|
||||
"sh" | "zsh" | "bash" => language_by_name("shell"),
|
||||
"cs" => language_by_name("csharp"),
|
||||
"html" => language_by_name("html"),
|
||||
|
||||
Reference in New Issue
Block a user