Skip to content

js intellisense issues about the custom export module. #16467

@mjbvz

Description

@mjbvz

From @tsanie on June 12, 2017 12:40

Issues:

The intellisense doesn't work when I import a constructor, but after I change the module.exports to an object, it seems right.

Steps to Reproduce:

  1. Create a file named 'mod.js', write these lines.
function Test(name) {
  this.name = name;
}
Test.prototype.log = function (msg) {};
module.exports = Test;
  1. Create another file named 'test.js'.
const Test = require('./mod');
let a = new Test('test');
a.    // <- here, the intellisense cannot list the 'name' and 'log'
  1. Then change the files.

'mod.js'

-module.exports = Test;
+module.exports = { Test };

'test.js'

-let a = new Test('test');
+let a = new Test.Test('test');
a.    // now the intellisense seems good.

Screen record

vsc

Copied from original issue: microsoft/vscode#28517

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions