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
- Open a workspace containing a C++ file named with one of these extensions:
.cc, .cxx, .hh, or .hxx.
- Open the file in the workspace editor.
- 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:
satouriko@1f8441c
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
Description
The workspace editor recognizes
.cppand.hppfiles as C++, but other common C++ extensions are not assigned a language. Files such as.cc,.cxx,.hh, and.hxxtherefore open without C++ syntax highlighting even though the frontend already supports thecpplanguage identifier.Steps to reproduce
.cc,.cxx,.hh, or.hxx.Expected behavior
These common C++ source and header extensions should use the existing C++ syntax highlighting support.
Proposed fix
Add
.cc,.cxx,.hh, and.hxxtoTEXT_EXTENSIONSand map them tocppin_detect_language.A minimal implementation based on the current
mainbranch is available here:satouriko@1f8441c
It has been checked with:
ruff 0.15.16 format --check cptr/routers/workspace.pypython -m py_compile cptr/routers/workspace.pycpp