*.intellisense.js和_references.js中的条目之间的差异

Difference between *.intellisense.js and entry in _references.js

本文关键字:js 之间 intellisense references      更新时间:2023-09-26

我在Visual Studio 2015中注意到,在创建新的ASP.NET MVC Web项目时,它会自动添加一个jquery-1.10.2.intellisense.js文件。阅读微软关于*.intellisense.js文件的文档让我不太清楚,我想知道这到底能做什么。如果它将intellisense添加到Visual Studio中,那么它与_references.js中的/// <reference path="jquery-1.10.2.js" />条目有何不同?

_references.js文件将为用户提供该文件中内容的智能感知,这些内容将是函数名和签名(参数名)。

intellisense文件包含Visual Studio可以读取的其他XML注释,以向用户提供更多信息。例如,它可以添加一行///<summary></summary>来总结功能,添加一列///<param name="">description</param>来提供参数的附加信息等。

由于并非所有人都在VisualStudio环境中使用jQuery,因此intellisense文件是在VS添加了对JavaScript的更好支持后创建的。

下面是为VS intellisense创建JavaScript XML注释的示例:https://msdn.microsoft.com/en-us/library/bb514138.aspx