Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 1.48 KB

File metadata and controls

38 lines (23 loc) · 1.48 KB

Code Sanitizer

Copy-paste code to and from VS Code without sharing anything other than code keywords.

For example, when using SQL, words like SELECT and FROM will stay the same, but all table and field names will be replaced by a random dictionary word.

This allows pasting code into tools like ChatGPT or public forums, without sharing potentially sensitive details.

/* Currently only supports SQL, Python, and R. */

Step 1

Select the code you want to sanitize and copy using ctrl+shift+alt+C (cmd+shift+option+C on Mac). You can also right-click and select "Anonymize and Copy Code".

VS Code Screenshot Before

The code in your clipboard will be a sanitized version of what you see in VS Code.

Step 2

Paste the code as you would normally (ctrl+V or cmd+V) in your favorite AI chat tool. Instead of the original code, the pasted version is sanitized with random words!

Prompting LLM

Step 3

If the chat tool gives you something you want to bring back to VS code, copy it as you would normally (ctrl+C or cmd+C).

Pasting from LLM

Step 4

Use ctrl+shift+alt+V (cmd+shift+option+V on Mac) to paste back in VS Code. You can also right-click and select "Unanonymize and Paste Code".

Instead of the sanitized code, you will get the original names! Even if the code has changed (new lines of code, etc.)

VS Code Screenshot After