Skip to content

js intellisense issues about the custom export module. #28517

@tsanie

Description

@tsanie

Environments:

  • VSCode Version: 1.13.0
  • OS Version: Win 10 Pro, 1703 (Build 15063.332)

Extensions:

  • Beautify 1.1.1
  • C/C++ 0.11.4
  • C# 1.10.0
  • ESLint 1.2.11
  • vetur 0.7.0
  • vscode-icons 7.9.0
  • webpack 2.0.0
  • XML Tools 1.8.0

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions