Ticket #31738

コメント書く

Open Date: 2013-07-20 15:18 Last Update: 2013-07-31 17:35

Reporter:
Owner:
Status:
Closed
Component:
(None)
MileStone:
(None)
Priority:
3
Severity:
5 - Medium
Resolution:
None
File:
None

Details

0.8.2からjsdocがサポートされたので、APIリファレンス代わりにjsdoc形式のコメントを書くと親切かも。

Ticket History (3/6 Histories)

2013-07-20 15:18 Updated by: tsugehara
  • New Ticket "コメント書く" created
2013-07-20 15:22 Updated by: tsugehara
Comment

ちょっとやってみたのだが、まだサポートが不完全な印象。enumにコメントをつける方法などが不明。

また、TypeScript本体はこの、忌まわしいスタイルを一部に使ってる。

/// <summary>
/// Convert a symbol to an array of string parts, each of which has a kind. May be tailored
/// to a specific location in the source code. Useful for colorizing the display string.
/// </summary>
/// <param name="symbol">Symbol to be displayed.</param>
/// <param name="location">A location in the source code (context).</param>
/// <param name="semanticModel">Binding information (for determining names appropriate to
/// the context).</param>
/// <param name="format">Formatting rules - null implies
/// Format.MinimallyQualifiedFormat.</param>
/// <returns>A read-only array of string parts.</returns>
export function toMinimalDisplayParts(symbol: ISymbol,

問題はTypeScript本体でjsdocコメントを一切使っていない事で、完成度が高くなるのは少し先のような気もする。

1.0リリース時とか、もうちょっと待ってからのがいいかも。

2013-07-20 15:36 Updated by: tsugehara
Comment

もう一点、定義ファイルにコメントを出力するためにはtsc --commentsオプションを使えばいいのだが、これを使うとjsファイルにもコメントが残ってしまう。

つまりjsファイルにこういうゴミが混ざる。

  1. ///<reference path="all.ts"/>
  2. var jg;
  3. (function (jg) {
  4. (function (Angle) {
  5. })(jg.Angle || (jg.Angle = {}));
  6. })());
  7. ///<reference path="all.ts"/>
  8. var jg;
  9. (function (jg) {
  10. var Rectangle = (function () {
2013-07-20 15:37 Updated by: tsugehara
Comment

もうちょっとtypescript本体でコメントサポートが充実するまで、様子見た方がいい気がする。

2013-07-20 15:38 Updated by: tsugehara
  • Priority Update from 5 - Medium to 3
2013-07-31 17:35 Updated by: tsugehara
  • Status Update from Open to Closed
  • Ticket Close date is changed to 2013-07-31 17:35
Comment

とりあえず、typescript本体のコメントサポートが微妙だったので、定義ファイルをコメントあり、jsファイルをコメント無しとするため特殊なバッチを書いた。

またその上でjsdoc形式のコメントを書いた。

r128までで最低限対応完了。後は随時対応する。

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login