After successfully setting up Typescript for code completion following the guidelines provided in this resource, I now want to enable code completion for Firebase in VS Code. However, I am unsure of the steps to achieve this.
How can I activate code completion for Firebase in VS Code?
Update 1:
Having configured my Firebase project using commands such as firebase init
and firebase init functions
in the VS Code terminal, I aim to make code completion functional in the forthcoming functions/index.ts
file that needs to be created.
Following the setup instructions, I proceeded with npm init
and executed:
npm install --save-dev @types/firebase
In the root directory of my project, I now have a node_module
directory containing only the @types/firebase
package along with the specified package.json
details.
To test the functionality, I created an index.ts
file but unfortunately, typing firebase.
does not trigger any code suggestions. What additional steps are required to enable code completion for Firebase?
Update 2:
.vscode/tasks.json configuration:
{
// Refer to https://go.microsoft.com/fwlink/?LinkId=733558
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-w", "-p", "."],
"showOutput": "silent",
"isBackground": true,
"problemMatcher": "$tsc-watch"
}
tsconfig.json settings:
{
"compilerOptions": {
"target": "es5",
"sourceMap": true
}
}
Unfortunately, code completion remains unresponsive at this stage!
Update 3:
Relevant portion of the functions/index.ts
file where code completion is crucial:
import * as firebase from 'firebase';
var functions = require('firebase-functions');
The statement
import * as firebase from 'firebase'
was observed in this video, showcasing successful code completion. Is there a method to extend this feature to public/app.ts
, the client-side file, as well?