Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDoc documentation comments do not show up in VSCode #1

Open
bshambaugh opened this issue Jun 17, 2022 · 1 comment
Open

JSDoc documentation comments do not show up in VSCode #1

bshambaugh opened this issue Jun 17, 2022 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bshambaugh
Copy link
Owner

bshambaugh commented Jun 17, 2022

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 bshambaugh added bug Something isn't working help wanted Extra attention is needed labels Jun 17, 2022
@bshambaugh
Copy link
Owner Author

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant