Skip to content

Commit c31d1b3

Browse files
committed
feat: initial implementation of Debugalizers extension
Visual Studio extension providing custom debug visualizers with formatting, syntax highlighting, and specialized views for common data types including JSON, XML, JWT, Base64, images, and more. - Data format visualizers: JSON, XML, HTML, YAML, TOML, CSV, INI, Markdown, SQL, GraphQL - Encoded data visualizers: Base64, URL encoded, HTML entities, Hex string, GZip, Deflate - Security visualizers: JWT, SAML, X.509 certificates - Structured string visualizers: Connection strings, URIs, Query strings, Regex, Cron - Binary visualizers: Hex dump, GUID, Timestamp, IP Address - Multiple view types: Raw, Formatted, Tree, Table, Hex, Rendered, Image - Syntax highlighting via AvalonEdit - Search, copy, export functionality
0 parents  commit c31d1b3

85 files changed

Lines changed: 5875 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.commitlintrc.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
extends:
2+
- '@commitlint/config-conventional'
3+
4+
rules:
5+
type-enum:
6+
- 2
7+
- always
8+
- - feat
9+
- fix
10+
- docs
11+
- style
12+
- refactor
13+
- perf
14+
- test
15+
- build
16+
- ci
17+
- chore
18+
- revert
19+
type-case:
20+
- 2
21+
- always
22+
- lower-case
23+
subject-case:
24+
- 2
25+
- never
26+
- - sentence-case
27+
- start-case
28+
- pascal-case
29+
- upper-case
30+
subject-empty:
31+
- 2
32+
- never
33+
subject-full-stop:
34+
- 2
35+
- never
36+
- '.'
37+
header-max-length:
38+
- 2
39+
- always
40+
- 100

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: 8.0.x
22+
23+
- name: Restore dependencies
24+
run: dotnet restore src/CodingWithCalvin.Debugalizers.slnx
25+
26+
- name: Build
27+
run: dotnet build src/CodingWithCalvin.Debugalizers.slnx --configuration Release --no-restore
28+
29+
- name: Test
30+
run: dotnet test src/CodingWithCalvin.Debugalizers.slnx --configuration Release --no-build --verbosity normal
31+
32+
- name: Upload VSIX artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: vsix
36+
path: src/CodingWithCalvin.Debugalizers/bin/Release/**/*.vsix
37+
if-no-files-found: warn

.github/workflows/commit-lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Commit Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
21+
- name: Install commitlint
22+
run: |
23+
npm install --save-dev @commitlint/cli @commitlint/config-conventional
24+
25+
- name: Lint PR title
26+
env:
27+
PR_TITLE: ${{ github.event.pull_request.title }}
28+
run: echo "$PR_TITLE" | npx commitlint
29+
30+
- name: Lint commits
31+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

.github/workflows/contributors.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Contributors
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
contributors:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Update contributors
16+
uses: akhilmhdh/contributors-readme-action@v2.3.10
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
with:
20+
image_size: 100
21+
columns_per_row: 6
22+
readme_path: README.md
23+
collaborators: all
24+
commit_message: 'docs: update contributors'

.github/workflows/publish.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish'
10+
required: true
11+
type: string
12+
13+
jobs:
14+
publish:
15+
runs-on: windows-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: 8.0.x
25+
26+
- name: Restore dependencies
27+
run: dotnet restore src/CodingWithCalvin.Debugalizers.slnx
28+
29+
- name: Build Release
30+
run: dotnet build src/CodingWithCalvin.Debugalizers.slnx --configuration Release --no-restore
31+
32+
- name: Test
33+
run: dotnet test src/CodingWithCalvin.Debugalizers.slnx --configuration Release --no-build --verbosity normal
34+
35+
- name: Upload to VS Marketplace
36+
env:
37+
VS_MARKETPLACE_PAT: ${{ secrets.VS_MARKETPLACE_PAT }}
38+
run: |
39+
$vsixPath = Get-ChildItem -Path "src/CodingWithCalvin.Debugalizers/bin/Release" -Filter "*.vsix" -Recurse | Select-Object -First 1 -ExpandProperty FullName
40+
if ($vsixPath) {
41+
Write-Host "Found VSIX: $vsixPath"
42+
# Note: Actual publishing would use VsixPublisher.exe or similar
43+
# This is a placeholder for the actual marketplace publishing step
44+
} else {
45+
Write-Error "No VSIX file found"
46+
exit 1
47+
}
48+
49+
- name: Upload VSIX to Release
50+
if: github.event_name == 'release'
51+
uses: softprops/action-gh-release@v1
52+
with:
53+
files: src/CodingWithCalvin.Debugalizers/bin/Release/**/*.vsix

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Claude Code local settings
2+
.claude/settings.local.json
3+
4+
# Build results
5+
[Bb]in/
6+
[Oo]bj/
7+
[Ll]og/
8+
[Ll]ogs/
9+
10+
# Visual Studio
11+
.vs/
12+
*.user
13+
*.suo
14+
*.userosscache
15+
*.sln.docstates
16+
17+
# NuGet
18+
*.nupkg
19+
**/[Pp]ackages/*
20+
!**/[Pp]ackages/build/
21+
22+
# Test results
23+
[Tt]est[Rr]esult*/
24+
[Bb]uild[Ll]og.*
25+
*.trx
26+
27+
# Windows
28+
Thumbs.db
29+
ehthumbs.db
30+
Desktop.ini
31+
$RECYCLE.BIN/
32+
33+
# Rider
34+
.idea/
35+
36+
# VS Code
37+
.vscode/
38+
39+
# VSIX output
40+
*.vsix

