# Source-code syntax highlighting

The shipped Ace core file was truncated (151,040 bytes instead of the complete 907,754-byte asset). It could not parse, so Collaborations, Student Projects and Code Online fell back to plain text. The complete original vendor asset has been restored and all bundled Ace JavaScript files pass syntax compilation.

Collaborations and Student Projects use a shared file-language detector. Code Online uses the same detector with its selected runtime as fallback. The older extracted-submission code preview now opens a read-only Ace viewer with line numbers and language-aware colours. Source is treated as text and never executed; source values are not reformatted or changed. Existing save/conflict/history controls remain in place.

Detection covers PHP, JavaScript/TypeScript/JSX/TSX, Python, C/C++, C#, Java, Dart, Go, Rust, Ruby, HTML/Vue, CSS/SCSS/Sass/Less, JSON/JSON5, YAML, XML/SVG, SQL, Markdown, shell/PowerShell and other bundled modes. Dockerfile, Makefile and environment/ignore files are recognised. Unsupported file types remain plain text. No external highlighting service is required.

Copy the cumulative package preserving local settings and uploads. In particular update shared/vendor/ace/ace.js, shared/views/module_shell.php, shared/js/code-languages.js, the project/Code Online scripts and the new legacy code viewer files. Refresh Ctrl+F5 to clear the previously cached broken editor. No SQL migration required.

Automated tests compile the Ace assets, check language detection and real Ace tokenisation for common languages, verify that token values reconstruct the original source exactly, and check the read-only preview plus existing collaboration/student-project workflows. A live browser/XAMPP render was not available for visual verification.
