Make requireJS intellisense in Visual Studio 2013-2015

This seems like a simple problem, but I can't find any information on the Internet about it, not here in Stack Overflow.

I am having trouble working Intellisense in Visual Studio 2013/2015 with RequireJS (client side).

In theory, you need to add a link to the _references.js file, for example:

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

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

Error regarding RequireJS path in VS

It seems that the function tried to load my file "main.js" from the VS JavaScript link folder instead of my real folder, which gets a lot of "../" and cannot be resolved. The actual proposed path that cannot be loaded is OK, with the exception of all the "../".

I tried various combinations of relative paths to write attributes, but not good luck.

This is very annoying, and I cannot find reliable information on the Internet regarding this particular problem. The only link I found is:

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

and they suggest adding the baseUrl configuration code to the _references.js file, which didn't work for me at all.

Any ideas on how to solve this?

And by the way: any link on how to make this work under VS code too?

+5
source share
1 answer

I found out that this is connected with a solution / project, which is located on a different drive letter.

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

Could not find a solution to this problem, but it can be fixed by moving to C: drive.

-2
source

Source: https://habr.com/ru/post/1240713/


All Articles