Display Navigation Bar for JavaScript files in Visual Studio 2015 + Node.js

1k Views Asked by At

A new(?) feature was promoted with Visual Studio 2015 for Javascript developers: Navigation Bar lists the objects and their methods in 2 select boxes above the code editor (as it does for years with C++ sources).

Unfortunately I can see this Navigation Bar only for ASP.NET projects. When I create a Node.js project the Navigation Bar disappears!

Did somebody manage to use Navigation Bar with Javascript / Node.js projects? Or, is there an equivalent application or VS extension that does the job?

The Bar can be activated (or not!) in menu Tools / Options... / Text Editor / Javascript and Node.js

Thank you by advance for your help.

(I asked MS directly via the "Customer Feedback" program but don't expect a quick answer. also adding references to require.js did not work.)

1

There are 1 best solutions below

0
On BEST ANSWER

I opened an Issue on the NTVS repository, and finally got an indirect answer : The (new) JS analyser for Node.js is not the same than for Client-Side Javascript.

There's a workaround that consists in changing the Build Action of the JS file properties (in Solution Explorer) from "Compile" to "Content" or "None".

Re-open the JS to make Navigation Bar appear at last!

EDIT: Here is a comprehensive explanation from Sara Itani at Microsoft: https://github.com/Microsoft/nodejstools/wiki/Working-with-Browser-(Clientside)-JavaScript-in-NTVS