Instance and static members with the same name are conflated
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 206
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
Doclets.io does not properly handle classes with identically-named static and instance methods. Consider a class `Promise` with static `all` and instance method `all`:
* Only one URL is generated, something like `...#dl-Promise-all`. This goes to the first method with that anchor tag in the page. Consequences:
* Some of the inline links in a project are broken because they navigate to the wrong entry.
* Only one sidebar link is even shown.
On a side note, it may seem like a not-great idea to have identically-named (but different in behavior) static and instance methods of the same class, but there is both precedence and an argument for it. For example, in Bluebird, `Promise.all(iterable)` gets its input directly from the calling code, whereas `promisedIterable.all()` uses the promise instance's eventual value as its input. Both are useful — the static for starting a chain when none already exists, and the latter for continuing a chain without having to add a handler which simply returns the static.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how member anchors, inline links, and sidebar entries are generated for static and instance methods; the issue does not name specific files or tests. Done means identically named static and instance members have distinct URLs, links resolve to the correct entry, and both appear in the sidebar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100