CLAUDE.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code when working with code in this repository.
4+
5+
## Critical Rules
6+
7+
These rules override all other instructions:
8+
1. **NEVER commit directly to main** - Always create a feature branch and submit a pull request
9+
2. **Conventional commits** - Format: `type(scope): description`
10+
3. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files
11+
4. **Pull Request titles** - Use conventional commit format (same as commits)
12+
5. **Branch naming** - Use format: `type/scope/short-description` (e.g., `feat/visualizer/add-json-support`)
13+
6. **Working an issue** - Always create a new branch from an updated main branch
14+
7. **Check branch status before pushing** - Verify remote tracking branch exists
15+
8. **No co-authors** - Do not add co-author information on commits or pull requests
16+
9. **No "generated by" statements** - Do not add generated-by statements on pull requests
17+
10. **No #pragma warning directives** - Fix warnings properly instead of suppressing them with #pragma directives
18+
11. **Consistent naming** - Assembly name and root namespace must match the folder/project name
19+
20+
## Project Overview
21+
22+
**Debugalizers** is a Visual Studio extension providing custom debug visualizers for string data. It supports various formats including JSON, XML, YAML, JWT, Base64, and more.
23+
24+
### Technology Stack
25+
26+
- **Framework**: .NET Framework 4.8
27+
- **SDK**: CodingWithCalvin.VsixSdk 0.4.0
28+
- **Target**: Visual Studio 2022 (17.x)
29+
- **UI Framework**: WPF
30+
- **Syntax Highlighting**: AvalonEdit
31+
32+
## Build Commands
33+
34+
```bash
35+
# Build the solution
36+
dotnet build src/CodingWithCalvin.Debugalizers.slnx
37+
38+
# Build in Release mode
39+
dotnet build src/CodingWithCalvin.Debugalizers.slnx --configuration Release
40+
41+
# Run tests
42+
dotnet test src/CodingWithCalvin.Debugalizers.slnx
43+
```
44+
45+
## Project Structure
46+
47+
```
48+
src/
49+
├── CodingWithCalvin.Debugalizers/ # Main VSIX project
50+
│ ├── Visualizers/ # Debug visualizer implementations
51+
│ │ ├── DataFormats/ # JSON, XML, YAML, etc.
52+
│ │ ├── Encoded/ # Base64, URL encoded, etc.
53+
│ │ ├── Security/ # JWT, SAML, Certificates
54+
│ │ ├── Structured/ # URI, Connection strings, etc.
55+
│ │ └── Binary/ # Hex dump, GUID, Timestamp
56+
│ ├── UI/ # WPF views and windows
57+
│ │ └── Views/ # Individual view controls
58+
│ └── Services/ # Core services
59+
└── CodingWithCalvin.Debugalizers.Tests/ # Unit tests
60+
```
61+
62+
## Architecture
63+
64+
### Visualizer Pattern
65+
66+
All visualizers extend `BaseVisualizer`:
67+
68+
```csharp
69+
[assembly: DebuggerVisualizer(
70+
typeof(JsonVisualizer),
71+
typeof(VisualizerObjectSource),
72+
Target = typeof(string),
73+
Description = "Debugalizers: JSON")]
74+
75+
public class JsonVisualizer : BaseVisualizer
76+
{
77+
protected override string Title => "JSON";
78+
protected override VisualizerType Type => VisualizerType.Json;
79+
protected override IEnumerable<ViewType> SupportedViews =>
80+
new[] { ViewType.Formatted, ViewType.Tree, ViewType.Raw };
81+
}
82+
```
83+
84+
### Core Services
85+
86+
- **FormatDetector**: Auto-detects content type from strings
87+
- **ContentFormatter**: Pretty-prints and formats various content types
88+
- **EncodingDecoder**: Decodes Base64, URL encoding, HTML entities, etc.
89+
- **ImageDecoder**: Decodes Base64/data URI images
90+
- **SyntaxHighlighter**: Provides AvalonEdit syntax highlighting
91+
92+
## Adding a New Visualizer
93+
94+
1. Create a new class in the appropriate `Visualizers/` subdirectory
95+
2. Extend `BaseVisualizer`
96+
3. Add the `[assembly: DebuggerVisualizer(...)]` attribute
97+
4. Implement the required properties (`Title`, `Type`, `SupportedViews`)
98+
5. If needed, add parsing logic to the appropriate service
99+
6. Add unit tests in the Tests project
100+
101+
## Testing
102+
103+
The project uses xUnit with FluentAssertions. Tests cover:
104+
- Format detection (`FormatDetectorTests`)
105+
- Content formatting (`ContentFormatterTests`)
106+
- Encoding/decoding (`EncodingDecoderTests`)
107+
- Image decoding (`ImageDecoderTests`)
108+
- Syntax highlighting (`SyntaxHighlighterTests`)
109+
110+
## Dependencies
111+
112+
| Package | Purpose |
113+
|---------|---------|
114+
| AvalonEdit | Syntax highlighting |
115+
| Newtonsoft.Json | JSON parsing |
116+
| YamlDotNet | YAML parsing |
117+
| Tomlyn | TOML parsing |
118+
| System.IdentityModel.Tokens.Jwt | JWT decoding |
119+
| Markdig | Markdown rendering |
120+
| NCrontab | Cron expression parsing |
121+
| CsvHelper | CSV parsing |

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Calvin Allen / Coding With Calvin
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)