简体   繁体   English

Intellisense不使用项目打字稿版本

[英]Intellisense not using project typescript version

Is there a way to determine what version of TypeScript IntelliSense is using in VS2017? 有没有一种方法可以确定VS2017中使用的TypeScript IntelliSense版本? We have a web project that is using TypeScript 2.1 (in project properties) and has the following tsconfig.json file: 我们有一个使用TypeScript 2.1(在项目属性中)的Web项目,并且具有以下tsconfig.json文件:

{
  "typeAcquisition": {
    "enable": false
  },
  "compileOnSave": true,
  "compilerOptions": {
    "noImplicitAny": false,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5"
  },
  "include": [
    "ScriptsApp",
    "Scripts",
    "ScriptsModels"
  ]
}

We can get the solution to compile the TypeScript files without error or warning, but we always get Intellisense errors. 我们可以得到在没有错误或警告的情况下编译TypeScript文件的解决方案,但是我们总是会遇到Intellisense错误。

In the build log I can see msbuild is using the 2.1 version. 在生成日志中,我可以看到msbuild正在使用2.1版本。 If I change the version to TypeScript 2.6, I get the same errors in build en IntelliSence. 如果将版本更改为TypeScript 2.6,则在Build IntelliSence中会出现相同的错误。 So it looks like IntelliSence is using TypeScript 2.6. 因此,看起来IntelliSence使用的是TypeScript 2.6。

Is there a way to set the IntelliSense TypeScript version? 有没有办法设置IntelliSense TypeScript版本?

I have Visual Studio 2017 (15.4.4) installed with Typescript 2.1, 2.2, 2.3 and 2.6. 我已经安装了带有Typescript 2.1、2.2、2.3和2.6的Visual Studio 2017(15.4.4)。

The issue was resolved in VS 15.5.x. 在VS 15.5.x中已解决了该问题。 See: https://github.com/Microsoft/TypeScript/issues/20438 参见: https : //github.com/Microsoft/TypeScript/issues/20438

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Typescript编译器和IntelliSense之间的ECMAScript版本不匹配 - ECMAScript version mismatch between Typescript compiler and IntelliSense 将RequireJS与TypeScript一起使用并保留Intellisense - Using RequireJS with TypeScript and Retaining Intellisense VS Code:在 typescript 项目中启用 javascript 智能感知 - VS Code: enable javascript intellisense in typescript project 使用打字稿时,Nativescript Android智能感知 - Nativescript Android intellisense when using typescript Intellisense首选Visual Studio 2017中最旧的TypeScript版本 - Intellisense prefers oldest TypeScript version in Visual Studio 2017 VSCode Typescript Intellisense在最简单的项目设置中不起作用 - VSCode Typescript Intellisense not working in the most simple project setup 在 Angular 的项目版本上运行 typescript - Run typescript on project version of Angular 有没有办法在VSCode中启用TypeScript接口IntelliSense for React项目? - Is there any way to enable TypeScript interfaces IntelliSense for React project in VSCode? 在Typescript项目中使用抓取 - Using fetch in Typescript project 使用JavaScript的Visual Studio代码以及TypeScript文件作为Intellisense的参考 - Visual Studio Code using JavaScript with a TypeScript File as Reference for Intellisense
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM