Is it possible to include intellisense JS object in prototype approvers in Visual Studio Code?

When creating a JS object and defining some accessories, I found that I could not get intellisense after this.

Code example:

 function Obj(foo) { this.foo = foo; } Obj.prototype = { get bar() { return this.// No intellisense here }, set bar(val) { this.foo = val } }; 

But creating a method with Obj.prototype.test = function () {...} will give me intellisense.

Is there a way to reproduce the same lexical analysis for this case with user preferences, or is it an actual flaw / error?

Edit: here is an image of what VSCode shows: Vscode intellisense

As you can see, it shows only previously used words, and nothing more.

+5
source share
1 answer

Microsoft recommends restarting VS to see if it helps. Or you can skip type declarations if this happens to libraries other than objects.

There is a link here that has some troubleshooting tips you can follow.

Here's a more specific link here that deals with JavaScript in the code.

In addition, the code may not show it, because something similar is associated with it. He sees that he has already shown foo . Try renaming it and see if that helps.

+2
source

Source: https://habr.com/ru/post/1270781/


All Articles