Saturday 6 May 2017

Node.js Module function's JSDoc not recognized by VS Code Intellisense

I am trying to write JSDoc definitions for a Node module in Visual Studio code but the autocomplete only seems to work after typing the full function out and adding the parentheses in other modules.

Heres the function I attached the JSDoc definition to in balance.js:

  /** This function returns a string response in a callback to a given query for a set of banks  
     * @param {string} accountType - Account Type: The type of account to check the balance of
     * @param {string} bank - Bank: the type of bank to use
     * @param {string} fulfillment - Fulfillment: the fulfillment string to use 
     * @param {string} plaidUserID - User ID: the plaid user ID to query the data from the user with
     * @param {function} completion - Completion Block: the completion function called with one arg of string when the query is finished 
    */
    function checkBalance(accountType, bank, fulfillment, actionIncomlpete, plaidUserID, completion){
         //Code here...
}

Then in another file I require the balance .js and try to use the JSDoc autocomplete but it is not foundenter image description here

When I add the parentheses the JSDoc autocomplete kicks in but I would like to have it so while i am typing balance.checkBalance the autocomplete will continue. enter image description here

Does anyone know how I can make sure when I require balance that VSCode can autocomplete all of its method and property names though JSDoc definitions? Thanks



via s_kirkiles

No comments:

Post a Comment