Make Javascript intellisense detect inheritance
See original GitHub issueFrom @benjaminmillhouse on December 21, 2016 17:33
- VSCode Version: Code 1.8.0 (38746938a4ab94f2f57d9e1309c51fd6fb37553d, 2016-12-13T17:38:28.425Z)
- OS Version: Darwin x64 16.3.0
- Extensions:
Extension | Author | Version |
---|---|---|
JSDocTagComplete | HookyQR | 0.0.2 |
html-css-class-completion | Zignd | 1.0.3 |
theme-atom-one-dark | andischerer | 0.0.1 |
vscode-eslint | dbaeumer | 1.1.0 |
docthis | joelday | 0.3.5 |
Angular1 | johnpapa | 0.1.16 |
Angular2 | johnpapa | 1.0.2 |
csharp | ms-vscode | 1.5.3 |
js-atom-grammar | ms-vscode | 0.1.10 |
vscode-icons | robertohuertasm | 4.0.2 |
bootstrap-3-snippets | wcwhitehead | 0.0.8 |
Hello, I would love it if VS Code’s Javascript intellisense was able to detect inheritance. Please let me know if there is a way to accomplish this today through jsdoc comments or anything like that. I have tried all kinds of different ways to get VS Code to detect it (definitions like below, @augments, @extends jsdoc comments, etc) and have not gotten anything to work.
As an example, when inheriting like this:
function BaseClass() {
this.foo = 'bar';
}
BaseClass.prototype.baz = function () { }
function InheritedClass() {
BaseClass.call(this);
}
InheritedClass.prototype = Object.create(BaseClass.prototype);
InheritedClass.prototype.constructor = InheritedClass;
Would like the intellisense for new InheritedClass(). to show ‘foo’ and ‘baz’ as properties/methods for InheritedClass in Intellisense.
Copied from original issue: Microsoft/vscode#17690
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:13 (4 by maintainers)
Top Results From Across the Web
IntelliSense - 'this' not inherit objects on Javascript
IntelliSense - 'this' not inherit objects on Javascript ... I notice this image the IntelliSense should automatically recognize the content ...
Read more >Two ways you can take advantage of types in JavaScript ...
This blog post describes how you can enable javascript intellisense and design time error highlighting without TypeScript.
Read more >User and Workspace Settings - Visual Studio Code
To check which settings you have configured, there is a @modified filter in the Search bar. A setting shows up under this filter...
Read more >C# IntelliSense - Visual Studio (Windows) - Microsoft Learn
Interfaces and base classes: IntelliSense automatically removes items from the interface and base class completion lists, in both class ...
Read more >How To Make Vscode To Autocomplete Prototypal Inherited ...
html-css-class-completion, Zignd, 1.0.3 I would love it if VS Code's Javascript intellisense was able to detect inheritance. Please let me { BaseClass.call(this); ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
JSDoc is not supported inside
.ts
files, so@constructor
and@augments
… don’t do anything in….ts
files. LOLWhat can community members do to encourage ES5 support? Can we donate money towards particular issues? There has to be some way to get these things prioritized.
Thanks @Obscerno for this pointer. This is a derived option which does not need require to edit the file during build, but will produce some useless JS code eventually (though the code is never executed):
Fortunately, TypeScript is broken enough so 1. the definitions are picked up inside the dead block and 2. one ts-ignore is enough even if you have multiple lines inside the block. (The latter is quite helpful since the silly ts-ignore has no options or block-treatment. Unbelievable …)
Edit/Update:
if(false)
hack does not work for function calls which are directly in the constructor: