Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Create a default XML Schema Definition for IntelliSense #125

Open
DamianSuess opened this issue Oct 24, 2018 · 1 comment
Open

Create a default XML Schema Definition for IntelliSense #125

DamianSuess opened this issue Oct 24, 2018 · 1 comment

Comments

@DamianSuess
Copy link

DamianSuess commented Oct 24, 2018

As a developer, I would like for IntelliSense to work in Visual Studio (or other editors) when editing an addin's XML file. In order to do so, we would need a base XSD file which supports the primary functions of an addin's xml manifest.

If not included in the Mono.Addins project, could it be a wiki page?

Example - MonoAddins.xsd

An actively updated example can be found at, MonoAddins.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="MonoAddins"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="https://github.com/mono/mono-addins/MonoAddins.xsd"
    attributeFormDefault="unqualified"
    elementFormDefault="qualified">
  <xs:element name="Addin">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Runtime" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Import" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="Assembly" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Dependencies" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Addin" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="Id" type="xs:string" use="required" />
                  <xs:attribute name="Version" type="xs:decimal" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ExtensionPoint" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ExtensionNode">
                <xs:complexType>
                  <xs:attribute name="Name" type="xs:string" use="required" />
                  <xs:attribute name="ObjectType" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Path" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="Extension" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="Path" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="Id" type="xs:string" use="required" />
      <xs:attribute name="Namespace" type="xs:string" use="required" />
      <xs:attribute name="Version" type="xs:decimal" use="required" />
      <xs:attribute name="Name" type="xs:string" use="optional" />
      <xs:attribute name="Author" type="xs:string" use="optional" />
      <xs:attribute name="CompatVersion" type="xs:decimal" use="optional" />
      <xs:attribute name="Category" type="xs:string" use="optional" />
      <xs:attribute name="Description" type="xs:string" use="optional" />
      <xs:attribute name="IsRoot" type="xs:boolean" use="optional" />
      <xs:attribute name="DefaultEnabled" type="xs:boolean" use="optional" />
    </xs:complexType>
  </xs:element>
</xs:schema>
@mhutch
Copy link
Member

mhutch commented Nov 19, 2019

FWIW MonoDevelop.AddinMaker has an editor extension for addin.xml files that could be generalized fairly easily https://github.com/mhutch/MonoDevelop.AddinMaker/blob/master/MonoDevelop.AddinMaker/Editor/AddinManifestEditorExtension.cs

This currently uses MonoDevelop's old editor, but the underlying XML language service has been ported to the VS/VSMac editor https://github.com/mhutch/MonoDevelop.Xml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants