我正在尝试使用Resharper在VS2017中开发Angular (4)应用程序,但我遇到了类(模块、组件等)的问题。在尝试通过按CTRL + Spacebar键自动完成代码时,不会解析。
在这里编写LayMod应该可以在./layout/layout.module中找到模块LayoutModule

如果我写出完整的名称并单击其他位置,Resharper会建议导入:

对于从node_modules目录导入的模块,例如来自@angular/router的RouterModule,也会发生这种情况。
我使用的是包含在VS2017 (15.3)中的JavascriptServices/Angular快速入门模板和最新的稳定Visual Studio (15.3)和ReSharper12 (2017.2 EAP12)版本。
下面是使用的tsconfig.json:
{
"compilerOptions": {
"module": "es2015",
"moduleResolution": "node",
"target": "es5",
"sourceMap": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true, // Workaround for https://github.com/angular/angular/issues/17863. Remove this if you upgrade to a fixed version of Angular.
"strict": true,
"lib": [ "es6", "dom" ],
"types": [ "webpack-env", "jasmine" ]
},
"exclude": [ "bin", "node_modules" ],
"atom": { "rewriteTsconfig": false }
}如何在VS2017 (+Resharper)中自动完成未导入的模块?它是否被支持,或者我必须使用另一个编辑器,比如Webstorm?
发布于 2017-08-16 21:32:20
您是否在ReSharper→选项→代码编辑→HTML→编辑器中启用了Angular 2支持?请参阅ReSharper help pages。
https://stackoverflow.com/questions/45711230
复制相似问题