Describe the bug
Intelephense keeps telling be I'm using undefined classes when using the MongoDB extension/driver.
I keep getting Undefined type 'MongoDB\Driver\Cursor and Undefined type 'MongoDB\BSON\ObjectId.
Basically, when ever I refer to some object that exists in the extension, it throws those errors in VSCode. The code works though so PHP do have access to them.
To Reproduce
Install and enable the MongoDB extension/driver and do:
var_dump(new \MongoDB\BSON\ObjectId());
Intelephense should tell you that the class ObjectId is undefined but if you run the code, it should dump an object of that type
Expected behavior
Not to tell me it's undefined if it isn't.
Screenshots

Platform and version
Comments
As I understand it, there must be stubs for the extension/driver for Intelephense to know about it. I can also see that there aren't any for the mongodb extension/driver
However, I have no idea how to create those stubs. There probably is a guide somewhere but I can't find it?
It's kind of frustrating having the IDE showing errors that aren't real errors.
@magnus-eriksson please add mongodb to intelephense.stubs setting. Names are the same as folders in this repository: https://github.com/JetBrains/phpstorm-stubs
Most helpful comment
@magnus-eriksson please add
mongodbtointelephense.stubssetting. Names are the same as folders in this repository: https://github.com/JetBrains/phpstorm-stubs