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

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

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

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.

2 participants