AutoComplete in VS Code

Is their a way to get Babylon JS snippets in a JS project?

You can find the folder structure here (Babylon is in the libraries folder).

This is the file we use for the playground, Babylon.js/templates.json at master · sebavan/Babylon.js · GitHub

And might be able to reference them from Snippets in Visual Studio Code

I meant IntelliSense for the class definitions. For example typing BABYLON.Arc would have ArcRotateCamera in the tab options, which I currently do not have.

2 Likes

The declaration file is part of the npm package, and you can reference it in you ts.config.json types property

I’m not using the NPM package though, I’m using the minified JS file.

@RaananW might know if they are still available to DL from the CDN ?

Of course, they are available on the cdn, and are referenced in both max and monitored versions of each package. You can download them and add to your project, of reference them using a reference comment, providing their path or type (https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)

1 Like

Which path[s] should I use? I’m not entirely sure which files your talking about (I’m assuming a .d.ts?)

oh, yes. you need to reference it locally. the path is the path to the file (relative path usually). change the .js with .d.ts when downloading from the server

1 Like

Thanks so much! Using the triple slash with the .d.ts worked great.

2 Likes