Since what it sounds like you really want is for the library to be tracked the VSCode source control view… how about having that library in another folder, and adding that to the VSCode workspace? In other words, completely ignore the version in .piolibdeps… let platformio manage that copy.
i.e say for my tracerWifi project code, say I needed to make changes to the elaspedMillis library (which I’m a maintainer of) … so I have it set as a git style
lib_deps dependency for my tracerWifi project, and
git clone the elapsedMillis library somewhere else onto my computer (e.g.
/home/pfeerick/repos/libraries/elapsedMillis) and then added that folder to the VSCode workspace… (
File -> Add Folder to Workspace). You get source control views for your main code and for your library…
The only tricky bit I see happening is that in your main code, you might need an extra_script to ensure it always does a git pull if needed to ensure it has the latest commit of the library…
Actually, on second thoughts, I think your original idea was spot on… clone it out to a separate folder (e.g.
/home/pfeerick/repos/libraries/elapsedMillis), add the library folder to the workspace, and then tell platformio about that libraries folder in your platformio.ini like
lib_extra_dirs = /home/pfeerick/repos/libraries/ … that seems like it should work… you get both the locally editable library, which is used by your main code, and since you’ve added it separately to the workspace, it shows up in source control.
You should delete the copy of the library in
.piolibdeps as you don’t want your main code using that version at all, and you don’t want it mentioned in the
lib_deps of your main codes platformio.ini, else platformio will try to download it again, instead of using the copy in the