Support C++ header file extensions (.hpp, .hh, .hxx, .h++) in LSP language detection #8808

Open
opened 2026-02-16 18:10:54 -05:00 by yindo · 1 comment
Owner

Originally created by @Huijiro on GitHub (Feb 7, 2026).

Originally assigned to: @rekram1-node on GitHub.

Problem

C++ projects commonly use header file extensions like .hpp, .hh, .hxx, and .h++ in addition to the standard .h extension. These are already supported by the clangd LSP server and clang-format formatter, but they're not currently mapped in the LSP language detection system.

Solution

Map these additional C++ header file extensions to the cpp language type in LANGUAGE_EXTENSIONS so they receive proper syntax highlighting and LSP support.

Originally created by @Huijiro on GitHub (Feb 7, 2026). Originally assigned to: @rekram1-node on GitHub. ## Problem C++ projects commonly use header file extensions like `.hpp`, `.hh`, `.hxx`, and `.h++` in addition to the standard `.h` extension. These are already supported by the clangd LSP server and clang-format formatter, but they're not currently mapped in the LSP language detection system. ## Solution Map these additional C++ header file extensions to the `cpp` language type in `LANGUAGE_EXTENSIONS` so they receive proper syntax highlighting and LSP support.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 7, 2026):

This issue is related to several existing issues around C++ and LSP support:

  • #7780: LSP support for choosing between multiple build directories (c++ / clangd)
  • #9521: clangd LSP always fails
  • #11617: Clangd LSP set incorrect root and missing arguments
  • #3431: Formatter enhanced file extension matching (demonstrates file extension pattern matching needs)

While these aren't exact duplicates, they represent related challenges in improving C++ language support and file extension detection in OpenCode. You may find context useful when implementing this feature.

@github-actions[bot] commented on GitHub (Feb 7, 2026): This issue is related to several existing issues around C++ and LSP support: - #7780: LSP support for choosing between multiple build directories (c++ / clangd) - #9521: clangd LSP always fails - #11617: Clangd LSP set incorrect root and missing arguments - #3431: Formatter enhanced file extension matching (demonstrates file extension pattern matching needs) While these aren't exact duplicates, they represent related challenges in improving C++ language support and file extension detection in OpenCode. You may find context useful when implementing this feature.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8808