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

Multiline comments not working in deno doc #4755

Closed
akshatagarwl opened this issue Apr 15, 2020 · 5 comments
Closed

Multiline comments not working in deno doc #4755

akshatagarwl opened this issue Apr 15, 2020 · 5 comments
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@akshatagarwl
Copy link
Contributor

akshatagarwl commented Apr 15, 2020

Running deno doc on

/**
* Hello there, this is a multiline JSdoc.
*
* It has many lines
*
* Or not that many?
*/
export function foo(a: string, b?: number, cb: (...cbArgs: unknown[]) => void, ...args: unknown[]): void {
    console.log("Hello world");
}

gives

function foo(a: string, b?: number, cb: (cbArgs: unknown[]) => void, args: unknown[]): void
  Hello there, this is a multiline JSdoc.

instead of


function foo(a: string, b?: number, cb: (cbArgs: unknown[]) => void, args: unknown[]): void
  Hello there, this is a multiline JSdoc.

  It has many lines

  Or not that many?

Tests for this do exist. here

@ry ry added the bug Something isn't working correctly label Apr 15, 2020
@ry
Copy link
Member

ry commented Apr 15, 2020

Thanks @humancalico - I would also expect the full docs to be printed in the CLI, but I expect the intention was to just print an index of docs, and allow the user to drill into further by doing deno doc foo.js foo. Is that correct @lucacasonato ?

That said, I think it's a bit confusing and limiting to not just display the complete documentation up front.

@akshatagarwl
Copy link
Contributor Author

akshatagarwl commented Apr 15, 2020

@ry I guess adding --full/--complete flag to deno doc for printing the full docs would make much more sense.
or the other way around it could be for deno doc to print the full doc and adding an --index flag for just printing the index

@lucacasonato
Copy link
Member

This was done to save on space in the overview view. If I remember correctly go doc does it this way too (it even truncates function signatures). All lines should be displayed in the details view. The first line of JSDoc is also what is displayed by VS code autocomplete, so this is nothing new in JS land. Most people won’t need examples for how to use something when they are just browsing through the package’s exports. They get examples when they look at specific functions in the details view.

This might be made more clear by adding [...] after any truncated JSDoc.

I think a —no-truncate option would also work.

@rajeev-kumar-sharma
Copy link

I would like to work on this bug.
I will implement it all possible ways suggest there and we will finalise later.

May you direct me, where to start.

@bartlomieju
Copy link
Member

Fixed in #6541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
Development

No branches or pull requests

5 participants