2008-11-11 25 views

Trả lời

13

Đăng blog tuyệt vời từ Betrand LeRoy trên định dạng IntelliSense cho JavaScript: The format for JavaScript doc comments.

Tóm lại:

Tóm tắt thông tin - được sử dụng để mô tả một hàm/phương pháp hoặc sự kiện. Cú pháp:

<summary locid="descriptionID">Description</summary> 

Tham số - mô tả tham số cho hàm/phương pháp. Cú pháp:

<param name="parameterName" 
    mayBeNull="true|false" optional="true|false" 
    type="ParameterType" parameterArray="true|false" 
    integer="true|false" domElement="true|false" 
    elementType="ArrayElementType" elementInteger="true|false" 
    elementDomElement="true|false" 
    elementMayBeNull="true|false">Description</param> 

Thẻ param được sử dụng để mô tả các thông số của phương pháp hoặc hàm tạo. Các thẻ param phải theo thứ tự giống như các tham số của method hoặc constructor và có cùng tên.

Chức năng kiểu trả - Cú pháp:

<returns 
    type="ValueType" integer="true|false" domElement="true|false" 
    mayBeNull="true|false" elementType="ArrayElementType" 
    elementInteger="true|false" elementDomElement="true|false" 
    elementMayBeNull="true|false">Description</returns> 

loại giá trị gia tăng - mô tả một tài sản (should not sử dụng 'tóm tắt' cho một prop) - Cú pháp:

<value 
    type="ValueType" integer="true|false" domElement="true|false" 
    mayBeNull="true|false" elementType="ArrayElementType" 
    elementInteger="true|false" elementDomElement="true|false" 
    elementMayBeNull="true|false" 
    locid="descriptionID">Description</value> 

Field - dùng để mô tả một lĩnh vực trong một lớp JavaScript - cú pháp:

<field name="fieldName" type="FieldType" 
    integer="true|false" domElement="true|false" mayBeNull="true|false" 
    elementType="ArrayElementType" elementInteger="true|false" 
    elementDomElement="true|false" elementMayBeNull="true|false" 
    locid="descriptionID">Description</field> 

Cách bao gồm IntelliSense cho tệp JavaScript bên ngoài, t ông sau cú pháp như dòng đầu tiên (s) trong một tập tin JavaScript:

<reference path="path/to/the/script/reference.js" 
    assembly="Assembly.Name" name="ScriptResourceName.js"/> 
0

Một số anh chàng xây dựng một rất đẹp vsdoc for Google Maps V3. Tôi sử dụng nó, nó hoạt động tốt. ;-)

Các vấn đề liên quan