How to get code completion and suggestions for 3rd party External Libraries? (Javascript)

A bit of background... I use Pycharm for full stack. I have it setup so that my static/ dir has eslint, and Pycharm can find it automatically (and runs it on save). It works pretty nicely.

However, I am having issues getting code-completion and suggestions for a third party library (BabylonJS). 

I followed the steps here to add an External Javascript Library from the included CDN link:

https://www.jetbrains.com/help/pycharm/configuring-javascript-libraries.html#ws_js_external_library_downloaded_from_CDN

 

Here is the CDN and External Libraries directory:

 

The problem is that in my editor, Babylon is not recognized. The red-highlights can be ignored (they are just eslint warnings).

However I cannot see any relevant method() names when I start typing (everything is unresolved):

 

How can I get suggestions for BABYLON to show up when typing as well as resolve all of the Babylon methods?

Also as a side note, the code itself runs fine.

6 comments
Comment actions Permalink

Hmm never mind it just started working. I had opened and closed the IDE several times but not effect. I don't know why it started working now but it did :)

0
Comment actions Permalink

Well. I'm having the exact same problem in both PhpStorm as well as WebStorm. Tried both preview and normal release from babylon CDN.  Also tried both minified as well as 'max' version. It just doesn't work.

When i install using npm i @babylonjs/core@preview webstorm offers me to include an import statement like so:

import * as BABYLON from "@babylonjs/core";

afterwhich code completion does work somewhat, but my code doesnt work, when i remove this import statement it starts to work again.

0
Comment actions Permalink

@Colleyloyejames Did you try installing typings for the library via Settings | Languages & Frameworks | JavaScript | Libraries?

 

0
Comment actions Permalink

After I had posted I realized that it still wasn't actually working haha. Elena I tried adding babylon to the External Libraries yes. Originally I was trying with a CDN, but there was a highlight on the CDN URL suggesting that I download it locally (which I did).

 

0
Comment actions Permalink

Oh I know what it was... the type hints are there if I install it as an NPM package. But I was hoping to do it the old school way with either CDN or local file, but will try again. 

 

0
Comment actions Permalink

Ah yes I just tried to install Babylon Typings again but still no luck.. here's the CDN version that actually runs and works in my browser but doesn't get recognized:

 

Then here is the NPM one that looks great and all is recognized... however it doesn't run for me (I get an import error in the browser console):

1

Please sign in to leave a comment.