Search code examples
javascriptvisual-studio-2015intellisensepaperjs

Intellisense Javascript doesn't work for scope variables (VS 2015 Web)


I want to use Paper.js with Intellisense, but it doesn't work, because all the functions are capsulated by a global variable and the Intellisense doesn't recognize it. When I use it in JetBrains WebStorm it works.

Here it doesn't work.

var point = new Point(10, 10);

And here it works:

var point = new paper.Point(10, 10);

Both solutions work in the browser, but just the second one gives me Intellisense support.

Is there a workaround for it?

Thank You!


Solution

  • You can define:

    var Point = paper.Point; 
    var Path = paper.Path; 
    // etc... 
    

    at the beginning of your project.

    Intellisense can't understand the paperjs language (which enables operator overloading).