[GH-ISSUE #210] bug: C++ syntax highlighting is missing for common file extensions #125

Closed
opened 2026-10-18 14:03:10 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @satouriko on GitHub (Aug 1, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/210

Description

The workspace editor recognizes .cpp and .hpp files as C++, but other common C++ extensions are not assigned a language. Files such as .cc, .cxx, .hh, and .hxx therefore open without C++ syntax highlighting even though the frontend already supports the cpp language identifier.

Steps to reproduce

  1. Open a workspace containing a C++ file named with one of these extensions: .cc, .cxx, .hh, or .hxx.
  2. Open the file in the workspace editor.
  3. Observe that C++ syntax highlighting is not applied.

Expected behavior

These common C++ source and header extensions should use the existing C++ syntax highlighting support.

Proposed fix

Add .cc, .cxx, .hh, and .hxx to TEXT_EXTENSIONS and map them to cpp in _detect_language.

A minimal implementation based on the current main branch is available here:

github.com/satouriko/computer@1f8441c50a

It has been checked with:

  • ruff 0.15.16 format --check cptr/routers/workspace.py
  • python -m py_compile cptr/routers/workspace.py
  • focused checks confirming that each added extension resolves to cpp
Originally created by @satouriko on GitHub (Aug 1, 2026). Original GitHub issue: https://github.com/open-webui/computer/issues/210 ## Description The workspace editor recognizes `.cpp` and `.hpp` files as C++, but other common C++ extensions are not assigned a language. Files such as `.cc`, `.cxx`, `.hh`, and `.hxx` therefore open without C++ syntax highlighting even though the frontend already supports the `cpp` language identifier. ## Steps to reproduce 1. Open a workspace containing a C++ file named with one of these extensions: `.cc`, `.cxx`, `.hh`, or `.hxx`. 2. Open the file in the workspace editor. 3. Observe that C++ syntax highlighting is not applied. ## Expected behavior These common C++ source and header extensions should use the existing C++ syntax highlighting support. ## Proposed fix Add `.cc`, `.cxx`, `.hh`, and `.hxx` to `TEXT_EXTENSIONS` and map them to `cpp` in `_detect_language`. A minimal implementation based on the current `main` branch is available here: https://github.com/satouriko/computer/commit/1f8441c50a9aa490d87eb1f8bc177dee64e66e0e It has been checked with: - `ruff 0.15.16 format --check cptr/routers/workspace.py` - `python -m py_compile cptr/routers/workspace.py` - focused checks confirming that each added extension resolves to `cpp`
Author
Owner

@owui-terminator[bot] commented on GitHub (Aug 1, 2026):

⚠️ Missing Issue Title Prefix

@satouriko, your issue title is missing a categorising prefix (e.g. bug:, feat:, docs:).

Please update the title to lead with one of:

  • bug: bug report or error
  • feat: feature request or enhancement
  • docs: documentation issue
  • question: usage question
  • help: support request

Example: bug: Login fails when the password contains special characters

<!-- gh-comment-id:5150703514 --> @owui-terminator[bot] commented on GitHub (Aug 1, 2026): # ⚠️ Missing Issue Title Prefix @satouriko, your issue title is missing a categorising prefix (e.g. `bug:`, `feat:`, `docs:`). Please update the title to lead with one of: - **bug**: bug report or error - **feat**: feature request or enhancement - **docs**: documentation issue - **question**: usage question - **help**: support request Example: `bug: Login fails when the password contains special characters`
Author
Owner

@tjbck commented on GitHub (Aug 5, 2026):

Addressed!

<!-- gh-comment-id:5187609583 --> @tjbck commented on GitHub (Aug 5, 2026): Addressed!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/computer#125
No description provided.