在VSCode中获取智能感知

问题描述 投票:2回答:1

对于各种库,我正在尝试将intellisense进入我的visual studio代码安装。

我安装了打字(https://github.com/typings/typings),试图让它变得更容易。

现在,我已经管理(使用打字)来安装jquery.d.ts和bootstrap.d.ts,我认为这是正确的方法。

但是,我仍然没有任何intellisense。

为了避免必须添加///对我所有文件的引用,我在jsconfig.json文件中添加了文件,如下所示:

"compilerOptions": {
        "target": "es6",
        "files": [
            "typings/bootstrap.d.ts",
            "typings/jquery/jquery.d.ts"
        ]
    }

但没有运气。

我的大多数谷歌搜索都发现TSD作为此工具,不推荐使用并指向打字。但它似乎只是为我获取文件,而不是将它们包含在我的项目中。

救命!为了获得这些库的intellisense,我该怎么做才能进入我的编辑器?

visual-studio-code intellisense definitelytyped
1个回答
1
投票

这就是你的jsconfig.json应该是这样的:

{
  "compilerOptions": {
    "target": "ES6",
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "node_modules"
  ]
}

VS代码自动包含.ts文件。

© www.soinside.com 2019 - 2024. All rights reserved.