1
我已经设置了一个node.js项目,我想使用VS-Code + Typescript。 如果我使用平滑的Javascript intellisense工作正常,VS-Code甚至会从缓存(例如〜/.cache/typescript/2.5/node_modules/@types/rethinkdb/index.d.ts)加载Typescript定义。但在.ts文件中,这根本不起作用。VS代码智能感知适用于Javascript文件,但不适用于TypeScript文件
的.js文件(instellisense工作) 的.ts文件(智能感知不工作)
这两个文件都在同一个文件夹中。 我tsconfig.json样子:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"watch": true
}
}
我缺少一个配置选项还是什么?
如果你的鼠标悬停在“rethinkdb”,它会给你一个文件路径吗?你尝试过“三重砍”吗? /// https://www.typescriptlang.org/docs/handbook/triple-刀耕火种directives.html –