Common Snippet & AI Instruction
A powerful VS Code extension that provides curated code snippets and intelligent SQL auto-completion for developers.

✨ Features
📝 Smart Code Snippets
- SQL, C#, JavaScript/TypeScript snippets
- Auto-sync from remote repositories
- Team collaboration - share snippets across your team
- Configurable feeds - add your own snippet sources
🧠 Intelligent SQL Auto-Completion
- Database schema awareness - knows your tables, columns, and stored procedures
- Alias support - understands table aliases (e.g.,
u. for Users u )
- Context-aware suggestions - different suggestions after SELECT, FROM, WHERE, etc.
- Multi-database support - scan multiple databases at once
- Offline mode - cached schema works without database connection
🔗 MSSQL Extension Integration
- No password prompts - uses your existing MSSQL extension connections
- Seamless workflow - connect once, use everywhere
- Multiple connection support - choose which databases to scan
🚀 Quick Start
1. Install the Extension
Install from VS Code Marketplace
2. Set Up SQL Auto-Completion
- Install the Microsoft SQL Server (mssql) extension
- Connect to your database using the MSSQL extension
- Open Command Palette (
Ctrl+Shift+P ) and run:
Common Snippets: Scan MSSQL Schema
- Choose databases to scan for schema
- Start typing SQL and enjoy intelligent suggestions!
3. Use Code Snippets
⚙️ Configuration
Extension Settings
Setting |
Description |
Default |
commonSnippets.useMssqlConnections |
Use MSSQL extension connections for schema scanning |
true |
commonSnippets.feedUrls |
Remote URLs for fetching snippets |
Azure Artifacts feeds |
commonSnippets.autoRefresh |
Auto-refresh snippets on startup |
true |
commonSnippets.refreshInterval |
Refresh interval in minutes (0 = disabled) |
60 |
commonSnippets.showLoadNotifications |
Show notifications when loading snippets |
true |
Custom Snippet Feeds
Add your own snippet sources in VS Code settings:
{
"commonSnippets.feedUrls": [
"https://your-server.com/snippets/sql.json",
"https://your-server.com/snippets/csharp.json"
]
}
🎯 SQL Auto-Completion Examples
Table and Column Suggestions
SELECT u.FirstName, u.Email
FROM Users u
JOIN Orders o ON o.UserId = u.Id
WHERE u.Status = 'Active'
- Type
u. → Get Users table columns
- Type
o. → Get Orders table columns
- Context-aware: different suggestions after SELECT vs WHERE
Smart Context Detection
- After SELECT: columns,
*
- After FROM/JOIN: tables, views
- After WHERE/ON: columns for filtering
- After EXEC: stored procedures
🔧 Commands
Command |
Description |
Common Snippets: Scan MSSQL Schema |
Scan database schema for auto-completion |
Common Snippets: Refresh MSSQL Schema |
Update cached schema |
Common Snippets: Show Available Snippets |
Browse and insert snippets |
Common Snippets: Show SQL Snippets |
Show SQL-specific snippets |
Common Snippets: Fetch Common Snippets |
Download latest snippets from feeds |
Common Snippets: Manage Snippets |
Snippet management options |
🛠️ Troubleshooting
SQL Auto-Completion Not Working?
- Ensure Microsoft SQL Server extension is installed and connected
- Run
Common Snippets: Scan MSSQL Schema
- Check that
commonSnippets.useMssqlConnections is enabled
Snippets Not Loading?
- Check your internet connection
- Verify
commonSnippets.feedUrls are accessible
- Run
Common Snippets: Refresh Snippets manually
📄 License
MIT License
| |