Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there already support for XML Documentation inside TypeScript?

Is there already support for XML Documentation inside TypeScript? It seems there isn't, but maybe I am overlooking something.

I'd like something like this:

export class Point {
   /// <summary>This is a Point class.</summary>

    constructor (public x: number, public y: number) { 
        /// <summary>Creates a new Point object</summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
    }
}
like image 543
Peter Kiers Avatar asked Oct 02 '12 08:10

Peter Kiers


People also ask

How to generate XML documentation Visual Studio?

From the menu bar, choose Tools > Options to open the Options dialog box. Then, navigate to Text Editor > C# (or Visual Basic) > Advanced. In the Editor Help section, look for the Generate XML documentation comments option.

How do I read XML documents?

Just about every browser can open an XML file. In Chrome, just open a new tab and drag the XML file over. Alternatively, right click on the XML file and hover over "Open with" then click "Chrome". When you do, the file will open in a new tab.

What is CREF in XML?

The cref attribute in an XML documentation tag means "code reference." It specifies that the inner text of the tag is a code element, such as a type, method, or property.

What sequence of characters indicates the start of an XML style documentation comment in C# code?

The use of XML doc comments requires delimiters that indicate where a documentation comment begins and ends. You use the following delimiters with the XML documentation tags: /// Single-line delimiter: The documentation examples and C# project templates use this form.


1 Answers

There is no mention of this in the language specification, so there is currently no support for this feature.

The only comment syntax in use is to create a dependency on a source file:

/// <reference path="..."/>

You can suggest features such as this on the project page - so it could be added to the language in the future if the idea gains traction.

like image 128
Fenton Avatar answered Sep 28 '22 06:09

Fenton