Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Visual Studio Code Javascript Intellisense not working on event object properties

I noticed when trying to call the .target property on the event parameter i’m passing thru, the intellisense doesn’t recognize and give me options of the available properties or methods.

Is this normal functionality or is there a way to work around this?

https://i.stack.imgur.com/7rN04.png

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You should be able to make it work by using JSDoc type annotations:

/**
 * @param event {YourTypeHere}
 */
let sharePhoto = function (event) {
    // TODO: Write code
}

For example, if you type Event in between the brackets:

A Visual Studio Code screenshot showing that IntelliSense works after giving 'event' an 'Event' type annotation

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading