microsoft / microsoft/TypeScript
JS IntelliSense only picks up JSDoc @inherits rule in class definition but not on children or instances
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TS Template added by @mjbvz
TypeScript Version: 4.1.0-dev.20201026
Search Terms
- jsdoc
- VSCode Version: 1.50.1
- OS Version: 18.04
Steps to Reproduce:
I apologize if this is not the correct place for this issue, I tried hard finding the repository that is responsible for js intellisense.
- Create a new js file
- Copy below code into the file
function Mixin1 (base) {
return class extends base {
foo() {}
}
}
function Mixin2 (base) {
return class extends base {
bar() {}
}
}
class IntermediateDummyClass extends Mixin1(Object) {}
/**
* @implements {IntermediateDummyClass}
*/
class Composite extends Mixin2(IntermediateDummyClass) {
}
let c = new Composite;
c.
- Observe autocomplete suggestions - within
Compositeclass bothfooandbarare suggested

However when instantiated or extended only bar is picked up.


Does this issue occur when all extensions are disabled?: Yes
Contributor guide
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 running the provided JavaScript reproduction in the TypeScript language service and compare IntelliSense for Composite, its instance, and an extending class. Trace how the JSDoc @implements rule is applied in the reproduction, then verify that foo and bar are suggested consistently for the class, instances, and children.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100