title: Does Intellisense support xs:key/xs:keyref?
body: <p>Consider this XML fragment:</p>
  
  <pre><code>&lt;languages default="de-DE"&gt;
    &lt;language id="es-ES" /&gt;
    &lt;language id="de-DE" /&gt;
  &lt;/languages&gt;
  </code></pre>
  
  <p>and an xsd that describes it:</p>
  
  <pre><code>&lt;xs:simpleType name="availableCultures" id="availableCultures"&gt;
    &lt;xs:restriction base="xs:QName"&gt;
      &lt;xs:enumeration value="en-US"/&gt;
      &lt;xs:enumeration value="de-DE"/&gt;
      &lt;xs:enumeration value="es-ES"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  ...
  &lt;xs:element name="languages"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="language" minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:complexType&gt;
            &lt;xs:attribute name="id" form="unqualified" type="mstns:availableCultures" use="required" /&gt;
          &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="default" form="unqualified" type="mstns:availableCultures" /&gt;
    &lt;/xs:complexType&gt;
    &lt;xs:keyref name="defaultP" refer="mstns:languageKey"&gt;
      &lt;xs:selector xpath="."/&gt;
      &lt;xs:field xpath="@default"/&gt;
    &lt;/xs:keyref&gt;
    &lt;xs:key name="languageKey"&gt;
      &lt;xs:selector xpath="mstns:language"/&gt;
      &lt;xs:field xpath="@id"/&gt;
    &lt;/xs:key&gt;
    &lt;xs:unique name="languageUnique"&gt;
      &lt;xs:selector xpath="mstns:language"/&gt;
      &lt;xs:field xpath="@id"/&gt;
    &lt;/xs:unique&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>Now, this almost works, ie. languages in the list are forced to be unique and that 'default' attribute has to refer to one of the languages in the list. I also get Intellisense support for both 'id' and 'default' fields. But I would like Intellisense to propose only languages from the list in xml file for the 'default' field - not all from the availableCultures type (after all they are the only valid ones). How do I do that?</p>
  
  <p>Why do I suspect this should be doable? Because when writing the above xsd file Intellisense displayed "mstns:availableCultures" in the drop down list for 'type' attribute of 'xs:attribute' element.</p>
  
  <p>What I don't know is whether this can be done using xsd alone or I would need to write some kind of VS package/add-in.</p>