简体   繁体   中英

How do I get intellisense for Javascript module in Atom or any other IDE?

I'm new to javascript and node js. I've following code in my authentication.js file

I'm trying to get the intellisense working when I press client. ( and CTRL + space), I do not see anything. How do I be able to see functions that are within auth.OAuth2 modules.

I remember in VS you can use /// reference paths . Not sure if that is the standard approach in ATOM as well. I looked over the internet and could not find any satisfactory answer.

How do people know what methods to use and what is their required signature without intellisense?

I'm literally crawling to make things work right now because of this. Do I have to read documentation for every modules/packages before I start using it? That'd take a lot of time.

Please also note that I have added all the packages like autocomplete , autocomplete-plus and so on for the intellisense to work magically but it doesn't. Intellisense does work but it displays everything else but not the functions of the modules I'm referring to in the example.

Any help/suggestion is much appreciated?

'use strict';
var config = require("../../config/config");
exports.verifyUser = function(req, res, next) {
var GoogleAuth = require('google-auth-library');
var auth = new GoogleAuth;
var client = new auth.OAuth2(config.clientID, config.clientSecret,config.callbackURL);
 **client.  //no intellisense**
// check header or url parameters or post parameters for token
 var token = req.body.id_token || req.query.id_token || req.headers['id_token'];
if (token) {
  client.verifyIdToken(
        token,
        config.clientID,
    function (err) {
            if (err) {
                res.send("Un authorized");
            } else {
                next();
            }
        });
    }
}

I've had great success using Visual Studio Code.
Its a lightweight IDE similar to Atom, its actually also built using Electron.

You can check out a tutorial about how to get things set up here.

https://blog.tallan.com/2017/03/02/synthetic-type-inference-in-javascript/

You need to add an intellesense plugin for the language you're using. Atom isn't really suited to noobs though, you should try out netbeans if you want a fully featured editor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM