Line Spoiler is a VS Code extension for streaming, demos, and screen sharing. It lets you keep safe lines visible while hiding secret-bearing lines such as tokens, passwords, API keys, and connection strings.
This version is selection-based. You can hide only the exact part you select, which is better when a line contains both safe text and a secret value.
What It Does
Hide only the currently selected text as a private spoiler area.
Keep the file structure visible so viewers can still follow the code.
Show a clear Reveal hidden selection CodeLens above each hidden area.
Reveal the whole hidden selection only when you click it or run the reveal command.
Work per session, so nothing is written back into your file.
Typical Workflow
Open a file you want to share, such as .env, .env.local, or a config file.
Select only the exact secret value or text area you do not want visible on stream.
Run Line Spoiler: Hide Selected Secret Area from the Command Palette or the editor context menu.
Share your screen with the safe lines still visible.
Click Reveal hidden selection ... above a hidden area when you are ready to show it.
Commands
Line Spoiler: Hide Selected Secret Area
Line Spoiler: Reveal Hidden Selection At Cursor
Line Spoiler: Reveal All Hidden Selections
Development
npm install
npm run compile
npm test
Press F5 to launch an Extension Development Host
Publishing
Make sure the publisher field in package.json matches your real VS Code Marketplace publisher id.
Run vsce package to build a .vsix file.
Run vsce publish when you are ready to upload.
Known Limits In V1
Hidden selections are session-only and are not restored after restarting VS Code.
If you edit hidden text directly, that hidden selection is removed to avoid incorrect masking.
Reveal is done through the visible CodeLens action above the hidden selection, not by clicking directly on the text itself.