0

I wonder if there is any way to obtain IntelliSense for JavaScript classes in other files in Visual Studio 2015? I am using node tools for visual studio (NTVS 1.2) As an example I created a node project and added a javascript file 'test.js':

var Polygon = class Polygon {
    constructor(height, width) {
        this.height = height;
        this.width = width;
    };

    hi() { return 'hi' };
};

Polygon.hello = function hello () { return 'hello' };

Polygon.prototype.yo = function yo () { return 'yo' };

module.exports = Polygon;

In the server.js file I have:

var Polygon = require('./public/js/test.js');
var p = new Polygon(1, 1);

The 'hi' function shows up in IntelliSense on the 'p' object, but not 'hello' and 'yo', even though it is possible to use them in the server.js file as Polygon.hello() and p.yo().

ueriksson
  • 1
  • 2
  • You didn't even search for it, did you? – SOReader Aug 10 '16 at 20:52
  • http://stackoverflow.com/questions/31544470/es6-es7-support-in-visual-studio-2015-community http://stackoverflow.com/questions/37564786/visual-studio-2015-doesnt-support-es6-syntax – SOReader Aug 10 '16 at 20:54
  • @SOReader, I have actually spent several hours searching for a solution... Reading the links you provided does not actually help me to solve or to understand what is wrong in my example. Am I missing something basic here or what? – ueriksson Aug 10 '16 at 21:32

1 Answers1

0

check out the following links https://blogs.msdn.microsoft.com/visualstudio/2015/06/10/javascript-editor-improvements-in-visual-studio-2015/

https://msdn.microsoft.com/en-us/library/bb385682.aspx

Vishal Prajapati
  • 588
  • 5
  • 13