Skip to content

Commit 601e475

Browse files
committed
feat: add Serilog brace matching with tests
1 parent 3d4e14b commit 601e475

File tree

3 files changed

+664
-0
lines changed

3 files changed

+664
-0
lines changed

src/extension.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { DecorationManager } from './decorations/decorationManager';
77
import { CacheManager } from './utils/cacheManager';
88
import { Debouncer } from './utils/debouncer';
99
import { ThemeManager } from './utils/themeManager';
10+
import { SerilogBraceMatchProvider } from './providers/braceMatchProvider';
1011

1112
export function activate(context: vscode.ExtensionContext) {
1213
// Create output channel for logging
@@ -32,6 +33,10 @@ export function activate(context: vscode.ExtensionContext) {
3233
const expressionCache = new CacheManager<any[]>(100, 60000);
3334
const debouncer = new Debouncer(100); // 100ms delay
3435

36+
// Initialize brace matching provider
37+
const braceMatchProvider = new SerilogBraceMatchProvider();
38+
context.subscriptions.push(braceMatchProvider);
39+
3540
function updateDecorations() {
3641
const config = vscode.workspace.getConfiguration('serilog');
3742
const enabled = config.get<boolean>('enabled', true);
@@ -349,6 +354,21 @@ export function activate(context: vscode.ExtensionContext) {
349354
}
350355
}, null, context.subscriptions);
351356

357+
// Listen for cursor position changes to update brace matching
358+
vscode.window.onDidChangeTextEditorSelection(event => {
359+
if (event.textEditor === vscode.window.activeTextEditor) {
360+
braceMatchProvider.updateBraceMatching(event.textEditor);
361+
}
362+
}, null, context.subscriptions);
363+
364+
// Listen for active editor changes
365+
vscode.window.onDidChangeActiveTextEditor(editor => {
366+
if (editor) {
367+
updateDecorations();
368+
braceMatchProvider.updateBraceMatching(editor);
369+
}
370+
}, null, context.subscriptions);
371+
352372
// Listen for configuration changes
353373
vscode.workspace.onDidChangeConfiguration(event => {
354374
if (event.affectsConfiguration('serilog')) {

0 commit comments

Comments
 (0)