【发布时间】:2016-11-07 17:08:08
【问题描述】:
我正在从 Webstorm 迁移到 Visual Studio Code。 Webstorm 的表现非常糟糕。
Visual Studio 代码对于查找我需要的依赖项并导入它们并不是很有帮助。到目前为止,我一直在手动执行此操作,但老实说,我宁愿等待 15 秒让 webstorm 找到并添加我必须手动挖掘的导入。
我正在使用来自 @minko-gechev https://github.com/mgechev/angular2-seed 的 angular2 种子
我的 baseDir 中有一个 tsconfig.json,如下所示:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"pretty": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true
},
"exclude": [
"node_modules",
"dist",
"typings/index.d.ts",
"typings/modules",
"src"
],
"compileOnSave": false
}
我的 src/client 目录中还有一个如下所示:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true
}
}
我不知道为什么有两个。 angualr 种子项目使用 typescript gulp 构建任务,所以我猜编译是不同的。
我能做些什么让 vscode 更有帮助??
【问题讨论】:
-
试一试alm.tools ????
-
:-) 目前正在经历同样的事情。你找到解决办法了吗?
-
是的 - 我发现一切都是通过扩展添加的。尝试“自动导入”“打字稿导入帮助”“tsd-recommender”“npm intellisense”
-
我尝试了“自动导入”扩展,但它有点挂起,同时表明它正在“扫描”。我在 Windows 10 上。有人有同样的问题吗?
-
@reach4thelasers 嘿,我也处于与您尝试查找扩展等相同的位置,我已经安装了您在上面指定的扩展,然后我复制了您在照片中提到的代码但是我仍然在 PipeTransform 下收到红色错误它没有让我选择自动导入它,而是我收到了您在照片中显示的错误...您设法解决了这个问题吗?
标签: typescript angular visual-studio-code