Umbhalo ozenzakalelayo we-VSCode JSDoc ukuvimba ithuluzi lokuguqula amazwana
Ithuluzi lomsizi lokuxazulula ngokushesha ukunqamuka komugqa wombhalo we-JSDoc usebenzisa ithegi ethi @example, ye-JavaScript/TypeScript I-JSDoc iyijeneretha yemibhalo enamandla ye-JavaScript. Isebenzisa amazwana afomethwe ngokukhethekile ukuze idale imibhalo enemininingwane ye-API yekhodi yakho. Ngokungeza amazwana e-JSDoc kumafayela akho e-JavaScript, unganikeza ulwazi olucacile noluhlelekile mayelana nemisebenzi yakho, amakilasi, namamojula.
Izici ezibalulekile ze-JSDoc:
Thayipha ulwazi
Amapharamitha omsebenzi namanani okubuyisela
Ikilasi kanye nezincazelo zendlela
Amadokhumenti emojuli
Umaka owodwa owusizo ikakhulukazi ku-JSDoc umaka we-@example. Le thegi ikuvumela ukuthi ufake izibonelo zekhodi kumadokhumenti akho. Okwenza ithuluzi lethu lihluke yikhono lalo lokulondoloza ukufometha, ukuhlehlisa, nokunqamuka kwemigqa ngaphakathi komaka ethi @example. Lokhu kusho ukuthi ungabhala izibonelo zekhodi efundeka kakhulu nezingokoqobo, okwenza kube lula konjiniyela ukuthi baqonde indlela yokusebenzisa imisebenzi noma amakilasi akho.
Isibonelo sokusetshenziswa: /**
* Calculates the sum of two numbers.
* @param {number} a - The first number.
* @param {number} b - The second number.
* @returns {number} The sum of a and b.
* @example
* // This example preserves formatting and line breaks
* const result = add(5, 3);
* console.log(result);
* // Output: 8
*/
function add(a, b) {
return a + b;
} Ngokusebenzisa ijeneretha yethu yokuphawula ye-JSDoc eku-inthanethi, ungakwazi ukudala kalula amadokhumenti afomethwe kahle afaka ukufometha okulondoloziwe ezibonelweni zakho zekhodi, okwenza imibhalo yakho ye-JavaScript icace futhi isebenze kahle.