fix: highlight C++ header extensions#9388
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @princepal9120 on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR updates syntax-highlighting filename resolution so .hpp, .hxx, and uppercase .H files map to the existing C++ grammar, with regression coverage for those extensions.
Concerns
- No blocking concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Rebased on top of warpdotdev#9388 (which added `hpp`, `hxx`, and the uppercase `H` form). This adds the rarer `h++` extension as well so the case list covers the full set of C++ header conventions, and extends the existing `cpp_header_extensions_resolve_to_cpp_language` test to include `header.h++`.
Rebased on top of #9388 (which landed \`hpp\`, \`hxx\`, and the uppercase \`H\` form, per @bnavetta's request). This keeps just the one delta from the original PR: adding \`h++\` to the match arm so the case list covers the full set of C++ header conventions, and extending the existing \`cpp_header_extensions_resolve_to_cpp_language\` test to include \`header.h++\`. \`h++\` is the rarer of the C++ header conventions but it's part of the canonical set (used in some older codebases and called out in the GNU coding style guidance for C++). ### Testing - Existing \`cpp_header_extensions_resolve_to_cpp_language\` test extended to include \`header.h++\`. - \`cargo fmt -p languages -- --check\` passes. - \`cargo test -p languages\` doesn't run locally for me (Metal toolchain unavailable on this machine — same situation as #9277), but CI should cover it. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries \`CHANGELOG-IMPROVEMENT\`: Recognize \`.h++\` files as C++ headers (in addition to \`.hpp\`, \`.hxx\`, and \`.H\` from #9388). Co-authored-by: anshul-garg27 <[email protected]>
## Description Fixes warpdotdev#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.
Rebased on top of warpdotdev#9388 (which landed \`hpp\`, \`hxx\`, and the uppercase \`H\` form, per @bnavetta's request). This keeps just the one delta from the original PR: adding \`h++\` to the match arm so the case list covers the full set of C++ header conventions, and extending the existing \`cpp_header_extensions_resolve_to_cpp_language\` test to include \`header.h++\`. \`h++\` is the rarer of the C++ header conventions but it's part of the canonical set (used in some older codebases and called out in the GNU coding style guidance for C++). ### Testing - Existing \`cpp_header_extensions_resolve_to_cpp_language\` test extended to include \`header.h++\`. - \`cargo fmt -p languages -- --check\` passes. - \`cargo test -p languages\` doesn't run locally for me (Metal toolchain unavailable on this machine — same situation as warpdotdev#9277), but CI should cover it. ### Server API No server changes. ### Agent Mode Not applicable. ### Changelog Entries \`CHANGELOG-IMPROVEMENT\`: Recognize \`.h++\` files as C++ headers (in addition to \`.hpp\`, \`.hxx\`, and \`.H\` from warpdotdev#9388). Co-authored-by: anshul-garg27 <[email protected]>
Fixes warpdotdev#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. - 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. - [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode CHANGELOG-BUG-FIX: Fixed missing syntax highlighting for C++ header files using `.hpp`, `.hxx`, or `.H` extensions.
## Description Fixes warpdotdev#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. # Conflicts: # crates/languages/src/lib.rs # crates/languages/src/lib_tests.rs
Cherry-picked from upstream: - fix: highlight C++ header extensions (warpdotdev#9388) - Run executable shell scripts in the terminal (warpdotdev#9503) - Revert schema generator binary recompilation fix (warpdotdev#9676) - Remove stray backticks from Windows installer README (warpdotdev#9691) - Fix chord shortcuts on Windows non-Latin keyboard layouts (warpdotdev#9476) - Scroll output with Page Up/Down from prompt (warpdotdev#9624) - Respect Markdown Viewer setting for .md links in AI rules/facts panel (warpdotdev#9699) - fix: disable reset grid checks for restored blocks on Windows (warpdotdev#9987) - add RedirectionGuard=no to windows-installer.iss (warpdotdev#9863) - Windows quake mode window correctly sized (warpdotdev#9891) - fix: update rand to 0.9.4 (GHSA-cq8v-f236-94qc) (warpdotdev#10060) - Fix diff button when Show code review button toggle is off (warpdotdev#9600) - Fix freshly cloned repo stuck in loading state (warpdotdev#9998) - Fix terminal text selection not auto-scrolling when dragging (warpdotdev#9448) - Resolve conflict markers from 3f0ac51 and edac651
Description
Fixes #9387.
Warp already maps
.hppand.hxxfiles 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 tolanguage_by_filenameso.hpp,.hxx, and uppercase.Hfiles resolve to the C++ grammar for highlighting.Testing
.hpp,.hxx, and.Hfilename resolution.git diff --checkcargo test -p languagesbecause this OpenClaw host does not currently havecargoinstalled.Agent Mode
Changelog Entries for Stable
CHANGELOG-BUG-FIX: Fixed missing syntax highlighting for C++ header files using
.hpp,.hxx, or.Hextensions.