bshambaugh / did-key-creator

Other
2 stars 4 forks source link

JSDoc documentation comments do not show up in VSCode #1

Open bshambaugh opened 2 years ago

bshambaugh commented 2 years ago

The hover behavior should look like what is provided by a library like did-jwt:

scr-1655421098

Instead I am getting something like this where the function description is shown, but the JSDoc comments do not appear:

scr-1655421081

For more information see: https://code.visualstudio.com/docs/languages/typescript#_jsdoc-support and https://jsdoc.app/

For an example of JSDoc comments that currently do not work see: https://github.com/bshambaugh/did-key-creator/blob/main/src/encodeDIDkey.ts#L6-L15


/**
 *  Encodes a did:key from bytes
 *
 *  @example
 *  eencodeDIDfromBytes('p256-pub',new Uint8Array([...])) , or see index.test.ts for constructing Uint8Arrays from strings
 *
 *  @param    {CodecName}           multicodecName   see https://github.com/multiformats/multicodec/blob/master/table.csv for a list of names
 *  @param    {Uint8Array}              publicKey    public key expressed as byte Array
 *  @return   {string}                               a did:key, see spec https://w3c-ccg.github.io/did-method-key/ for form
 */

For an example of JSDoc comments that currently do work see: https://github.com/decentralized-identity/did-jwt/blob/master/src/signers/ES256KSigner.ts#L9-L23

/**
 *  Creates a configured signer function for signing data using the ES256K (secp256k1 + sha256) algorithm.
 *
 *  The signing function itself takes the data as a `Uint8Array` or `string` and returns a `base64Url`-encoded signature
 *
 *  @example
 *  ```typescript
 *  const sign: Signer = ES256KSigner(process.env.PRIVATE_KEY)
 *  const signature: string = await sign(data)
 *  ```
 *
 *  @param    {String}    privateKey   a private key as `Uint8Array`
 *  @param    {Boolean}   recoverable  an optional flag to add the recovery param to the generated signatures
 *  @return   {Function}               a configured signer function `(data: string | Uint8Array): Promise<string>`
 */
bshambaugh commented 2 years ago

I talked to Orie and he mentioned TSDOC. Since I am working with typescript, maybe I am actually using TSDOC instead of JSDOC. https://tsdoc.org/