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
Intellisense falls a bit short when overriding a class's properties and methods using inheritance.
Steps to Reproduce:
In a Typescript file, start with this base code:
abstractclassParent{/** * Function that can be overriden. */publicabstracttoOverride(param1,param2): number;publiccanBeOverridden(param1){}}classChildextendsParent{}
In the Child class, try to implement the function toOverride : no autocompletion is proposed, yet TS shows the error Non-abstract class 'Child' does not implement inherited abstract member 'toOverride' from class 'Parent'. when hovering the class name until we actually write a function with the same signature, which means it knows the missing function's signature.
When the function has been implemented in Child, the parent function's doc isn't reflected in the overriding function, even if it has no doc. I can imagine why it is so, but that means we have to copy paste the doc for it to actually show up when we use Child.toOverride().
It doesn't work either with non-abstract functions, nor getter/setters, etc.
Full code:
abstractclassParent{/** * This doc will only show up for `Parent` instances, * or objets treated as `Parent`. */publicabstracttoOverride(param1,param2): number;publiccanBeOverridden(param1){}}classChildextendsParent{// No completion has been provided while implementing this functionpublictoOverride(p,p2): number{return2;}}newChild().toOverride(1,2);// The doc doesn't show up when hovering toOverride.(newChild()asParent).toOverride(1,2);// The doc shows up when hovering toOverride.
From @Elarcis on October 14, 2016 18:13
Intellisense falls a bit short when overriding a class's properties and methods using inheritance.
Steps to Reproduce:
Child
class, try to implement the function toOverride : no autocompletion is proposed, yet TS shows the errorNon-abstract class 'Child' does not implement inherited abstract member 'toOverride' from class 'Parent'.
when hovering the class name until we actually write a function with the same signature, which means it knows the missing function's signature.Child
, the parent function's doc isn't reflected in the overriding function, even if it has no doc. I can imagine why it is so, but that means we have to copy paste the doc for it to actually show up when we useChild.toOverride()
.Full code:
Copied from original issue: microsoft/vscode#13779
The text was updated successfully, but these errors were encountered: