Skip to content

lextudio/vscode-axaml

 
 

Repository files navigation

VSCode Tools for AXAML from LeXtudio Inc.

VS Code Marketplace Version Installs Downloads

Avalonia is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows via .NET Framework and .NET Core, Linux via Xorg and macOS. It uses AXAML format, which is a variant of XAML.

This Visual Studio Code Extension contains support for AXAML like autocompletion, live previewer, document outlines, etc.

Avalonia is a registered trademark of AvaloniaUI OÜ. This extension is independent and unaffiliated with Avalonia.

History

This repository is a fork of the original Avalonia for VS Code extension by Avalonia UI. Our goal is to actively maintain and enhance the developer experience in Visual Studio Code by:

  • Keeping the extension up to date with new Avalonia releases
  • Improving performance, reliability, and cross‑platform behavior
  • Adding new productivity features (outline view, visual designer, smarter completion, diagnostics, etc.)
  • Responding to community feedback and accelerating fixes

Issues and feature requests are welcome—your input helps shape the roadmap.

Follow the contribution guide if you want to help us build the extension.

Getting Started

Recommended Companion Extension

For consistent formatting of your AXAML files, we recommend optionally installing the community XAML Styler extension (dabbinavo.xamlstyler). The first time you use this extension you'll receive a prompt; you can also find it manually in the Extensions view by searching for "XAML Styler". This extension is optional—the AXAML features work without it.

Create a new Avalonia project

You can create a new Avalonia project directly from the Visual Studio Code

New Project

Additionally, you can create a project from the command line too, with the command:

dotnet new avalonia.app -o MyApp

This will create a new folder called MyApp with your application files. You can install Avalonia project templates with following command, if you do not have them installed already:

dotnet new install Avalonia.Templates

Finally open the MyApp folder in the VS Code, open any AXAML file to activate the extension and code completion.

NOTE: You must build the project once to enable code completion.

Enable Previewer

Previewer

After you load the project in the VS Code, you can click on Show Preview button on the editor toolbar (1)

The previewer will prompt you to build your project if needed.

The previewer will refresh when you switch between multiple xaml files, unlike Visual Studio for Windows or Rider, VS Code will reuse the single preview window.

  • New: the previewer supports a DPI‑aware scaling mode that renders crisper UI previews. When axaml.previewer.transportMode is set to tcp (the default), the previewer sends raw pixel frames over a TCP channel and the extension renders them on a canvas using the editor's DPI settings for sharper, correctly scaled output. With your mouse, hold Alt and scroll on the preview canvas to adjust the zoom level.
  • If you experience issues with embedded content or prefer the previewer's built‑in HTML server, set axaml.previewer.transportMode to html to embed the preview in an iframe instead.

XAML Code completion

Rich syntax highlighter and contextual code completion will make it lot easier to read and write AXAML files

Code completion

XAML Outlines

The AXAML files in the VS Code are showed with document outlines, allowing you to collapse and expand sections of your AXAML files for better readability.

Useful Commands

  • AXAML: Toggle verbose AXAML logs (axaml.toggleVerboseLogs)
  • AXAML: Show preview (axaml.showPreviewToSide)
  • AXAML: Create previewer assets (axaml.createPreviewerAssets)
  • AXAML: Create a new Avalonia Project (axaml.newProject)
  • AXAML: Show solution discovery info (axaml.showSolutionDiscoveryInfo)
  • AXAML: Open solution model JSON (axaml.openSolutionModelJson)

Settings Highlights

  • axaml.completion.buildConfigurationPreference – Preferred build configuration for completion (Debug / Release / Auto)
  • axaml.trace.verbose – Enable verbose AXAML server side logs (assembly scanning, metadata fallback)
  • axaml.trace.server – LSP protocol tracing (messages / verbose)
  • axaml.misc.suppressXamlStylerRecommendation – Suppress prompt recommending XAML Styler extension
  • axaml.previewer.emitBinlog – Emit MSBuild binary log when building previewer assets
  • axaml.previewer.runDotnetInfo – Run 'dotnet --info' before building previewer assets
  • axaml.previewer.transportMode – Previewer transport mode. Default is tcp: the previewer sends raw pixel frames over a TCP channel and the extension renders them on a canvas (provides crisper, DPI‑aware scaling). Set to html to embed the previewer's HTTP server in an iframe instead.

Language Servers

  • Default: the extension now uses the XamlToCSharpGenerator (AXSG) language server by default. AXSG focuses specifically on AXAML workflows and offers improved completion, inline C# projections, and tighter previewer integration.
  • Files targeted: the extension and AXSG are scoped to AXAML files only (file type axaml). They do not activate on generic xaml files.
  • To change the server: set axaml.languageServer to either XamlToCSharpGenerator or AxamlLanguageServer in your settings.
  • To point to a custom server binary or DLL, set axaml.languageServerPath to an absolute path; this overrides the axaml.languageServer selection.

NOTE: AXSG language server is created by Wiesław Šoltés, and released under MIT license. Axaml language server created by AvaloniaUI is not recommended but can be turned on if needed.

NOTE: AXSG language server is still an early preview. It might experience instability such as

  • Report many warnings (in AXSG0111 category or others). Please ignore them.
  • Long delay before the first change to semantic highlighting and completion.
  • The experimental hot reload based previewer integration is disabled due to stability issues. Please use the existing TCP or HTML transport previewer integration instead.

You can report directly to this repo.

Feature Comparison

This includes a short feature comparison between the two language servers shipped with the extension.

Feature AxamlLanguageServer AXSG/XamlToCSharpGenerator (default)
Completion Yes — engine-backed, lightweight; initializes metadata from project assembly when available Yes — richer, project/semantic-aware completions via language service
Hover / Quick info Yes (standard handlers) Yes (semantic, can include generated C# projection data)
Document symbols / outline Yes (DocumentSymbolHandler, XmlOutlineHelper) Yes (semantic model-driven symbols)
Go-to-definition / References / Rename Basic go-to (file-level/project metadata dependent) Full project-aware navigation, references, rename/refactor support via Roslyn integration
Semantic tokens Not primary; basic syntax features provided Supported (semantic engine provides richer tokens/semantic coloring)
Inline C# projection No (focuses on AXAML editing) Supported (projects show inline C# projection / mapping in some flows)
Code generation (XAML→C#) Not core responsibility (editor assistance only) Core capability (Xaml→C# generator toolchain integrated)
Project awareness Limited (reads simple project metadata / assembly) High (MSBuild/Roslyn-aware, works with full project model)
Footprint / startup Lightweight, smaller binary set Heavier — many assemblies, larger runtime requirements
Runtime requirements .NET runtime (packaged .dll under axamlServer) .NET runtime + MSBuild/Roslyn runtime pieces; recommended as installed tool or packaged axsgServer
Update path / extensibility Source present in repo — easy to modify and rebuild Packaged binaries shipped with extension; source available in XamlToCSharpGenerator/ but typically published as artifacts
Typical use-case Fast editor features for AXAML editing; easy to inspect and patch Deep project-aware language service, codegen, and advanced refactor/navigation
Status Stable Early preview (expect warnings, some instability, etc.)

Release Notes

Detailed information can be found on this page.


Copyright (c) 2023 AvaloniaUI
Copyright (c) 2025-2026 LeXtudio Inc.
Copyright (c) 2026 Wiesław Šoltés

Packages

 
 
 

Contributors

Languages

  • TypeScript 68.8%
  • C# 24.1%
  • JavaScript 5.1%
  • Shell 2.0%