Supercharge your C# top-level programs with intelligent NuGet package autocomplete! This extension provides seamless autocomplete for #:package
directives, making it effortless to add and manage NuGet packages in your C# scripts.
By using this project or its source code, for any purpose and in any shape or form, you grant your implicit agreement to all of the following statements:
- You unequivocally condemn Russia and its military aggression against Ukraine
- You recognize that Russia is an occupant that unlawfully invaded a sovereign state
- You agree that Russia is a terrorist state
- You fully support Ukraine's territorial integrity, including its claims over temporarily occupied territories
- You reject false narratives perpetuated by Russian state propaganda
To learn more about the war and how you can help, click here. Glory to Ukraine! πΊπ¦
- Type
#:package
and get instant autocomplete suggestions from the official NuGet repository - Intelligent search with fuzzy matching for package names
- Real-time package information with descriptions and download statistics
- Type
@
after a package name to get version suggestions - Shows latest stable versions first (excludes pre-release)
- Easy selection from available version history
- Hover over any package to see detailed information
- Package descriptions, download counts, and direct links to NuGet
- Visual indicators for package popularity
- Intelligent caching reduces API calls and improves response time
- Non-blocking searches don't interrupt your coding flow
- Minimal resource usage
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
) - Search for "C# Package Autocomplete"
- Click "Install"
- Create a C# file with
.cs
extension - Type the package directive:
#:package
- Start typing a package name and see autocomplete suggestions
- Add version by typing
@
after the package name - Run your script with the new .NET CLI
#:package Humanizer@2.14.1
using Humanizer;
var dotNet9Released = DateTimeOffset.Parse("2024-12-03");
var since = DateTimeOffset.Now - dotNet9Released;
Console.WriteLine($"It has been {since.Humanize()} since .NET 9 was released.");
#:package Newtonsoft.Json@13.0.3
#:package Serilog@3.1.1
#:package FluentValidation@11.8.0
using Newtonsoft.Json;
using Serilog;
using FluentValidation;
// Your code here...
#:package Microsoft.AspNetCore.App@8.0.0
#:package Swashbuckle.AspNetCore@6.5.0
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run();
No configuration needed! The extension works out of the box with sensible defaults.
Future versions may include these customizable settings:
- Cache duration for package searches
- Number of suggestions to display
- Include/exclude pre-release packages
- Custom package source URLs
- Visual Studio Code 1.74.0 or higher
- Internet connection for package search (cached results work offline)
- .NET SDK with top-level program support
- Network dependency: Requires internet connection for initial package searches
- API rate limits: Heavy usage might temporarily reduce suggestion speed
- Case sensitivity: Package names are case-sensitive in NuGet
- Custom package sources - Support for private NuGet feeds
- Dependency visualization - Show package dependencies
- Version comparison - Compare versions with changelogs
- Package templates - Quick scaffolding for common scenarios
- Offline mode - Offline package suggestions
- IntelliSense integration - Enhanced code completion for imported packages
We welcome contributions! Here's how you can help:
- Report bugs by creating issues on GitHub
- Request features through GitHub discussions
- Submit pull requests for bug fixes or new features
- Share feedback and rate the extension
# Clone the repository
git clone https://github.com/TarasKovalenko/csharp-package-autocomplete
# Install dependencies
npm ci
# Compile TypeScript
npm run compile
# Package extension
npm run package
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this extension helpful:
- β Star the repository on GitHub
- π Leave a review on the VS Code Marketplace
- π¦ Share it with your fellow developers
- Microsoft for the amazing .NET ecosystem and top-level programs feature
- NuGet team for the comprehensive package API
- VS Code team for the excellent extension platform
- Community for feedback and contributions
Happy coding with C# and NuGet packages! π
Made with β€οΈ for the .NET community