Search code examples
typescriptgoogle-apps-scriptvisual-studio-codeclasp

GAS/clasp: How do I get autocomplete/intellisense to work in VSCode for 3rd Party libraries


I am using VSCode to edit Google App Script (GAS) code with clasp. I have intellisense working for the core libraries just fine.

(This post helped)

However, I am also using a Firestore library in the ScriptApp project and intellisense is not working for the FirestoreApp.

I've tried included the library Javascript code in my project directory and also in the node_modules directory - but no luck.

Does anyone have any tips? Thanks.


Solution

  • For 3rd Party Libraries, like FirestoreApp, autocompletion does not work.

    You will need to create your own .d.ts files (optionally added to DefinitelyTyped).

    Another option would be to copy/paste the library into your script, and editors like VS Code will provide light autocompletion (1 level deep). The code doesn't need to be in the node_modules directory.