Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode intelliSense autocomplete for javascript

I would like Visual Studio Code to autocomplete all words within the open document instead of the just the scope specific variables it finds. What should I change in the settings?

edit: code version 0.3.0 at time of question.

like image 266
mihai Avatar asked Jun 11 '15 23:06

mihai


People also ask

How do I enable autocomplete in VS Code?

You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript).

Is VS Code good for JavaScript?

VS Code ships with excellent support for JavaScript but you can additionally install debuggers, snippets, linters, and other JavaScript tools through extensions.

What is JavaScript IntelliSense?

IntelliSense# Visual Studio Code's JavaScript IntelliSense provides intelligent code completion, parameter info, references search, and many other advanced language features. Our JavaScript IntelliSense is powered by the JavaScript language service developed by the TypeScript team.


2 Answers

I just figured it out. This will use all words on the page for auto complete.

// Always include all words from the current document.
"javascript.suggest.alwaysAllWords": true,

// Complete functions with their parameter signature.
"javascript.suggest.completeFunctionCalls": true,
like image 105
mihai Avatar answered Sep 24 '22 16:09

mihai


Even though it has been quite some time for this question, I thought I might be of help to anyone else who bumbles across the same question.

So here goes . And this is for the latest version of VS Code as of writing.

For a true intellisense, i.e. for example you intend to get all the methods related to "console" as soon as you press '.' , you can use the respective Typescript definition file. Now I agree that this fix is targeted at node,and needs the same along with npm on your system. But still, works for all Major JavaScript work you might run across.

on Linux, for this, you'd need "npm" and install TypeScript Definition Manager (tsd) globally.

npm install -g tsd

then within your current project directory (or by changing to the project directory) , open a terminal window and add the following lines

tsd query node --action install
tsd query express --action install

then, as soon as you'll open your .js file in the current directory, you'll get proper autocomplete / intellisense for all DOM object and other possible stuff.

It worked for me, and this is the only reason I use VSCode on linux (for JavaScript at least, even though I like LightTable too)

for further information (and clarifications if I somehow couldnt manage to be clear enough) visit the following link:

Node.js applications on VS Code

like image 23
prodSy Avatar answered Sep 23 '22 16:09

prodSy