Visual Studio 2015 RC3 TypeScript Intellisense不再起作用 [英] Visual Studio 2015 RC3 TypeScript Intellisense not working anymore

查看:173
本文介绍了Visual Studio 2015 RC3 TypeScript Intellisense不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将TypeScript 1.8.10和TypeScript工具用于VS2015 1.8.1.0 Beta. 另外,我正在使用VS2015 RC3

I'm using TypeScript 1.8.10 and TypeScript Tools for VS2015 1.8.1.0 Beta. Also, I'm using VS2015 RC3

我试图升级到TypeScript 2.0,但遇到了完全相同的问题,所以我又回到了TypeScript 1.8. 我试图修复VS2015,更改tsconfig.json的目标"和模块"选项,卸载整个项目并在项目文件中设置TypeScript选项,并尝试升级TypeScript工具,等等.但我仍然遇到这些错误:

I tried to upgrade to TypeScript 2.0, and I had the exact same issues, so I went back to TypeScript 1.8. I tried to repair VS2015, to change the tsconfig.json "target" and "module" options, to unload the whole project and setup the TypeScript options in the project file, tried to upgrade the TypeScript tools, and so on; but I still get these errors :

我的TypeScript文件找不到@angular包(是的,它们在我的node_module文件夹中),即使我有"experimentalDecorators":true ,我什至遇到了实验装饰器错误.我的tsconfig.json中的选项. 如下面的屏幕快照所示,TypeScript库存在很多错误:lib.d.ts和lib.es6.d.ts

My TypeScript files can't find the @angular packages (Yes they are in my node_module folder), and I even get the Experimental decorators errors, even though I have the "experimentalDecorators": true option in my tsconfig.json. And there are a lot of errors with the TypeScript libraries as you can see in the screenshot below : lib.d.ts and lib.es6.d.ts

问题是我的编译没有任何问题,但是我遇到了无数的智能错误,而且我无法再使用TypeScript编写代码,因此目前我真的无法工作了.

The thing is my build compiles without any issue, but I got countless intellisense errors and I can't code in TypeScript anymore so I really can't work anymore at the moment...

这是我的 tsconfig.json :

{
  "compilerOptions": {
    "outDir": "./wwwroot/app/",
    "target": "es6",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  },
  "exclude": [
    "wwwroot",
    "node_modules",
    "typings",
    "typings/main",
    "typings/main.d.ts"
  ]
}

这是我的 package.json :

{
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",

    "angular2-in-memory-web-api": "0.0.15",

    "systemjs": "0.19.36",
    "core-js": "^2.4.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.11",
    "zone.js": "^0.6.12"
  },
  "devDependencies": {
    "typescript": "^1.8.10",
    "typings": "^1.0.4",
    "gulp": "^3.9.1",
    "path": "^0.12.7",
    "gulp-clean": "^0.3.2",
    "gulp-concat": "^2.6.0",
    "gulp-typescript": "^2.13.1",
    "gulp-tsc": "^1.1.5",
    "run-sequence": "^1.2.2"
  }
}

这是我无数个智能错误的屏幕截图:

Here is a screenshot of my countless intellisense errors :

任何帮助将不胜感激,我真的因这些错误而迷失了,我不知道该怎么办...我想我可以完全重新安装VS 2015,但如果可能的话,我想避免这样做

Any help will be greatly appreciated, I'm really lost with these errors and I don't know what to do anymore... I guess I could completly reinstall VS 2015 but if possible I'd like to avoid doing that.

:添加了项目屏幕截图:

EDIT : Added project screenshot :

我发现,如果将tsconfig.json目标选项更改为"es5",即使以前没有任何问题,我也会在@angular软件包中遇到Build错误.不会更改es6和es5库的任何信息.

EDIT 2 : I found out that if I change the tsconfig.json target option to "es5", I get Build errors in @angular packages, even though it worked without any issue before. It doesn't change anything about the es6 and es5 libraries tho.

推荐答案

我仍然不知道问题出在哪里,最有可能是某些TypeScript配置在我的Visual Studio配置文件中变了,但是我通过卸载解决了我的问题并重新安装Visual Studio 2015 RC3.

I still don't know what the problem was, most probably some TypeScript config that went bad in my Visual Studio configuration files, but I solved my problem by uninstalling and re-installing Visual Studio 2015 RC3.

这篇关于Visual Studio 2015 RC3 TypeScript Intellisense不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