feat: add loom-config Debug flag, centralize debug diagnostics#61
Merged
Conversation
TypeChecker.EmitDebugDiagnostics was a public static bool that nothing in the codebase ever set, so debug diagnostics could never fire. Adds LoomConfig.Debug (debug = true in loom-config.toml), threaded through SemanticModel.EmitDebugDiagnostics (set by Resolver from the compilation unit's config) instead of a dead static, and wired into Loom.CLI so setting debug = true actually surfaces them. Resolver.DeclareSymbol used to emit up to three separate debug diagnostics per declared symbol (declared/global/intrinsic); these are now one consolidated message with a flag suffix, e.g. "Declared 'Foo' (Interface) [global, ambient, intrinsic]". Debug-severity diagnostics now render as a compact one-line message instead of the full multi-line source-frame every other severity uses - appropriate for what's meant to be high-volume trace output.
Qodana for .NET251 new problems were found
☁️ View the detailed Qodana report Detected 1 dependencyThird-party software listThis page lists the third-party software dependencies used in Loom
Contact Qodana teamContact us at qodana-support@jetbrains.com
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TypeChecker.EmitDebugDiagnosticswas a public static mutable bool that was never set anywhere in the codebase — debug diagnostics could literally never fire. Removed it.LoomConfig.Debug(debug = trueinloom-config.toml).SemanticModel.EmitDebugDiagnostics, set once byResolverfrom the compilation unit's config, and read by bothResolverandTypeCheckerfrom the same sharedSemanticModelinstead of a scattered static.Loom.CLI/Program.csto passdebugDiagnostics: loomConfig.Debuginstead of a hardcodedfalse, so the flag actually does something end-to-end.Resolver.DeclareSymbolused to emit up to 3 separate debug diagnostics per declared symbol ("Declared symbol: X","X is global","X is intrinsic"). Consolidated into one message per declaration, e.g.Declared 'Foo' (Interface) [global, ambient, intrinsic].debug [file @ line:col] message) instead of the full multi-line source-frame every other severity uses — appropriate for what's meant to be high-volume trace output. Error/Warn/Info rendering is unchanged.Test plan
dotnet build— succeeds, no warningsdotnet test— 1817/1817 passloom-config.tomlwithdebug = truenow prints compact debug diagnostics for every declared symbol and solved type; without the flag (ordebug = false), output is unchanged from before ((none))🤖 Generated with Claude Code