-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
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:
- Create a file named 'mod.js', write these lines.
function Test(name) {
this.name = name;
}
Test.prototype.log = function (msg) {};
module.exports = Test;- 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'- 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
Copied from original issue: microsoft/vscode#28517
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
