Skip to content

[Feature]: syntax highlighting for .xaml files (WPF/MAUI) #16396

Closed

Description

@smaucy

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.

Activity

  1. added
    enhancement
    on Sep 19, 2026
  2. added theissue type on Sep 19, 2026
  3. nwparker commented on Sep 27, 2026

    @nwparker
    Contributor

    Resolved by merged #23371: .xaml files now use Monaco's built-in XML highlighting, including uppercase extensions and Windows paths.

    Thanks @smaucy for the detailed report and @psh4607 for the focused implementation and regression cases in #16530. Both are credited in #23371, and I verified the normal and uppercase Windows cases before closing. The fix will be available in a release containing #23371; it does not add special tokenization inside {Binding ...} or other markup-extension attribute values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions