vscode icon indicating copy to clipboard operation
vscode copied to clipboard

No intellisense when exporting es3 style class

Open kamiua opened this issue 10 years ago • 4 comments

  • VSCode Version: 1.0.0
  • OS Version: Windows 10 Enterprise

Steps to Reproduce:

  1. Create two js files.

moduleA.js

var constructorFunction = function () {};
constructorFunction.prototype.prototypeMethod = function () {};
module.exports = constructorFunction;

moduleB.js

var moduleA = require('./moduleA');
var constructedObject = new moduleA();
constructedObject.
  1. Try get intellisense suggestion after dot in moduleB.
  2. No intellisense provided.
  3. If I change code in moduleA as following:
function constructorFunction () {}
constructorFunction.prototype.prototypeMethod = function () {};
module.exports = constructorFunction;

intellisense in moduleB starts working.

Expected result: intellisense works no matter how exported function is defined.

kamiua avatar Apr 18 '16 11:04 kamiua

@DenysYefimenko the change part reads exactly the same as in steps. e.g

function constructorFunction () {} 
 constructorFunction.prototype.prototypeMethod = function () {}; 
 module.exports = constructorFunction; 

Are we missing something ?

dbaeumer avatar Apr 18 '16 11:04 dbaeumer

Yes, you do :) In changed part I declared constructorFunction without using var variable = function() {...} construction.

kamiua avatar Apr 18 '16 11:04 kamiua

Thanks. Missed that.

Moving to TS.

dbaeumer avatar Apr 18 '16 13:04 dbaeumer

This issue was moved to Microsoft/TypeScript#8144

dbaeumer avatar Apr 18 '16 13:04 dbaeumer