We are getting the following "Error" message in our MVC web application in Visual studio 2017 Enterprise.
The language service is disabled for project 'C:\Work\Blackhawk
Platform\Platform-DEV-Branch\BlackhawkViewer\BlackhawkViewer.csproj'
because it included a large number of .js files. Consider excluding
files using the 'exclude' section of a 'tsconfig.json' file.
I have tried turning off the Language service in the options but this does not turn the message off:
This is a rather large web application. Is there a way to turn this message off without disabling any files in the tsconfig.json file as it suggests?
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.
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,
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"
]
}
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:
Go to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>.
Open command prompt as admin in current folder
Ran devenv /Setup
Ran devenv /ResetSkipPkgs
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 latest version of TypeScript for Visual Studio on Get TypeScript.
Related
I am unable to input values in output tab and wanted to run code directly inside the terminal.In previous version I was able to do so with the changes in settings.json file which is mentioned below but in the latest version 1.38 I was unable, Help.
[
{
"color-highlight.markerType": "dot-before",
"editor.formatOnSave": true
"explorer.confirmDelete": false
},
{
"code-runner.runInTerminal": true
}
]
Have you ever tried using CodeLLDB?
https://github.com/vadimcn/vscode-lldb/blob/master/MANUAL.md##stdio
While editing JavaScript source files in Visaul Studio 2017, the following error keeps occuring:
The JavaScript language service has been disabled for the following project(s): ...
Even if I disable the JavaScript language service entirely, the error keeps occuring. Why is this happening and how do I stop this error message from displaying all the time? Can I disable the JavaScript language service entirely?
The solution to the problem was simply to use a tsconfig.json file, even though there were only JavaScript files in my solution.
I've just used the following tsconfig.json file in the root of the project:
{
"compileOnSave": true,
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"sourceMap": true,
"target": "es2015",
"module": "amd",
"allowJs": false,
"allowSyntheticDefaultImports": true
},
"exclude": [
"lib",
"node_modules"
]
}
open 'developer command line tool for visual studio'. run :
devenv.exe /resetuserdata
I loaded up an older aspnet mvc project in Visual Studio 2017, and I can't build it because thousands of warnings/errors from jslint are telling me that the jQuery package has bad bracket placement, among many other things. Frankly, I don't care about any of the errors from jslint, least of all the jQuery errors.
I can't find any options for jslint in the GUI.
Right-clicking on the project gives no jslint context menu
It doesn't seem to exist in Tools > Options
I tried this solution, of turning off EsLint, but that did nothing.
JSLint.Net is a NuGet package. You can configure it via a JSLintNet.json settings file (at the end of that page it says there's a settings dialog, but I can't find it in either VS 2015 or VS 2017.) Or you can uninstall the package thru the Project > Manage NuGet Packages... menu.
Don't know about VS2015 or 2017, but in 2019 the settings file JSLintNet.json can be created in the project folder and then you can set
"runOnBuild": false,
"cancelBuild": false
Here's my complete file:
{
"ignore": [
"\\www\\js-lib\\*.*"
],
"options": {
"predef": {
"$": true,
"document": true,
"login": true,
"setup": true,
"window": true,
"popup": true
},
"plusplus": true,
"unparam": true,
"white": true
},
"output": "Warning",
"runOnSave": true,
"runOnBuild": false,
"cancelBuild": false
}
I am using visual studio code and want to run some test. I was using PC where it was working perfectly. I changed my system and copied all the files in same directory as these were before in old pc. But now visual studio does not recognizes the tests and this message keeps appearing up.
In settins.json under Workspace Settings I have,
{
"python.linting.pylintEnabled": false,
"python.unitTest.unittestEnabled": true
}
You should check your start directory and your matching pattern (-s and -p options).
https://docs.python.org/3/library/unittest.html#test-discovery
This configuration fixed it for me.
"python.unitTest.unittestEnabled": true,
"python.unitTest.pyTestEnabled": false,
"python.unitTest.nosetestsEnabled": false,
"python.unitTest.unittestArgs": [
"-v",
"-s",
"your_tests_directory",
"-p",
"test_*.py"
]
You can also play with the command line if you prefer it that way before setting the vs code configuration.
python -m unittest discover -v -s your_tests_directory -p test_*.py
I am currently wondering, why ESLint is not working in my project in Visual Studio 2017. There is the file ".eslintrc" in the project-root:
{
"extends": "defaults/configurations/eslint",
"env": {
"browser": true
},
"globals": {
"xhr": true
},
"rules": {
"eqeqeq": [ "error", "always", { "null": "ignore" } ]
}
}
If I remove the line with "eqeqeq", everything is working fine. But as soon as I add this line, no errors will be displayed at all.
Question 1: Is there any way to see an error-message about the issue ESLint obviously has?
Question 2 as a fallback: What is the issue with this line?
Thanks to btmills I took a dive into the sources and found the version: VS 2017 uses ESLint 2.0.0 (released 2016-02-12).
The correct configuration is:
"eqeqeq": [ 2, "allow-null" ]
Documentation is available here:
Getting started
Rules
The links from the error-list in VS 2017 lead to the current documentation, where you can find many features that do not work in version 2.0.0.