Background
The Sharpy compiler emits #line directives in generated C# so that debuggers and stack traces reference .spy source files. Runtime tests exist in LineDirectiveRuntimeTests.cs verifying stack traces show .spy file paths and correct line numbers.
However, no real-debugger validation has been done — the directives have not been tested with actual debugger UIs.
Validation Plan
VS Code with C# Extension
- Create a sample multi-file Sharpy project with:
- Classes, functions, conditionals, loops
- Exception handling (try/except)
- Module imports
- Compile to C# and run under the VS Code debugger
- Verify:
JetBrains Rider
- Open the same project in Rider
- Verify the same breakpoint, stepping, and call stack behaviors
Stack Traces
- Trigger an unhandled exception and verify:
Edge Cases
- Test with:
Current Implementation
AttachLineDirective() in RoslynEmitter.Statements.cs (lines 227-240)
CreateLineDirectiveTrivia() helper at lines 246-251
- Runtime tests:
src/Sharpy.Compiler.Tests/Integration/LineDirectiveRuntimeTests.cs
Outcome
Document any adjustments needed to the directive format. If all checks pass, close this issue. If adjustments are needed, create follow-up issues for each fix.
Context
From the 2026-04-27 compiler health audit (O1).
Background
The Sharpy compiler emits
#linedirectives in generated C# so that debuggers and stack traces reference.spysource files. Runtime tests exist inLineDirectiveRuntimeTests.csverifying stack traces show.spyfile paths and correct line numbers.However, no real-debugger validation has been done — the directives have not been tested with actual debugger UIs.
Validation Plan
VS Code with C# Extension
.spyfiles are hit correctly.spyline.spyline.spyfile paths and line numbersJetBrains Rider
Stack Traces
.spyfile paths.spylines.spyoriginsEdge Cases
Current Implementation
AttachLineDirective()inRoslynEmitter.Statements.cs(lines 227-240)CreateLineDirectiveTrivia()helper at lines 246-251src/Sharpy.Compiler.Tests/Integration/LineDirectiveRuntimeTests.csOutcome
Document any adjustments needed to the directive format. If all checks pass, close this issue. If adjustments are needed, create follow-up issues for each fix.
Context
From the 2026-04-27 compiler health audit (O1).