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

Aperta
#7,068 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
TypeScript
Stelle
35k
Fork
3.1k
Merge medio
1g 13h
PR unite (30g)
228

Descrizione

## 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).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start in the Console frontend's file viewer and trace its language-detection and syntax-highlighting integration. Check whether Prism, Highlight.js, Shiki, or CodeMirror is used, then verify mappings for .cs and the listed shader extensions; done means supported files are highlighted while unknown extensions retain the existing plain-text fallback.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
frontend, game-dev
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
66/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.