Skip to content

fix: highlight C++ header extensions#9388

Merged
bnavetta merged 1 commit intowarpdotdev:masterfrom
princepal9120:prince/fix-hpp-syntax-highlighting
Apr 29, 2026
Merged

fix: highlight C++ header extensions#9388
bnavetta merged 1 commit intowarpdotdev:masterfrom
princepal9120:prince/fix-hpp-syntax-highlighting

Conversation

@princepal9120
Copy link
Copy Markdown
Contributor

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.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

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 @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@princepal9120

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 /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
Contributor

@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 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

@princepal9120
Copy link
Copy Markdown
Contributor Author

@cla-bot check

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

cla-bot Bot commented Apr 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Copy Markdown
Contributor

@bnavetta bnavetta left a comment

Choose a reason for hiding this comment

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

Thanks!

@bnavetta bnavetta merged commit 3f0ac51 into warpdotdev:master Apr 29, 2026
34 checks passed
anshul-garg27 added a commit to anshul-garg27/warp that referenced this pull request Apr 29, 2026
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++`.
bnavetta pushed a commit that referenced this pull request Apr 29, 2026
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]>
@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Dev Github Integration
zerx-lab pushed a commit to zerx-lab/warp that referenced this pull request May 3, 2026
## 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.
zerx-lab pushed a commit to zerx-lab/warp that referenced this pull request May 3, 2026
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]>
Leejaywell pushed a commit to Leejaywell/warp that referenced this pull request May 5, 2026
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.
Leejaywell pushed a commit to Leejaywell/warp that referenced this pull request May 5, 2026
## 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
Leejaywell added a commit to Leejaywell/warp that referenced this pull request May 5, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing syntax highlighting on hpp files

3 participants