📋 Copy Selection Info

🚀 The ultimate VS Code extension for AI-powered development
Copy file paths and line ranges instantly - perfect for Claude, ChatGPT, and other AI assistants
🎯 Why You Need This
Ever struggled to explain which code you want help with? 🤔
Before: "Hey AI, can you look at the function around line 120ish in the main.js file, it's the one that handles user input..."
After: 📄 src/components/UserHandler.js:118-135
✨ One click, one copy, perfect precision
✨ What's New in 2.0.2
🔧 Path Handling Improvements
- 🛠️ Enhanced path structure - Refactored path processing with better separation of concerns
- 📁 Automatic relative indicators - Relative paths now automatically prefixed with
./ or .\
- 🔗 Improved Markdown links - Better path handling for Markdown link generation
- 🎯 Cross-platform consistency - More reliable path separator handling across different platforms
🏗️ Code Architecture
- 🧱 Modular path functions - Split complex path logic into focused utility functions
- 📝 Better filename display - Consistent filename handling across all output formats
- 🔧 Cleaner code structure - Improved maintainability and readability
✨ What's New in 2.0.0
🎪 Multi-Cursor Magic
- 🔄 Multiple selections? No problem! Handle them all at once
- 🎛️ Smart modes: Combine, separate, or choose interactively
- ⚡ Perfect for batch AI queries
🧠 Smarter Context
- 🏷️ Symbol detection - Automatically includes function names
- 🔢 Column precision - Add exact character positions
- 📊 Live status bar - See what will be copied in real-time
📝 Documentation Power
- 🔗 Markdown links - Generate
[file:line](https://github.com/ruiwarn/copy-selection-info/blob/HEAD/link) instantly
- 📚 Perfect for PRs and docs
🚀 Quick Start
Installation
- Press
Ctrl+Shift+X (or Cmd+Shift+X on Mac)
- Search: "Copy Selection Info"
- Click Install 🎉
Basic Usage
- Select any code (or just place cursor anywhere)
- Press
Ctrl+Shift+C (or Cmd+Shift+C on Mac)
- Paste to AI assistant → Perfect context every time!
🎪 All Access Methods
| Method |
How to Use |
Best For |
| ⌨️ Keyboard |
Ctrl+Shift+C |
Quick everyday use |
| 🖱️ Right-Click |
Right-click → "Copy Selection Info" |
Mouse users |
| 📊 Status Bar |
Click status bar item |
Visual feedback & quick access |
| 🔍 Command Palette |
Ctrl+Shift+P → "Copy Selection Info" |
When you forget shortcuts |
⚡ Power Features
🎯 Multi-Cursor Mastery
📍 Selection 1: src/main.js:15-20
📍 Selection 2: src/main.js:45-50
📍 Selection 3: src/utils.js:102
📋 Combined Output:
src/main.js:15-20
src/main.js:45-50
src/utils.js:102
🏷️ Smart Symbol Detection
🔍 With symbols enabled: "handleUserInput in src/components/UserHandler.js:118-135"
📝 Without symbols: "src/components/UserHandler.js:118-135"
🔗 Markdown Link Generation
📄 Perfect for GitHub issues and documentation:
[UserHandler.js:118-135](https://github.com/ruiwarn/copy-selection-info/blob/HEAD/src/components/UserHandler.js:118-135)
⚙️ Customize Everything
🎛️ Essential Settings
{
"copySelectionInfo.multiCursor": "combine", // "combine" | "separate" | "ask"
"copySelectionInfo.includeColumnNumbers": false,
"copySelectionInfo.includeSymbolName": false,
"copySelectionInfo.showStatusBarItem": true
}
🛠️ Advanced Options
| Setting |
What It Does |
When to Use |
useAbsolutePath |
Full file path instead of relative |
When AI needs exact location |
lineRangeSeparator |
Change - to : in ranges |
Personal preference |
pathSeparator |
Force / or \ separators |
Cross-platform consistency |
wslCompatibility |
Smart WSL path handling |
Windows + WSL environments |
ℹ️ Relative paths are automatically prefixed with ./ or .\ to make it clear they live in the current workspace; the separator style follows pathSeparator.
🎪 Real-World Examples
💻 For AI Code Review
📝 Your prompt: "Review this function for potential issues:"
📋 Copied: "src/auth/jwt-validator.js:42-67"
✨ AI gets: Perfect context + exact location
📚 For Documentation
📄 In README.md:
See [authentication logic](https://github.com/ruiwarn/copy-selection-info/blob/HEAD/src/auth/jwt-validator.js:42-67) for details.
🔗 Auto-generated markdown link!
🐛 For Bug Reports
🐛 GitHub Issue:
Bug in user validation at src/components/UserForm.js:128-145
📍 Everyone knows exactly where to look!
🎯 Pro Tips
⚡ Speed Up Your Workflow
- Enable status bar - See what will be copied before you click
- Turn on symbol detection - Get function names automatically
- Use multi-cursor mode - Handle multiple code sections at once
- Try markdown links - Perfect for documentation
🎨 Keyboard Customization
{
"key": "ctrl+alt+c",
"command": "extension.copySelectionInfo",
"when": "editorTextFocus"
}
🔄 Comparison
| Feature |
Copy Selection Info |
Manual Method |
Other Extensions |
| ✅ Multi-cursor support |
✨ Native |
❌ Impossible |
⚠️ Limited |
| ✅ Symbol detection |
✨ Automatic |
❌ Manual lookup |
⚠️ Rare |
| ✅ Status bar integration |
✨ Live updates |
❌ None |
⚠️ Static |
| ✅ WSL compatibility |
✨ Seamless |
❌ Error-prone |
⚠️ Basic |
| ✅ Zero learning curve |
✨ Instant |
❌ Complex |
⚠️ Setup required |
💬 What Users Say
"Game changer for my AI workflow! No more explaining line numbers." - Senior Developer
"The multi-cursor feature alone saved me hours of copy-pasting." - Full Stack Engineer
"Symbol detection is like magic - it knows exactly which function I mean!" - Frontend Dev
🐛 Found a Bug?
💡 Feature Ideas?
⭐ Love It?
📄 License & Credits
MIT License - View License
Made with ❤️ by candycium
⭐ Star this repo if it helps you code smarter!
🚀 Happy coding with your AI assistant!