Fix Scala 3 top-level rendering bugs#86
Open
rochala wants to merge 1 commit into
Open
Conversation
- TypePrinter: parameterless def/val now prints ': Type' (was missing colon) - TypePrinter: add TypeMemberSymbol case for opaque types, type aliases, abstract types (was falling through to toString sentinel) - GetFormatter: apply userFqn() to FQN heading and origin so $package$ wrapper segments and trailing $ never appear in output - GetFormatter: apply userFqn() in renderSubtypes so case object / object sealed children don't leak trailing $ in Known subtypes line - SymbolResolver: filter @main launcher class from results when a top-level def with the same FQN exists; use subsetOf for future-proofing - GetFormatterTest: add 3 end-to-end formatter tests for @main def, opaque type, and companion member - CLAUDE.md: add principle to verify e2e output quality when fixing bugs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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
Fixes several rendering bugs introduced in #81 (Scala 3 top-level defs/types/objects support).
Bugs fixed
TypePrinter
def/valwas missing the:separator —def helloprinted asdef helloUnitinstead ofdef hello: UnitTypeMemberSymbolhad no case, falling through to a rawtoStringsentinel —opaque type Hello = Intprinted assymbol[...]GetFormatter
$package$wrapper segments and trailing$leaked into the##heading and Origin linerenderSubtypescalleddisplayFullNamewithoutuserFqn, socase object/objectsealed children showed a trailing$in the Known subtypes line (e.g.CellarB$)SymbolResolver
@main def foogenerates a synthetic launcherclass foowith only<init>+main. When a top-level def with the same FQN exists, the launcher is now filtered from results. UsessubsetOfinstead of exact-set equality for resilience against future Scala versions adding extra synthetics.Tests added
Three end-to-end formatter tests in
GetFormatterTestthat resolve throughSymbolResolverand assert on the actual rendered Markdown:@main def hello→ heading, origin, signature, no synthetic class leakopaque type Hello = Int→ correct opaque type renderingHello.fromIntcompanion member → heading and origin hide$package$Also
Added a principle to
CLAUDE.mdrequiring end-to-end output verification when fixing rendering bugs.🤖 Generated with Claude Code