Is there a way to add a "reference path" via config?

I’m currently having to put /// <reference path="globals.d.ts" /> at the top of my scripts to load some global vars in intellisense. If I want this to apply to all my scripts, is there a way to do this without a file comment, perhaps via a config file?

If not that, is there a way to create a theia extension that can do this?

I assume you are working with TypeScript?

If so, what’s your tsconfig.json like? You should properly set the compilerOptions.lib array.

Also tsconfig alone won’t provide you types for Node. For that you need to install @types/node@<node-version-ish>.

Note that just having some .d.ts file in my workspace seems to be picked up by TypeScript, providing completion for the items declared there in other TypeScript files…

Actually, this is just regular front-end javascript. Our students will be using a library called p5.js, and I found a typings file for it that contains the full API description. My goal is to be able to have auto-completion for those functions, without needing the /// <reference> tag.

I’ve tried putting the .d.ts file in the same folder, but that doesn’t seem to work.

@paul-marechal Are you aware of any other ways to configure intellisense for libraries used in a static frontend javascript project?

Our students will be using a library called p5.js, and I found a typings file for it that contains the full API description. My goal is to be able to have auto-completion for those functions without the students needing to configure anything on their own (ie, I can update the container image w/ some default configuration)

I’m not sure no, sorry :frowning:

This sounds like a generic JavaScript configuration issue, so I’d recommend looking through https://code.visualstudio.com/docs/nodejs/working-with-javascript.

You could also ask TypeScript/JavaScript communities to get help with that issue.

If there is a solution and it works in VS Code but not in Theia then we could help more maybe.

I’m just not really familiar with raw Javascript and your particular setup. If it requires some configuration to get working maybe you can do it once and share it with your students as a template?