[英]JavaScript Intellisense with Visual Studio Code: How to get it to work for required modules?
For some reason, intellisense won't work for me for required modules. 出于某种原因,intellisense对我来说不适用于所需的模块。 At least out-of-the box. 至少是开箱即用的。 For example (this is JS code): 例如(这是JS代码):
const fs = require(‘fs’);
won't kick intellisense when typing: 键入时不会触发intellisense:
fs.
further down the code. 进一步下来的代码。
However, if I install "some" modules in the project's node_modules directory (running the $ npm install command), I will get intellisense to work after bouncing it. 但是,如果我在项目的node_modules目录中安装“some”模块(运行$ npm install命令),我将在弹跳后获得intellisense工作。 Regardless of which modules were installed (apparently). 无论安装哪个模块(显然)。
Even more puzzling, removing the node_modules altogether will make intellisense continue to work. 更令人费解的是,完全删除node_modules将使intellisense继续工作。 Even bouncing VS Code won't affect intellisense, which will continue to work from this point onward. 即使弹跳VS Code也不会影响智能感知,智能感知将从此时起继续发挥作用。
It looks like installing "some" modules somehow fixed whatever wasn't right for intellisense. 看起来安装“某些”模块以某种方式修复了任何不适合intellisense的东西。 Question is, where is this fix living? 问题是,这个修复生活在哪里? In a file? 在文件中? And what is it? 还有,这是什么?
PS: I am using VS Code version 1.7.2 with Node 6.5.0, on Ubuntu Mate 16.04. PS:我在Ubuntu Mate 16.04上使用VS Code 1.7.2版和Node 6.5.0。
typings install dt~node --global --save
安装类似于: typings install dt~node --global --save
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.