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

Function overload comments aren't working #1262

Closed
jtenner opened this issue Apr 7, 2020 · 7 comments
Closed

Function overload comments aren't working #1262

jtenner opened this issue Apr 7, 2020 · 7 comments
Labels
bug Functionality does not match expectation

Comments

@jtenner
Copy link

jtenner commented Apr 7, 2020

Search terms

Function, Overload, Class, method

Expected Behavior

Each overload should be commented appropriately.

Actual Behavior

Please check out this method here linked on my github page for an example of the bug.

https://jtenner.github.io/libtelnet-ts/classes/telnet.html#on

Every other on() function overload seems to be empty and it's reporting the wrong comments for each one.

Steps to reproduce the bug

Do something like this:

export class TheClass {
  /** This is "one" */
  on(input: "one"): void;
  /** This is "two" */
  on(input: "two"): void;
  /** This is "three" */
  on(input: "three"): void;
  /** Generic */
  on(input: string): void;
}

Environment

  • Typedoc version: ^0.17.3
  • TypeScript version: 3.9.0-beta
  • Node.js version: v12.9.1
  • OS: ubuntu on windows

If perhaps I was given guidance as a beginner dev on this project, I would be happy to submit a pull request and help fix the problem.

@jtenner jtenner added the bug Functionality does not match expectation label Apr 7, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 12, 2020

I wish I could point you to where this was happening, but I don't know myself! There are unfortunately several parts of the code responsible for dealing with comments, and I haven't a clue which one of them is to blame for this.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 12, 2020

Looks like this issue is in the themes. If I view source, the content is there in the DOM.

There was some refactoring there recently - @sgrishchenko helped out with it and might have an idea of what's going on here. It's really weird how it works for the first few overloads then starts skipping some. (Why on earth does clicking on "negotiate" show "sb"?!)

I'm not seeing the issue in the code that does this - it's at https://github.com/TypeStrong/typedoc-default-themes/blob/master/src/default/assets/js/src/typedoc/components/Signature.ts if you want to take a look.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 12, 2020

I guess it isn't quite that weird, it does break on all even signatures, which makes more sense than working for the first few. Still not sure what the problem is though.

@jtenner
Copy link
Author

jtenner commented Apr 12, 2020

I wish I could help! I've tried looking around the source but I can't seem to find it either.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 12, 2020

Oh, well, in hindsight that's obvious. Querying for .tsd-description doesn't work when the description contains a description.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 12, 2020

If you delete package-lock.json (or yarn.lock) and reinstall, you should pick up typedoc-default-themes@0.10.1 which has a patch for this :)

@jtenner
Copy link
Author

jtenner commented Apr 12, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants