How can I get autocomplete/intellisense features for Firefox extension APIs on vscode?

950 views Asked by At

I am developing my first firefox extension on vscode and just discovered that autocomplete/intellisense isn't working for web extension APIs e.g. browser.tab, browser.extension like it does for regular JavaScript. I like the intellisense feature because it minimizes errors and docs consultation. A google search result suggested I add:

{
  "typeAcquisition": {
     "include": ["firefox"]
  }
}

in a jsconfig.json file which I've done but the issue still persists. Is there a way I can get intellisense to work here or am I out of luck?

1

There are 1 answers

0
tyirvine On

Create a jsconfig.json file in your source and add this line to it ⤵︎

{"typeAcquisition": {"include": ["firefox-webext-browser"]}}

You should then have suggestions for the browser namespace.