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

Add isTSTypeAliasDeclaration in extractSymbol #192

Merged
merged 2 commits into from
Oct 22, 2022

Conversation

SuperSodaSea
Copy link
Contributor

Should fix [DocParser]: Failed to parse doc for (@Unnamed) caused by /** ... */ type Foo = {}.

See also: pixijs/pixijs#8720

@ShukantPal
Copy link
Member

This does fix the warning but not the spirit of the issue :D. I'll check this out tonight and make it also parse the type definition properties

@SuperSodaSea
Copy link
Contributor Author

@ShukantPal I'll wait patiently :)

@ShukantPal
Copy link
Member

Screen Shot 2022-10-22 at 6 12 56 PM

Added the data type to the TypeDef document signatures (with formatting!)

@ShukantPal ShukantPal merged commit b9ee544 into webdoc-labs:master Oct 22, 2022
@SuperSodaSea SuperSodaSea deleted the fix-ts-type-alias branch October 22, 2022 22:17
@SuperSodaSea
Copy link
Contributor Author

@ShukantPal I tried to bump @webdoc/cli to 2.2.0 in pixi.js and got errors like this:

[Indexer]: Parameter node couldn't be parsed, enable warning logs for more detail
Node {
  type: 'TSCallSignatureDeclaration',
  start: 1332,
  end: 1369,
  loc: SourceLocation {
    start: Position { line: 67, column: 4, index: 1332 },
    end: Position { line: 67, column: 41, index: 1369 },
    filename: undefined,
    identifierName: undefined
  },
  typeParameters: undefined,
  parameters: [
    Node {
      type: 'Identifier',
      start: 1333,
      end: 1347,
      loc: [SourceLocation],
      name: 'urlStr',
      typeAnnotation: [Node]
    }
  ],
  typeAnnotation: Node {
    type: 'TSTypeAnnotation',
    start: 1348,
    end: 1368,
    loc: SourceLocation {
      start: [Position],
      end: [Position],
      filename: undefined,
      identifierName: undefined
    },
    typeAnnotation: Node {
      type: 'TSTypeReference',
      start: 1350,
      end: 1368,
      loc: [SourceLocation],
      typeName: [Node]
    }
  }
}
***unknown (typescript) data-type node***
Node {
  type: 'TSCallSignatureDeclaration',
  start: 1374,
  end: 1477,
  loc: SourceLocation {
    start: Position { line: 68, column: 4, index: 1374 },
    end: Position { line: 68, column: 107, index: 1477 },
    filename: undefined,
    identifierName: undefined
  },
  typeParameters: undefined,
  parameters: [
    Node {
      type: 'Identifier',
      start: 1375,
      end: 1389,
      loc: [SourceLocation],
      name: 'urlStr',
      typeAnnotation: [Node]
    },
    Node {
      type: 'Identifier',
      start: 1391,
      end: 1426,
      loc: [SourceLocation],
      name: 'parseQueryString',
      typeAnnotation: [Node]
    },
    Node {
      type: 'Identifier',
      start: 1428,
      end: 1455,
      loc: [SourceLocation],
      name: 'slashesDenoteHost',
      optional: true,
      typeAnnotation: [Node]
    }
  ],
  typeAnnotation: Node {
    type: 'TSTypeAnnotation',
    start: 1456,
    end: 1476,
    loc: SourceLocation {
      start: [Position],
      end: [Position],
      filename: undefined,
      identifierName: undefined
    },
    typeAnnotation: Node {
      type: 'TSTypeReference',
      start: 1458,
      end: 1476,
      loc: [SourceLocation],
      typeName: [Node]
    }
  }
}
***unknown (typescript) data-type node***
...

Seems to be code here:
https://github.com/pixijs/pixijs/blob/3ba43e50030641e2cb028c7c265e80ce0fdf6fff/packages/utils/src/url.ts#L66-L80

@ShukantPal
Copy link
Member

I added parsing for namee method signatures but not call signatures - this would be a new PR :D

@SuperSodaSea
Copy link
Contributor Author

Just in case, don't forget about the ArrayPattern :)

@ShukantPal
Copy link
Member

@SuperSodaSea haven't forgotten about this. Prolly need a couple weeks to finish that part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants