intellisense and code complete for DefinitelyTyped (TypeScript type definitions) on WebStorm IDE

前端 未结 3 841
长情又很酷
长情又很酷 2020-12-03 12:14

How can I get WebStorm IDE to give me code completion for libraries that I\'ve downloaded.

\"JavaScript

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 12:56

    As basarat says in his answer, you need to include the definitions manually. The easiest way to do this is with tsd. Once installed (npm install -g tsd), navigate to the directory you want to hold the typings, and install definition files (such as angular, in the following example) like this:

    tsd query angular --action install
    

    or, better yet:

    tsd init
    tsd query angular --save --action install
    

    Note that you can do all this within Webstorm (alt-F12 opens a terminal window).

提交回复
热议问题