[英]Visual studio code IntelliSense not working with NodeJS
I had been working with vs code for a while to develop NodeJS projects however IntelliSense not working for the classes and files I am writing, I had tried the solution inside here but it did not work for me, so anyone can help me to fix this problem. 我已经使用vs代码开发了一段时间的NodeJS项目,但是IntelliSense不适用于我正在编写的类和文件,我在这里尝试过该解决方案,但对我而言不起作用,因此任何人都可以帮助我解决此问题问题。
VS code version:1.25.0 VS代码版本:1.25.0
NodeJS version:8.9.4 NodeJS版本:8.9.4
An example about IntelliSense problem: 有关IntelliSense问题的示例:
This is a simple class
这是一个简单的类
As you can see when I am importing it from another file no IntelliSense is working
如您所见,当我从另一个文件导入它时,IntelliSense无法正常工作
But the node_module files IntelliSense is working!
但是IntelliSense的node_module文件正在运行!
I tried to solve it with a different syntax to export the class: 我试图用另一种语法解决该问题,以导出该类:
class Util {
constructor() { }
getNumber(x, y) {
return x * y;
}
}
exports.default = Util;
Then, I could import the class like this 然后,我可以像这样导入类
const util = require('./../util/util').default;
And the autocompletion works: 自动补全工作:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.