[英]VSCode Typescript Intellisense not working in the most simple project setup
自从很长一段时间以来,我一直在愉快地使用VSCode智能感知。
现在,我做的事情非常简单:创建一个新项目,添加一个类似于rxJs的包,然后开始编码。
我发现,智能感知无法像过去那样正常工作。
特别是,如果我只是打开一个像test.ts这样的文件并添加以下无辜的代码,
of('abc'). // of is a function of rxJs
我从智能感知中得到了这个回应
同时,如果我开始手动导入函数,并在方括号之间进行ctrl+space
,则会获得预期的帮助。
我很确定我缺少一些基本的知识,但是经过几个小时的浏览后我找不到任何答案。
这是我的tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "dist",
"sourceMap": true,
"declaration": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": [
"src/*.ts",
"src/**/*.ts"
],
"exclude": [
"node_modules"
],
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
}
该功能of
需要进口它是在文件中供。
错误:
of('abc'). // of is a function of rxJs
没有错误:
import {of} from 'rxjs';
of('abc'). // of is a function of rxJs
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.