I often have to inject dependencies in some class:
class Foo {
constructor(private userService: UserService) {
}
}
What I'm looking for is a code completion for a UserService
type when I'm typing userService
:
class Foo {
constructor(private userSer) { // <-- suggests UserService type so I can get the previous code example
}
}
I know it is possible with Kotlin and IntelliJ IDEA but I'm wondering whether it is possible with TypeScript and WebStorm.
CodePudding user response:
In Settings | Editor | General | Code Completion, JavaScript, try enabling both Suggest variable and parameter names and Add type annotations for suggested parameter names - does it help?