UI Toolkit Support

USS

The USS language server is built in. The validation is very close to Unity's. It just works.

UXML

For UXML, if you want validation and auto completion, you need to install the xml extension from Redhat.

Our Unity package automatically generates files and configure the settings.json file for you, so xml validation and auto completion with xml extension from Redhat works with minimal configuration. But do remember to generate UXML schema in Unity Editor first.

Note that the xml extension from Redhat is more strict than Unity's own validation. That is, you need to always use xml namespace in a tag's name.

<ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
    <MyNamespace.MyElement>
        <ui:Label text="Hello World!" />
    </MyNamespace.MyElement>
</ui:UXML>

This will not validate in xml extension from Redhat, but it does work in Unity. For this to validate in xml extension from Redhat, you need to declare the xml namespace first. Like this:

<ui:UXML xmlns:my="MyNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
    <my:MyElement>
        <ui:Label text="Hello World!" />
    </my:MyElement>
</ui:UXML>