Skip to content

Commit bad83ec

Browse files
committed
feat: add navigation from template properties to arguments
Implements CodeActionProvider for navigating from Serilog template properties to their corresponding method arguments.
1 parent 625eb9b commit bad83ec

File tree

5 files changed

+611
-0
lines changed

5 files changed

+611
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ A Visual Studio Code extension that provides syntax highlighting and enhanced su
4242
- Highlighting appears as soon as you close braces `}` (doesn't wait for closing quotes)
4343
- Supports incomplete strings during editing
4444

45+
### 🧭 Navigation Features
46+
- **Light bulb suggestions** when hovering over template properties
47+
- **Navigate to argument** - jump from template properties to their corresponding arguments
48+
- Click the light bulb and select "Navigate to 'PropertyName' argument"
49+
50+
### 🔍 Brace Matching
51+
- **Highlight matching braces** when cursor is positioned on `{` or `}`
52+
- Visual indication of brace pairs in complex templates
53+
- **Multi-line support** - matches braces across line boundaries in verbatim and raw strings
54+
- Press **ESC** to temporarily dismiss highlights
55+
- Helps identify mismatched or nested braces
56+
4557
## Installation
4658

4759
### From VS Code Marketplace (Recommended)

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
{
2828
"command": "serilog.refresh",
2929
"title": "Refresh Serilog Highlighting"
30+
},
31+
{
32+
"command": "serilog.navigateToArgument",
33+
"title": "Navigate to Argument",
34+
"category": "Serilog"
3035
}
3136
],
3237
"configuration": {

src/extension.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { CacheManager } from './utils/cacheManager';
88
import { Debouncer } from './utils/debouncer';
99
import { ThemeManager } from './utils/themeManager';
1010
import { SerilogBraceMatchProvider } from './providers/braceMatchProvider';
11+
import { SerilogNavigationProvider, registerNavigationCommand } from './providers/navigationProvider';
1112

1213
export function activate(context: vscode.ExtensionContext) {
1314
// Create output channel for logging
@@ -37,6 +38,21 @@ export function activate(context: vscode.ExtensionContext) {
3738
const braceMatchProvider = new SerilogBraceMatchProvider();
3839
context.subscriptions.push(braceMatchProvider);
3940

41+
// Initialize navigation provider
42+
const navigationProvider = new SerilogNavigationProvider();
43+
context.subscriptions.push(
44+
vscode.languages.registerCodeActionsProvider(
45+
'csharp',
46+
navigationProvider,
47+
{
48+
providedCodeActionKinds: SerilogNavigationProvider.providedCodeActionKinds
49+
}
50+
)
51+
);
52+
53+
// Register navigation command
54+
context.subscriptions.push(registerNavigationCommand());
55+
4056
function updateDecorations() {
4157
const config = vscode.workspace.getConfiguration('serilog');
4258
const enabled = config.get<boolean>('enabled', true);

0 commit comments

Comments
 (0)