简体   繁体   中英

Make requireJS intellisense in Visual Studio 2013-2015

This seems a simple problem, but I can't find any information online about it, neither here in Stack Overflow.

I am having problems making Intellisense work under Visual Studio 2013/2015 with RequireJS (client-side).

In theory you only need to add a reference in the _references.js file, like this:

/// <reference path="libs/require.js" data-main="main.js" start-page="../default.htm" />

but I get this message all the time through the Output window regarding the "JavaScript Language Service":

Error regarding RequireJS path in VS

It seems as if the feature was trying to load my "main.js" file from the VS JavaScript references folder instead of my real folder which gets a lot of "../" added and can not be resolved. In fact the suggested path that can't be loaded it's OK except for all the "../".

I've tried diverse combinations of relative paths to write the attributes, but no luck.

This is very annoying and I can't find any reliable info on the Web regarding this specific problem. The only reference I've found is this one:

http://blog.nansen.com/2015/09/getting-visual-studio-intellisense-to.html

and they suggest to add a baseUrl config code to the _references.js file, which hasn't worked for me at all.

Any ideas on how to solve this?

And by the way: any reference on how to make this work under VS Code also?

Found out that it related to the solution/project that is on another drive letter.

VS studio is installed on drive C: and the solution/project is on drive D: .

Have not found a solution to this problem, but can be corrected by moving to drive C: .

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