[Feature]: syntax highlighting for .xaml files (WPF/MAUI)
- Dominant language
- TypeScript
- Stars
- 69.7k
- Forks
- 4.5k
- Avg merge
- 15h 28m
- Merged PRs (30d)
- 471
Description
### Problem or use case
XAML files (WPF, .NET MAUI, WinUI) render as plain text in Orca's editor — no syntax highlighting at all. `detectLanguage()` in `src/renderer/src/lib/language-detect.ts` has no `.xaml` entry, so XAML files fall through to `'plaintext'`.
XAML is XML, and Monaco ships a solid built-in `xml` language (tags, attribute names/values, comments, CDATA) that would already make XAML files readable — the same approach Orca already uses for `.jsp`/`.jspf → html`.
### Proposed solution
Add `.xaml: 'xml'` to `EXT_TO_LANGUAGE` in `src/renderer/src/lib/language-detect.ts`, plus a test entry — mirroring the existing `.jsp` → `html` mapping (#12402).
This immediately colors tags, attribute names, values and comments. Known limitation: markup extensions such as `{Binding Path=...}`, `{StaticResource ...}` or `x:TypeArguments` stay single-colored inside attribute values.
Longer term, a dedicated XAML language registration (Monarch tokenizer like `register-vue.ts`, or a TextMate grammar like the bundled Nim grammar) could also highlight `{Binding ...}` markup extensions, `x:` directives and attached properties — but the one-line mapping above would already be a large quality-of-life win for .NET developers.
### Alternatives or additional context
- Affected users: anyone editing WPF / .NET MAUI / WinUI XAML in Orca. `.cs` is already mapped; XAML is the missing half of the C# workflow.
- No in-app workaround exists today; users must switch to VS Code/Rider for XAML.
- Monaco's `xml` language needs no worker, so there is no runtime cost to the mapping.
Contributor guide
Research direction
Start at detectLanguage() and the EXT_TO_LANGUAGE map in src/renderer/src/lib/language-detect.ts, then mirror the existing .jsp → html mapping in the language-detection test entry. Done means .xaml resolves to xml so XAML files receive Monaco's built-in XML highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 90/100