sourcegraph / batch-change-examples

A collection of examples for Batch Changes
Apache License 2.0
23 stars 2 forks source link

Add example to add a recommended VS Code extensions across all repos #44

Closed philipp-spiess closed 2 years ago

philipp-spiess commented 2 years ago

Closes sourcegraph/sourcegraph#40199

It looks like I have worked on this at the same time as @malomarrec šŸ˜. The main difference is that my script is written in JavaScript instead of python, lol. Thread with more context on how that happened here.

It took me a while to find a library that can modify the jsonc spec files VS Code is using (JSON + comments) which keeps the comments up and does not reformat everything. I am not sure if the python script by @malomarrec handles this case so I post mine as well.

I also put it into the js/ts examples folder since this is useful for other VS Code extensions as well, not only ours šŸ˜‰

Test Plan

I ran it on S2. The diffs it created seem reasonable. I also found that sourcegraph/sourcegraph and sourcegraph/devx-scratch already have the extension added to the recommendation list.

Screenshot 2022-08-16 at 15 40 42

philipp-spiess commented 2 years ago

@malomarrec @sourcegraph/batchers I can't tag you for review (I don't have merge rights to this repo?) so pinging you here instead. Can you take a look at this PR?

philipp-spiess commented 2 years ago

Someone also has to merge this on my behalf Iā€™m afraid šŸ˜ž