Skip to content

Instantly share code, notes, and snippets.

View IEvangelist's full-sized avatar
:octocat:
Coding for a better world 🤓

David Pine IEvangelist

:octocat:
Coding for a better world 🤓
View GitHub Profile

Visual Studio Code: Authoring extensions

In less than five years, Visual Studio Code (VS Code) has become the most popular integrated development environment (IDE) in the world. It's built with love and in the open on GitHub, and runs on Chromium (a tip of the hat to Google). VS code is extendable and in this talk we'll cover how to author your very own extension.

You can expect to learn how to:

  • Debug your extension
  • Target specific languages
  • Expose settings to users
  • Provide statement completion
  • Handle user interactions
public void Write(object o)
{
if (o ! is string)
{
Console.WriteLine("WTF?");
}
else
{
Console.WriteLine("OMG!");
}

👨🏿‍💻 👩🏿‍💻 👨🏾‍💻 👩🏾‍💻 👨🏽‍💻 👩🏽‍💻 👨🏼‍💻 👩🏼‍💻 👨🏻‍💻 👩🏻‍💻

Structured show:

  • 5 minutes ".NET check up"
    • Doc Rx
    • Let us perscribe you this doc, learn module, or blog post... or
    • Codeoligest
  • 5 minutes opening, intros
  • 45 hallway track with guest
  • 5 minutes closing
public readonly struct EnumerableRange : IEnumerable<int>
{
readonly Range _range;
public EnumerableRange(Range range)
{
if (range.Start.IsFromEnd || range.End.IsFromEnd)
{
throw new ArgumentException(nameof(range));
}
@IEvangelist
IEvangelist / Program.cs
Created May 3, 2021 13:29
Simplified ASP.NET Core `Program` file
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Company.WebApplication1;
await Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>())
.Build()
.RunAsync();
using System;
using System.Collections.Generic;
static IEnumerable<int> Fibonacci(int max)
{
int current = 1, next = 1;
while (current < max)
{
yield return current;
next = current + (current = next);
@IEvangelist
IEvangelist / potential-worker-template.cs
Last active May 24, 2021 02:20
Potential worker service template improvements.
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Example.App;
using IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices(services => services.AddHostedService<Worker>())
.Build();
await host.RunAsync();
#nullable enable
using System;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json;
JsonSerializerOptions _options = new()
{
PropertyNameCaseInsensitive = true
@IEvangelist
IEvangelist / Program.cs
Last active December 2, 2021 06:32
Minimal API — Azure Cosmos DB repository-pattern .NET SDK
// GitHub: 👨🏽‍💻 https://github.com/ievangelist
// Twitter: 🤓 https://twitter.com/davidpine7
// SDK: 🛠️ https://github.com/IEvangelist/azure-cosmos-dotnet-repository
using System.ComponentModel.DataAnnotations;
using Microsoft.Azure.CosmosRepository;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCosmosRepository();