Skip to content

Commit 2d19630

Browse files
committed
update dev docs with v0.2 technical details
1 parent 70d58aa commit 2d19630

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

DEVELOPMENT.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ node out/test/optimizer.test.js
2424
### Option 1: Debug in VS Code
2525
1. Open this folder in VS Code
2626
2. Press F5 to launch Extension Development Host
27-
3. Open a Go file (try `examples/structs.go`)
27+
3. Open a Go file (try `examples/structs.go`, `examples/nested-structs.go`, or `examples/embedded-fields.go`)
2828
4. See inline memory annotations above struct fields
2929
5. Hover over fields for detailed info
3030
6. Click CodeLens "Optimize Layout" button above structs
31+
7. Use `Go: Export Memory Layout Report` to export struct analysis
3132

3233
### Option 2: Package and Install
3334
```bash
@@ -62,6 +63,8 @@ code --install-extension go-memory-visualizer-0.1.0.vsix
6263
- Recalculates layouts for selected architecture
6364
- `Ctrl+Shift+P` → "Go: Optimize Struct Memory Layout"
6465
- Optimizes struct under cursor
66+
- `Ctrl+Shift+P` → "Go: Export Memory Layout Report"
67+
- **NEW in v0.2**: Export to JSON/Markdown/CSV
6568

6669
### 5. Architecture Support
6770
- Test with different architectures
@@ -140,11 +143,36 @@ src/
140143
4. Package: `vsce package`
141144
5. Publish: `vsce publish`
142145

146+
## v0.2.0 Features
147+
148+
### Nested Struct Support
149+
150+
The memory calculator now handles nested custom structs:
151+
152+
- Struct registry stores all struct definitions
153+
- Two-pass parsing: register definitions, then calculate layouts
154+
- Recursive size resolution for nested structs
155+
156+
### Embedded Field Handling
157+
158+
Parser detects embedded fields (no explicit name):
159+
160+
- Matches patterns like `TypeName` or `*TypeName`
161+
- Handles promoted fields correctly
162+
- Works with embedded interfaces
163+
164+
### Export Functionality
165+
166+
New command exports memory layouts in multiple formats:
167+
168+
- JSON: Machine-readable with full details
169+
- Markdown: Human-readable documentation
170+
- CSV: Spreadsheet-compatible data
171+
143172
## Future Enhancements
144173

145174
- [ ] Cache line boundary visualization
146-
- [ ] Support for embedded structs
175+
- [ ] Union type support
147176
- [ ] Comparison view (before/after optimization)
148-
- [ ] Export memory layout reports
149177
- [ ] Integration with Go's `unsafe.Sizeof`
150178
- [ ] Benchmark impact visualization

0 commit comments

Comments
 (0)