Recognize .hpp/.hxx/.h++ as C++ headers#9346
Recognize .hpp/.hxx/.h++ as C++ headers#9346anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
Conversation
|
I'm starting a first review of this pull request. You can follow along in the session on Warp. I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested. Comment I approved this pull request and requested human review from: @vorporeal, @alokedesai, @zachbai. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR maps .hpp, .hxx, and .h++ file extensions to the existing C++ language support and adds a unit test covering the new extensions.
Concerns
- No blocking correctness, security, error handling, or performance 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
There was a problem hiding this comment.
Overview
This PR maps .hpp, .hxx, and .h++ filename extensions to the existing C++ language support and adds a unit test covering those new header extensions.
Concerns
- No blocking correctness, security, error-handling, or performance 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
|
Heads-up — issue #9387 was filed earlier today for this exact bug, and #9388 covers a partly-overlapping set: If this lands first it will close #9387 too (linked via the new "Fixes #9387" trailer once added). Pushed an updated body with the issue link. |
Fixes #9387.
Description
language_by_filenameincrates/languages/src/lib.rsrecognizes.cpp,.cxx,.cc,.h, and.hhas C++, but not.hpp(or its rarer cousins.hxxand.h++). Modern C++ codebases — Boost, Qt, and most C++-only libraries — use.hppprecisely to distinguish C++ headers from plain C.hheaders, so opening a Boost /.hppheader in Warp's editor today renders the "Language support is unavailable for this file type" footer instead of C++ syntax highlighting.Testing
cpp_header_extensions_resolve_to_cppincrates/languages/src/lib_tests.rscovering all three new extensions; fails on master, passes after the change.cargo fmt -p languages -- --checkpasses locally.~inwarp://action/new_tab?path=URLs #9277, Recognize .command files as shell scripts #9345), so relying on CI for the full clippy / nextest pass.Note on overlap with #9388
#9388 covers
hpp | hxx | H(uppercase.Hfor case-sensitive filesystems); this PR covershpp | hxx | h++. Happy to fold.Hin here if the maintainers prefer landing a single combined PR — otherwise either landing first and a small follow-up for the missing extension works.Changelog Entries for Stable
CHANGELOG-IMPROVEMENT: C++ headers using `.hpp`, `.hxx`, or `.h++` now open with C++ syntax highlighting in Warp's editor.