我刚刚开始使用Webstorm,并希望为注入的对象启用变量解析。
E.g
如果我这样做。
const path = require('path');
并输入path.re webstorm将提供诸如" resolve"," relative"等选项。等
但是,如果我使用依赖注入,那么它就不再有效了。
//in file 1
doSomething( {path: path} );
//then , in file 2
function doSomething( params ) {
const {path} = params;
//i type path.re and code completion no longer works, and i
//get unresolved variable warnings if i use anything in path.
}