You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation for private class methods defined using private identifier syntax (i.e., #privateMethod() {}) is always emitted, despite being private at runtime.
I expected the documentation to be omitted, like how it is for private methods declared using the private keyword.
Additional context
To work around the issue, I have to switch to using the private keyword.
I took a quick glance at how the visibility for the documented symbol is determined in src/lib/docs.ts#146. Based on Typescript AST Viewer 1, checking for PrivateIndentifier seems to be the way to go, although I'm not familiar enough with the compiler's API to know how difficult it would be to add the check.
Good catch! The private identifier syntax was indeed being generated, and I also noticed that the inner properties of classes weren’t being generated either. I resolved both issues this evening and released a new version of the library, v1.1.0.
Documentation for private class methods defined using private identifier syntax (i.e.,
#privateMethod() {}
) is always emitted, despite being private at runtime.To Reproduce
See https://github.com/bryan-hoang/repro-tsdoc-markdown-private-identifiers
Expected behavior
I expected the documentation to be omitted, like how it is for private methods declared using the
private
keyword.Additional context
To work around the issue, I have to switch to using the
private
keyword.I took a quick glance at how the visibility for the documented symbol is determined in
src/lib/docs.ts#146
. Based on Typescript AST Viewer 1, checking forPrivateIndentifier
seems to be the way to go, although I'm not familiar enough with the compiler's API to know how difficult it would be to add the check.Footnotes
https://ts-ast-viewer.com/#code/KYDwDg9gTgLgBAYwDYEMDOa4BlgBMDmwUAwigHYCWaMRcA3gFACQA9AFRvNxtwAKUFAG4oacCrmBkYFAGYVaAW2AwAFhFwA6LjwACYAcJraWzAMRo1AVyS4AchABCwACIQElpVLwAKAJT1mJgQIMjQIJGANJAh8bwByFWAkaLjfAG5mAF8GZnZOJm4+AxFgOCVVdS0C3X0hEuNmWsNSiwhrO0cXNw9JGlw-AKYgkLCIqJj4xOSIVIymbOygA ↩
The text was updated successfully, but these errors were encountered: