-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
jsdoc comments aren't renamed alogn with their nodes #295
Comments
cc: @Gerrit0 |
So is the issue that the reference in tsdoc comment isn't being renamed when a node is renamed? Or there is something else? |
I'm not sure if a rename to the comment would be the right approach as you might see in the docs |
Well, its up to a docs renderer to decide whether to use an exported name in the docs or a local (referenced) one. But what I'm worried about right now is actual jsdoc values - when you read them you will see So can you confirm that the issue is related to jsdoc comments only? I.e. if you have something like this: export interface Map {
}
/** See {@link Map} */
export type MyMap = Map; then when |
It's worth mentioning that links in comments are resolved by TS's language service if you use the local name, but not if you use an exported name. /**
* {@link OtherName.method} doesn't work
* {@link Map.method} works
*/
export interface Map {
method(): void
}
export { Map as OtherName } If you're going to rewrite this, you might consider rewriting |
Yeah my current plan is to fix jsdoc comments so they will refer to a correct identifier (i.e. Thanks for pointing at |
TypeDoc uses the compiler's resolution if available by default, though that's controlled by an option |
It looks like the compiler doesn't provide an API to manipulate with attached jsdoc comments. I'll check later in discord chat/issue tracker if there anything we can do to update a comment accordingly. |
It was suggested in one of the PRs I did, that I should try running typedoc on the output of dts-bundle-generator.
This should save the complexity of adhering to both packages rules, as both do similar things when it comes to exporting things that are not part of the public API
(
typedoc
has a plugin calledtypedoc-plugin-missing-exports
anddts-bundle-generator
has a flag called--export-referenced-types
, which I believe are very similar).So I tired it on my library and I got some warnings from typedoc.
While some warning are related to missing export of some classes/types in the public API, others I did not know how to solve.
I'll try to explain the problem as best as I understand.
When using dts-bundle-generator some classes that are colliding with global classes are being assign a temporary name, in my case
Map
(which is a map - as in map to show countries and geography) is colliding with the javascriptMap<T, U>
class.Also there's an
Event
class, they getMap$1
andEvent$1
respectively.Due to history and a lot of users, I can't easily change their names.
typedoc is trying to look at the tsdoc comments and create href links between classes documentation, for example to the map method
map#render
.When the class name is changed these links get broken and typedoc reports warnings, which I set to be errors so I won't have warnings creeping into the docs generation.
I can't think of an easy solution to the problem that does not involve disable this name collision feature, but there might be other ways :-)
Feel free to use my repo for experimentation:
https://github.com/maplibre/maplibre-gl-js
Let me know if more info is needed.
The text was updated successfully, but these errors were encountered: