﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema version="1.0.0"
           attributeFormDefault="unqualified"
           elementFormDefault="qualified"
           xmlns:pkg="http://schemas.microsoft.com/developer/vsx-schema/2011"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:complexType name="Installation">
    <xs:sequence>
      <xs:element name="InstallationTarget" minOccurs="0" maxOccurs="unbounded" type="InstallationTarget">
        <xs:annotation>
          <xs:documentation>

          </xs:documentation>
        </xs:annotation>
      </xs:element>

      <xs:element name="DotnetTargetVersions" minOccurs="0" maxOccurs="1" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            Should only be set when "ExtensionType" is set to "VisualStudio.Extensibility" or "VSSDK+VisualStudio.Extensibility".
            This element specifies the target frameworks for the extension.
            Should be a semi-colon separated list of .NET targets (ex. "net8.0;net10.0").
          </xs:documentation>
        </xs:annotation>
        </xs:element>
    </xs:sequence>

    <xs:attribute name="InstalledByMsi" type="xs:boolean" use="optional">
      <xs:annotation>
        <xs:documentation>
          <!-- _locID_text="InstalledByMsi" _locComment="" -->The InstalledByMsi element should be used if the VSIX is being installed by an MSI.
          Setting this property to true means the extension will appear in the Extension Manager if the manifest is placed in a supported
          location on disk. However, the end user will not be able to uninstall it.  The user will need to remove the extension from
          Windows Add/Remove Programs by uninstalling the parent MSI.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="SystemComponent" type="xs:boolean" use="optional">
      <xs:annotation>
        <xs:documentation>
          <!-- _locID_text="SystemComponent" _locComment="" -->The SystemComponent element will hide the extension from the Extension Manager UI.
          Warning, users will not be able to uninstall the extension through the Extension Manager UI if this is set.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="AllUsers" type="xs:boolean" use="optional">
      <xs:annotation>
        <xs:documentation>
          <!-- _locID_text="AllUsers" _locComment="" -->Setting the AllUsers element to "true" will force the extension to be installed to the Per Machine location.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="Experimental" type="xs:boolean" use="optional">
        <xs:annotation>
            <xs:documentation>
                <!-- _locID_text="AllUsers" _locComment="" -->Setting the Experimental element to "true" will install the user-based extension on top of machine-based extension for the same vsix id.
            </xs:documentation>
        </xs:annotation>
    </xs:attribute>

    <xs:attribute name="Scope" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation>
          <!-- _locID_text="Scope" _locComment="" -->Indicates that the installation is not scoped to any particular SKU. This is independent of the notion
          of machine-wide vs. per user install, which is still controlled by AllUsers.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="PartialManifestType" use="optional">
      <xs:annotation>
        <xs:documentation>
          <!-- _locID_text="Scope" _locComment="" -->Indicates how the embedded catalog manifest should be applied.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="Default"/>
          <xs:enumeration value="Experiment"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>

    <xs:attribute name="ExtensionType" use="optional">
      <xs:annotation>
        <xs:documentation>
          When set to "VisualStudio.Extensibility" indicates that this VSIX is a VisualStudio.Extensibility extension.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="VSSDK"/>
          <xs:enumeration value="VisualStudio.Extensibility"/>
          <xs:enumeration value="VSSDK+VisualStudio.Extensibility"/>
        </xs:restriction>    
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="InstallationTarget">

      <xs:sequence>
        <xs:element name="ProductArchitecture" minOccurs="0" maxOccurs="1" type="ProductArchitecture"/>
      </xs:sequence>
      
    <xs:attribute name="Id">
      <xs:annotation>
        <xs:documentation>
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="Version">
      <xs:annotation>
        <xs:documentation>
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="TargetPlatformIdentifier" use="optional" >
      <xs:annotation>
        <xs:documentation>
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="TargetPlatformVersion" use="optional">
      <xs:annotation>
        <xs:documentation>
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="SdkName" use="optional">
      <xs:annotation>
        <xs:documentation>
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>

    <xs:attribute name="SdkVersion" use="optional">
      <xs:annotation>
        <xs:documentation>
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
      
    <xs:anyAttribute processContents="lax" >
      <xs:annotation>
      </xs:annotation>
    </xs:anyAttribute>

  
  </xs:complexType>

  <xs:simpleType name="ProductArchitecture">
      <xs:restriction base="xs:string">
          <xs:enumeration value="x86"/>
          <xs:enumeration value="amd64"/>
          <xs:enumeration value="arm64"/>
      </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DotnetTargetVersions">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
</xs:schema>