简体   繁体   中英

JavaScript IntelliSense for external library is not working in Visual Studio 2015 Update 3

I am trying to use the Azure Document DB Server-Side JavaScript IntelliSense in Visual Studio 2015 Update 3.

I have downloaded the .js file from Document DB's GitHub site into my Visual Studio JavaScript references folder:

在此处输入图片说明

And referenced it in my .js file, but I don't see any Document DB IntelliSense:

在此处输入图片说明

However, if I open DocDbWrapperScript.js in VS the IntelliSense starts working:

在此处输入图片说明

Have I missed some config somewhere to make the /// <reference path="foo.js" /> syntax work?

This should work, please make sure the path is correct.

You can also try to register the docdbwrapperscript.js in General section: Tools->Options->Text Editor->JavaScript->Intellisense->References, ReferenceGroup = Generic, add a path to docdbwrapperscript.js there.

Thanks!

From the MSDN docs (emphasis mine):

The following rules apply to a reference directive:

  • The reference XML comment must be declared before any script.
  • You must use XML comments syntax with three slashes. References made by using standard comments syntax (two slashes) are ignored.
  • Only one file or resource can be specified per directive.
  • Multiple references to page-based scripts are not allowed.
  • If a page reference is specified, no other type of reference directives is allowed.
  • File names use relative paths. You can use the tilde operator (~) to make application-root-relative paths.
  • Absolute paths are ignored.
  • Reference directives in referenced pages will not be processed—that is, reference directives are not resolved recursively for pages.
  • Only script that is referenced directly by the page is included.

Switching over to use a relative path in the /// <reference path="..." /> fixed the IntelliSense for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM