2012-10-02 81 views
5

TypeScript中是否已经支持XML文档?看起来没有,但也许我忽略了一些东西。TypeScript中是否已经支持XML文档?

我想是这样的:

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> 
    } 
} 

回答

5

有一个在语言规范没有这方面的记载,所以目前此功能的支持。

使用唯一的注释语法是对源文件创建一个相关性:

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

您可以suggest features such as this on the project page - 因此它可以被添加到将来如果这个想法获得牵引力的语言。

+0

谢谢,添加的功能请求。 –

+1

有没有指向功能请求的链接?我想支持它。 – Amr

+0

这里我张贴的评论:typescript.codeplex.com/discussions/397660安德斯·海尔斯伯格写道,他们瞄准了JSDoc也许不是XML文档。 –

0

对于它的价值,从微软的样品做包括评论的这种风格。来自视差样本:

constructor(scrollableContent: HTMLElement, perspective: number) { 
     /// <param name="scrollableContent">The container that will be parallaxed.</param> 
     /// <param name="perspective">The ratio of how much back content should be 
     /// scrolled relative to forward content. For example, if this value is 
     /// 0.5, and there are 2 surfaces, the front-most surface would be scrolled 
     /// normally, and the surface behind it would be scrolled half as much.</param> 
     this.perspective = perspective; 
     this.surface = []; 
     this.content = scrollableContent; 

     $(scrollableContent).scroll((event: JQueryEventObject) => { 
      this.onContainerScroll(event); 
     }); 
    } 
+0

我加入CodePlex上和评论安德斯·海尔斯伯格的是,他们对JsDoc靠在答复。 http://typescript.codeplex.com/discussions/397660 –

-1

显然JSDoc现在支持,至少在Visual Studio代码,因为我目前使用它那里,它体现在智能感知弹出。