UQML for VS Code
Language support for UQML — a declarative, reactive language for Unity. UI
Toolkit is its primary target, but the language is general-purpose and also
describes non-visual, reactive objects. Compiles .uqml files to C#.
Powered by the uqml-lsp language server, bundled with the extension — no .NET
install required.
What .uqml looks like
using UnityEngine.UIElements
using Uqml
public VisualElement {
id: root
property int count: 0
property float glow: 1
signal capped(value: int) // an event this element can emit
method increment() { // a method — callable from handlers
count = count + 1
if (count > 10) capped(count)
}
onCountChanged: fade.Start() // property-change handler
onCapped: (value) => { count = 0 } // event handler
NumberAnimation on glow { // animate a property over time
id: fade
from: 0
to: 1
duration: 300
}
Label {
text: "Count: " + count
style.color: "#e0e0e0" // a style property
style.opacity: root.glow // bound to the animated property
}
Button {
text: "+1"
onClicked: root.increment()
}
}
Declare reactive property state, respond with on…Changed handlers, emit
signal events, group logic into methods, set style.* properties, and attach
NumberAnimations — all declaratively, with no manual change notifications.
Features
- Diagnostics — parse and type errors as you type, with the same
UQ####
codes the Unity importer reports.
- Completion and hover — type-aware against your project's compiled
assemblies (resolved reflection-only; your code never runs).
- Semantic highlighting, document symbols, and folding.
- Go to definition and find references across
ids and members.
- Rename (with prepare) and document formatting.
Requirements
Open a folder (your Unity project). The server anchors diagnostics to the
workspace root. Type-aware features light up once the project has been compiled
by Unity at least once (they read Library/ScriptAssemblies).
Settings
uqml.trace.server — trace LSP traffic (off | messages | verbose) to the
uqml language server output channel.
Development
Running against a source checkout instead of the bundled server: set the
UQML_LSP_DLL environment variable to a built uqml-lsp.dll, or open the uqml
repo itself (the extension finds src/Uqml.LanguageServer/bin/…/uqml-lsp.dll).
Support & Feedback