Well, I've added depot_tools to my path, and can run `gn` both in the from which I am launching `code` and from the terminal within VS Code, so I'm not sure how that would be. However, I noticed that on Windows, the `gn` wrapper provided by depot tools is a batch file (gn.bat). Unfortunately, batch files are not directly executable on Windows, only via shell, and it looks like the ChromeIDE extension does not specify `shell: true` when invoking child_process.spawn(). As such, it makes sense that it wouldn't work. The code also includes the comment, “TODO(cmfcmf): Test whether this also works on Windows.” so I guess this was never tested?
In any event, it seems the solution would be to either replace `gn.bat` in depot_tools with a `gn.exe` that does the same thing, or set `shell` to true in ChromiumIDE (at least on Windows) when invoking commands that are provided as .bat files.
In the meantime, I guess I'll keep manually regenerating the compilation database.