OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

JSdoc vscode intellisense on monkey patched / added function?

  • Thread starter Thread starter FHDEV
  • Start date Start date
F

FHDEV

Guest
he's an example of what I'm trying to do.

Just wondering if there's any way to accomplish having the moo method referenced in other places on VS code populate intellisense using jsdoc. Right now it just shows "any"

lib/newmoment.js

Code:
/**
 * @module lib/newmoment
 */
const moment = require('moment');

/**
 * do the moo
 * @returns {String} moo
 */
moment.moo = function(){
  return 'moo'
}

module.exports = moment;

test.js which uses lib/newmoment.js

Code:
const moment_modified = require('./lib/newmoment')

console.log(moment_modified.moo());

screenshots showing "any", however I'm trying to get the intellisense to show "do the moo"

referenced function

original function

<p>he's an example of what I'm trying to do.</p>
<p>Just wondering if there's any way to accomplish having the moo method referenced in other places on VS code populate intellisense using jsdoc. Right now it just shows "any"</p>
<p>lib/newmoment.js</p>
<pre><code>/**
* @module lib/newmoment
*/
const moment = require('moment');

/**
* do the moo
* @returns {String} moo
*/
moment.moo = function(){
return 'moo'
}

module.exports = moment;
</code></pre>
<p>test.js which uses lib/newmoment.js</p>
<pre><code>const moment_modified = require('./lib/newmoment')

console.log(moment_modified.moo());
</code></pre>
<p>screenshots showing "any", however I'm trying to get the intellisense to show "do the moo"</p>
<p><a href="https://i.sstatic.net/AJVNNPk8.png" rel="nofollow noreferrer">referenced function</a></p>
<p><a href="https://i.sstatic.net/19Ef1E53.png" rel="nofollow noreferrer">original function</a></p>
 

Latest posts

Top