【问题标题】:AngularJS intellisense in VSCode stopped working - any idea why?VSCode 中的 AngularJS 智能感知停止工作 - 知道为什么吗?
【发布时间】:2016-12-15 12:39:08
【问题描述】:

奇怪的事情 - 它以前工作过,然后突然停止工作。

当然,我在我的项目(和其他一些语言)中安装了 Angular 的类型:

打字dt~angular --global --save

所以我有 typings.json 文件:

{
  "globalDependencies": {
    "angular": "registry:dt/angular#1.5.0+20160802155123",
    "angular-route": "registry:dt/angular-route#1.3.0+20160317120654",
    "angular-sanitize": "registry:dt/angular-sanitize#1.3.0+20160317120654",
    "bootstrap": "registry:dt/bootstrap#3.3.5+20160619023404",
    "jquery": "registry:dt/jquery#1.10.0+20160704162008"
  }
}

当然,我有包含所有 *.d.ts 文件的 typings 文件夹。

知道为什么我不再获得 Angular 智能感知了吗?

更新 .cshtml 文件中的类型似乎不起作用。 我有 .cshtml 文件,将其重命名为 .html 后,智能感知开始工作。

【问题讨论】:

    标签: intellisense visual-studio-code typescript-typings


    【解决方案1】:

    自上次更新以来,如果没有 tsconfig.json 文件,VS Code 中的 TypeScript 智能感知似乎不再工作。使用以下内容向您的项目添加一个:

    {
      "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "sourceMap": true
      }
    }
    

    【讨论】:

      【解决方案2】:

      似乎打字在 .cshtml 文件中不起作用。

      我有 .cshtml 文件,将其重命名为 .html 后,智能感知开始工作。

      重命名为 .cshtml - 停止工作。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-09-03
        • 1970-01-01
        • 1970-01-01
        • 2012-04-05
        • 2019-11-11
        • 1970-01-01
        • 1970-01-01
        • 2011-10-26
        相关资源
        最近更新 更多