Hi dbyy!
That’s not a good idea and always lead to errors in the past.
Haveing just a single project open in VS Code at a time will save you headache.
In PlatformIO, libraries are installed per project for a good reason: reproducibility.
You can specify the exact version number of the library to be used!
Imagine you have two projects that use ArduinoJson. Project A requires ArduinoJson 5.1 and Project B requires ArduinoJson 7.2!
If you use a “global installed” version of ArduinoJson you can either build Project A or Project B, but not both!
This can be easily solved with PlatformIO in the platformio.ini
Project A:
lib_deps = blanchon/ArduinoJson @ ^5.1.0
Project B:
lib_deps = bblanchon/ArduinoJson @ ^7.2.0
But there are good reasons for local libraries, e.g. if you are writing your own libraries. How to solve this - and this is the answer to your question - See
How to use a local custom library