microsoft / microsoft/WinAppVSCE

XAML Language Server: Basic C++/WinRT project support (syntactic features)

Open
#221 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
13
Forks
4
Avg merge
6d 1h
Merged PRs (30d)
11

Description

Summary

The XAML language server currently only discovers .csproj files and relies entirely on Roslyn for type resolution, making it non-functional for C++/WinRT WinUI projects. Even Visual Studio's XAML IntelliSense has limited C++ support, so full parity isn't the goal — but we should provide syntactic features and a good UX for C++ developers.

Short-term wins (target: PR #50)

1. Detect .vcxproj alongside .csproj in project discovery

XamlProjectResolver.FindOwningProject() hardcodes *.csproj. Add *.vcxproj so C++ WinUI projects are at least recognized.

2. Graceful degradation when Roslyn can't load the project

When project discovery finds a .vcxproj, skip Roslyn loading and return a partial XamlResolution with classSymbol = null. Most features already handle null gracefully — verify they do and fix any that don't.

3. Syntactic features should work for C++ projects

These require no type system and should work automatically once project detection doesn't block:

  • Formatting (document + range)
  • Folding ranges
  • Color swatches (hex values)
  • Selection range expansion
  • x:Name / x:Key hover, rename, references
  • Document symbols
  • Linked editing (tag pair sync)
  • Syntax highlighting (TextMate grammar — already works)
4. Notification for reduced IntelliSense

When a C++/WinRT project is detected, show a one-time informational message explaining that type-aware features (completion, diagnostics, go-to-definition for types) are limited for C++ projects.

What won't work (expected)

  • Element/property type completion (requires type system)
  • Semantic diagnostics (unknown type, unknown property, etc.)
  • x:Bind path resolution
  • Event handler go-to-definition
  • Code actions (quick fixes)

These are tracked in #222 for WinMD-based type resolution (two approach options documented there).

Research context

  • No third-party VS Code extensions provide C++ WinUI XAML IntelliSense — we'd be the first
  • Even Visual Studio's C++ XAML support is limited — relies on build-time .winmd + XamlCompiler output, not live analysis
  • C++/WinRT is a smaller fraction of WinUI developers, so pragmatic degradation is acceptable
  • The C++/WinRT build chain: .idl → MIDLRT → .winmd → XAML compiler reads .winmd for type resolution

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with XamlProjectResolver.FindOwningProject() and trace how discovered projects flow into Roslyn loading and XamlResolution. Verify which syntactic features already tolerate classSymbol = null, then check the existing notification path for reduced IntelliSense. Done means .vcxproj projects are recognized, unsupported type-aware features degrade without errors, and the listed syntactic features remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.