1

In Javascript for some methods, I don't see the suggestions. For example indexOf, charCodeAt and so on. Is it possible to activate suggestions for these built-in Javascript keywords?

enter image description here

1 Answer 1

2

I think you should leverage VS Code ability to work with JSDoc.

As you can see without JSDoc, VS Code can't infer that bar is a string. After documenting the parameter properly, it is able to make some meaningful suggestions:

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

For those that are wondering, this works for variables that are utilized inside of a function, like in the example, but does not work for variable declarations like const foo = bar.[intellisense-here]
@JDunken it can if you add the relevant bit of JSDoc to your variable declaration. e.g. /** @type {string} */ var foo;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.