Skip to content

Instantly share code, notes, and snippets.

View spoenemann's full-sized avatar

Miro Spönemann spoenemann

View GitHub Profile
@spoenemann
spoenemann / class-service.ts
Last active May 14, 2021 07:24
Comparison of class-based vs. function-based DI service
export const ScopeComputationKey: BindingKey<ScopeComputation> = { id: 'ScopeComputation' };
export class ScopeComputation implements DIService {
private nameProvider: NameProvider;
initialize(services: ServiceHolder): void {
this.nameProvider = services.get(NameProvider);
}
@spoenemann
spoenemann / extension.ts
Last active May 18, 2022 05:25
VS Code language client with stdio + socket
import * as net from 'net';
import * as vscode from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions, StreamInfo } from 'vscode-languageclient';
const DEBUG = false;
const SERVER_PORT = 5008;
export function activate(context: vscode.ExtensionContext) {
const languageClient = DEBUG
? getSocketLanguageClient({ serverPort: SERVER_PORT })