jQuery IntelliSense停止在VS2019中工作 [英] jQuery IntelliSense Stopped Working in VS2019

查看:333
本文介绍了jQuery IntelliSense停止在VS2019中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用jQuery的大型.NET Core 2.0项目. 项目中的所有jQuery在运行时都可以正常运行.

I have a large .NET Core 2.0 project which uses jQuery. All jQuery in the project works perfectly fine during run-time.

但是,某些更改导致我的jQuery IntelliSense在VS2019中停止工作(无论在我的代码中键入"jQuery"还是"$"的简写形式).不幸的是,我找不到更改.

However, something changed that caused my jQuery IntelliSense to stop working in VS2019 (regardless of typing "jQuery" or the "$" shorthand in my code). I unfortunately cannot locate the change.

我的jquery.js/jquery.min.js文件位于wwwroot/lib/jquery/dist中,并且在_Layout.cshtml中的整个站点中都引用了我的jquery.js/jquery.min.js文件.

My jquery.js/jquery.min.js files are located in wwwroot/lib/jquery/dist and referenced throughout the site in _Layout.cshtml.

根据 VS2019文档:

默认情况下,Salsa语言服务将尝试检测正在使用的JavaScript库,并自动下载并引用描述该库的相应.d.ts文件,以提供更丰富的IntelliSense.这些文件将下载到%LOCALAPPDATA%\ Microsoft \ TypeScript用户文件夹下的缓存中.

By default, the Salsa language service will try to detect which JavaScript libraries are in use and automatically download and reference the corresponding .d.ts file that describes the library in order to provide richer IntelliSense. The files are downloaded to a cache located under the user folder at %LOCALAPPDATA%\Microsoft\TypeScript.

...是的,jQuery符合预期:

...and yes, jQuery is there as expected:

我尝试重新启动VS2019和PC,批量清理/重建并重置选项和

I've tried restarting VS2019 and my PC, batch clean/rebuild and resetting the JavaScript/Typescript checkboxes in the options and refreshing the Intellisense by deleting the .vs folder and restarting.

请注意,JavaScript IntelliSense可以按预期运行.

有什么想法吗?

推荐答案

我发现问题出在包括

I found the issue to be with including the MDBootsrap Pro (jQuery Version) Library in my project. Once I removed the library and re-added it, the IntelliSense worked again.

我仍然不确定这是由脚本冲突还是由IntelliSense尝试排序的脚本过载引起的.

I remain uncertain whether this was caused by a script conflict or simply an overload of script for the IntelliSense to try to sort through.

在问题中添加MDBootstrap标记,以防将来对其他人有帮助.

Adding MDBootstrap tag to the question in case it helps anyone else in the future.

这篇关于jQuery IntelliSense停止在VS2019中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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