agentscope-ai / agentscope-ai/QwenPaw

[Feature]: File/script viewer should support more languages — C# and shader files (.shader/.gdshader/.hlsl etc.) for game-dev workflows

Open
#7,068 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
34.9k
Forks
3.1k
Avg merge
1d 15h
Merged PRs (30d)
225

Description

## Summary

The built-in file/script viewer in the Console/QwenPaw desktop app only renders code for a limited set of languages (JS/TS, Python, etc.). Other very common languages — notably C# and shader scripts — are not supported, so they display as plain/unreadable text. This is inconvenient for game developers working with Unity, Godot, or custom engines.

## Component(s) Affected

- [ ] Core / Backend (app, agents, config, providers, utils, local_models)
- [x] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy

## Problem / Motivation

When the agent reads or writes files, the Console's file viewer is the main way to inspect code in context. Currently it only syntax-highlights a small set of languages (JavaScript/TypeScript, Python, and similar web/stack languages).

For game development this falls short. Two everyday file categories are unsupported:

- **C# (`.cs`)** — the primary scripting language for Unity and a common one for Godot (.NET) and tooling.
- **Shader scripts** — e.g. `.shader` / `.cginc` / `.hlsl` (Unity/ShaderLab+HLSL), `.gdshader` (Godot), `.glsl`, `.wgsl`. These are core deliverables in game-dev agent workflows.

Without highlighting, reviewing long shaders or C# scripts in the viewer is error-prone — brackets, keywords, and comments all blend together, and it slows down iteration on agent-generated code.

Who benefits: game developers (Unity/Godot/custom engine), and more generally anyone working outside the JS/Python ecosystem (C/C++, Rust, Go, Java, GDScript, HLSL/GLSL, etc.).

## Proposed Solution

Extend the file viewer's language detection + highlighting to cover additional languages, prioritising game-dev formats:

- **C#** (`.cs`)
- **ShaderLab / HLSL** (`.shader`, `.cginc`, `.hlsl`)
- **Godot shader language** (`.gdshader`)
- **GLSL** (`.glsl`, `.vert`, `.frag`)
- **WGSL** (`.wgsl`)
- Ideally also: **GDScript** (`.gd`), **C/C++** (`.c`, `.cpp`, `.h`, `.hpp`)

Implementation-wise this is likely straightforward if the viewer uses a common highlighter:

- If it uses Prism / Highlight.js / Shiki / CodeMirror — most of these already ship grammars for C#, HLSL, GLSL, and GDScript; WGSL has community grammars. It may just be a matter of registering more languages and mapping file extensions to them.
- ShaderLab (`.shader`) may need a small custom grammar or a fallback mapping to HLSL/CG highlighting, which is close enough for readability.
- A graceful fallback to plain text (which already exists) can remain for unknown extensions.

## Alternatives Considered

- Copying file contents into an external editor to read them — works, but breaks the review flow and defeats the purpose of the built-in viewer.
- Renaming files to supported extensions as a hack (e.g. `.shader` → `.js`) — impractical and pollutes real projects.

## Additional Context

Example file types a game-dev agent session regularly produces or edits:

```text
Unity: PlayerController.cs, HologramShield.shader, Dissolve.hlsl, Lighting.cginc
Godot: Bubble.gdshader, Player.gd, Waterfall.gdshader
General: main.cpp, renderer.h, compute.wgsl, skybox.glsl
```

Most editors (VS Code, JetBrains, GitHub web UI) ship highlighting for all of these out of the box, so users coming from those tools notice the gap quickly.

## Willing to Contribute

- [x] I am willing to open a PR for this feature (after discussion).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.