VS 2013中的JavaScript IntelliSense列表,用于自定义脚本太长。如何压制一些物品? [英] JavaScript IntelliSense list in VS 2013 for a custom script TOO LONG. How to suppress some items?

查看:150
本文介绍了VS 2013中的JavaScript IntelliSense列表,用于自定义脚本太长。如何压制一些物品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我首先会问2个问题所以如果有人知道它不必阅读这篇长篇文章:


  1. 但是如何在智能感知列表中为自定义JavaScript文件(无论是.js还是.ts - 带编译的打字稿)抑制大量不需要的项目?

  2. 如何精确控制我需要的东西? _references.js似乎是一个很好的起点(全球参考)

  3. 任何人都可以解释.validate-vsdoc.js和.intellisense.js和///

当我观看Mads Kristensen的视频讨论了JavaScripts IntelliSense如何根据您当前的上下文列出可用的对象,函数,属性和参数和扩展JavaScript IntelliSense文章讨论了如何进一步扩展IntelliSense。


  1. 但是如何在自定义JavaScript文件的IntelliSense列表中抑制大量不需要的项目(无论是.js还是.ts - 带编译的打字稿) ?

  2. 如何精确控制我需要的东西? _references.js似乎是一个很好的起点(全球参考)

  3. 任何人都可以解释.validate-vsdoc.js和.intellisense.js和///

当我看到Mads表现不错时我是MAD :)
谢谢,
Rad

解决方案

我想这与ReSharper扩展及其智能感知设置有关,它们会覆盖Visual Studio的IntelliSense设置。



<$例如,c $ c> dhtml.js 是一个内部ReSharper文件,其中声明了所有标准浏览器对象和属性。至少可以从此文件中选择IntelliSense下拉对话框中的前X个属性/方法。


I will start by first asking 2 questions so If anyone knows it doesn't have to read this long post:

  1. But how do I suppress enormous list of undesired items in IntelliSense list for a custom JavaScript file (be it .js or .ts - typescript with compilation)?
  2. How can I fine control what I would need? _references.js seems like a good starting point (for global reference)
  3. Can anybody explain how .validate-vsdoc.js and .intellisense.js and ///

When I watched Mads Kristensen's video Visual Studio: C# class Intellisense in JavaScript/TypeScript
I noticed that Mads' Intellisense for his "data" JavaScript variable shows a nice, short list of objects, functions and properties relating to the current context.

I use defaults from VS 2013 MVC project.
Mine shows a much longer list making Intellisense almost useless:

In my _references.js I have this (which Mats I suppose have as well)

/// <autosync enabled="true" />
/// <reference path="modernizr-2.6.2.js" />
/// <reference path="jquery-1.10.2.js" />
/// <reference path="bootstrap.js" />
/// <reference path="respond.js" />
/// <reference path="jquery.validate.js" />
/// <reference path="jquery.validate.unobtrusive.js" />
/// <reference path="rads.js" />
/// <reference path="../models/accountviewmodels.cs.js" />

In my JavaScript IntelliSense References section for Implicit (Web) Reference Group I have defaults:

libhelp.js
sitetypesWeb.js
domWeb.js
underscorefilter.js
showPlainComments.js
~/Script/_references.js

All files (except _references.js) are located in this folder (nothing significant about them):

C:\Program Files (x86)\Microsoft Visual Studio 12.0\JavaScript\References\

As you can see from the second image I am getting some method IntelliSense from these files:

Dhtml.js
EcmaScript.js
ecma.js

But where do these properties and methods come from:

$1, $2, ..., $10
ABORT_ERR, ALIASED_LINE_WIDTH_RANGE, ....

When searching the Internet I found Google closure-compiler's file: webgl.js which contains many of these upper cased properties.

I know that JavaScript IntelliSense article talks about how JavaScripts IntelliSense lists the objects, functions, properties, and parameters that are available based on your current context and Extending JavaScript IntelliSense article talks about extending IntelliSense further.

  1. But how do I suppress enormous list of undesired items in IntelliSense list for a custom JavaScript file (be it .js or .ts - typescript with compilation)?
  2. How can I fine control what I would need? _references.js seems like a good starting point (for global reference)
  3. Can anybody explain how .validate-vsdoc.js and .intellisense.js and ///

I am MAD when I see Mads is doing good :) Thanks, Rad

解决方案

I guess this has something to do with the ReSharper extension and its IntelliSense settings which override Visual Studio's IntelliSense settings.

dhtml.js, for example, is an internal ReSharper file where all standard browser objects and properties are declared. At lest the top X properties/methods in your IntelliSense dropdown dialog are picked up from this file.

这篇关于VS 2013中的JavaScript IntelliSense列表,用于自定义脚本太长。如何压制一些物品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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