Skip to content

Recognize .hpp/.hxx/.h++ as C++ headers#9346

Open
anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
anshul-garg27:fix/cpp-header-extensions
Open

Recognize .hpp/.hxx/.h++ as C++ headers#9346
anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
anshul-garg27:fix/cpp-header-extensions

Conversation

@anshul-garg27
Copy link
Copy Markdown

@anshul-garg27 anshul-garg27 commented Apr 29, 2026

Fixes #9387.

Description

language_by_filename in crates/languages/src/lib.rs recognizes .cpp, .cxx, .cc, .h, and .hh as C++, but not .hpp (or its rarer cousins .hxx and .h++). Modern C++ codebases — Boost, Qt, and most C++-only libraries — use .hpp precisely to distinguish C++ headers from plain C .h headers, so opening a Boost / .hpp header in Warp's editor today renders the "Language support is unavailable for this file type" footer instead of C++ syntax highlighting.

-        "cpp" | "cxx" | "cc" | "h" | "hh" => language_by_name("cpp"),
+        "cpp" | "cxx" | "cc" | "h" | "hh" | "hpp" | "hxx" | "h++" => language_by_name("cpp"),

Testing

Note on overlap with #9388

#9388 covers hpp | hxx | H (uppercase .H for case-sensitive filesystems); this PR covers hpp | hxx | h++. Happy to fold .H in 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.

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@oz-for-oss
Copy link
Copy Markdown

oz-for-oss Bot commented Apr 29, 2026

@anshul-garg27

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I approved this pull request and requested human review from: @vorporeal, @alokedesai, @zachbai.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@anshul-garg27
Copy link
Copy Markdown
Author

Heads-up — issue #9387 was filed earlier today for this exact bug, and #9388 covers a partly-overlapping set: hpp | hxx | H (uppercase .H for case-sensitive filesystems). This PR's set is hpp | hxx | h++. The two are easy to combine into hpp | hxx | h++ | H if helpful — happy to amend here, or fine to defer .H to a follow-up if the maintainers prefer keeping this PR as-is.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing syntax highlighting on hpp files

2 participants