Code Context is a lightweight VS Code extension designed to help you quickly identify and share the specific context of the code you're working on. With one click, you can extract the file path, enclosing symbol (function/class), and line range of your current selection.
Features
🚀 One-Click Context: Click the "⧉ Context" button in the status bar to copy the current code context to your clipboard.
📍 Symbol Awareness: Automatically detects the enclosing function or class names using VS Code's symbol provider.
📜 History Tracking: Keep track of your last 20 contexts. Access them via the Command Palette (Show Context History).
🖱️ Context Menu: Right-click anywhere in the editor to quickly copy the context without leaving your focus.
Usage
Open any source file.
Select a block of code or place your cursor.
Click ⧉ Context in the bottom status bar.
Paste the context anywhere (format: file>symbol>lines).
Accessing History
Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) and type "Show Context History".
Installation
Download the .vsix file.
In VS Code, go to the Extensions view.
Click the "..." menu and select "Install from VSIX...".