Turning off “Language Service Disabled” error message in VS2017

天大地大妈咪最大 提交于 2019-11-30 02:44:43
Moustafa Mansour

To solve this issue do the following:

  • Create file in root directory of your project and call it tsconfig.json
  • Add this:
{
  "compilerOptions": {
    "allowJs": true, 
    "noEmit": true, 
    "module": "system",
    "noImplicitAny": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "sourceMap": true
  },
  "include": [
    "scripts"
  ],
  "exclude": [

  ],
  "typeAcquisition": {
    "enable": true 
  }
}

Please have a look at the below two links for tsconfig.json explanation, because you may still need to change it according to your setup. This is the only way that worked for me. I hope that will help.
https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
https://developercommunity.visualstudio.com/content/problem/8148/javascript-intellisense-not-working.html

This helped me. You can have a try.

 Go to Tools -> Options -> Text Editor -> JavaScript/TypeScript -> Language Service -> General

and uncheck the box: "Enable the new JavaScript language service.

I have found a solution for this problem.

I reset my userData using:

devenv.exe /resetuserdata

Since doing this the JavaScript settings seem to have persisted and I no longer get the language service error above.

TAKE NOTE: This will reset all your user data and customisations.

I had the same problem after migrating Ionic 1 project from VS2015 to VS2017, first I executed git clean -fxd as sugested above and added this content into tsconfig.json in my ionic project.

{
"compilerOptions": {
    "noImplicitAny": false,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5"
},
"exclude": [
    "node_modules",
    "www",
    "bower_components"
    ]
}
Iman Bahrampour

I solved this problem with following solution:

When you have a JavaScript file that is included in the project.csproj file but isn't in the project folder, this error occurred.

For example I have a .csproj file like below:

 <ItemGroup>
     <Content Include="Scripts\Test.js" />
 </ItemGroup>

The Test.js is included in the .csproj file, but it isn't in the Scripts folder:

Delete the <Content Include="Scripts\Test.js" /> line from the .csproj file and rebuild your project

Solution that worked for me:

  1. Go to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>.
  2. Open command prompt as admin in current folder
  3. Ran devenv /Setup
  4. Ran devenv /ResetSkipPkgs

In My case I just disable TypeScript support on Visual Studio:

Tools > Extensions and Updates > TypeScript for Microsoft Visual Studio > Disable

After that, just restart Visual Studio, and you are good to go.

Hope this will help,

For me is helping the next solution. I've create a tsconfig.json file in root of the my project with "disableSizeLimit": "true" option.

So, my tsconfig.json file is:

{
  "compilerOptions": {
  "disableSizeLimit": "true"
},
"exclude": []
}

If none of suggested methods worked, try:

npm install -g typescript@latest

and then

Install the lastest version of TypeScript for Visual Studio on Get TypeScript.

Hope this helps...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!