docs-parser icon indicating copy to clipboard operation
docs-parser copied to clipboard

Bullet lists incorrectly take precedence over explicit `Returns <type>`

Open codebytere opened this issue 2 years ago • 1 comments

See https://github.com/electron/electron/issues/37781 - this lead to a wildly incorrect return type of:

getPreferredSystemLanguages(): Array<'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()' | 'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()'>;

codebytere avatar Apr 04 '23 11:04 codebytere

I looked into this this week and honestly this is a tricky one, the list isn't taking precedence, rather augmenting the String type.

The logic is basically "is it a string, if so is there a list, if so make an enum from that list" which is hard to be like "unless it's not an enum list" when we clearly can't detect them very well

MarshallOfSound avatar Sep 23 '24 17:09 MarshallOfSound