chore(theme): drop NULL_COLOR symbol indirection in vscode-color-registry#170
Open
dormouse-bot wants to merge 1 commit into
Open
chore(theme): drop NULL_COLOR symbol indirection in vscode-color-registry#170dormouse-bot wants to merge 1 commit into
dormouse-bot wants to merge 1 commit into
Conversation
…stry registryDefault() returned a string-or-NULL_COLOR-symbol that registryDefaultValue() immediately collapsed back to string | null, and the symbol never escaped the module (no external consumer imported NULL_COLOR, ResolvedColor, or registryDefault). Fold the lookup directly into registryDefaultValue and remove the dead symbol layer. Behavior is unchanged; existing theme tests (vscode-color-resolver.test.ts et al.) cover the lookup. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
c7e8602
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1128e25b.mouseterm.pages.dev |
| Branch Preview URL: | https://chore-registry-default-simpl.mouseterm.pages.dev |
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.
Surfaced by the nightly code-quality survey.
vscode-color-registry.tshad a three-piece symbol layer —NULL_COLOR(aSymbol), theResolvedColortype (string | typeof NULL_COLOR), andregistryDefault()returningResolvedColor— whose only purpose was to letregistryDefaultValue()immediately collapse the symbol back tostring | null:The symbol never escaped the module — nothing outside imports
NULL_COLOR,ResolvedColor, orregistryDefault(the resolver imports onlyregistryDefaultValue). The indirection added a layer with no caller benefit, so this folds the lookup directly intoregistryDefaultValueand drops the dead symbol/type/function:Behavior is unchanged (
defaults[themeKind] || nullmaps empty-string andnulltonull, exactly as the oldif (value) … else NULL_COLORdid). No new test is added because this is a pure refactor with no behavior change; the existing theme suite (vscode-color-resolver.test.tsand the rest ofsrc/lib/themes/, 48 tests) exercisesregistryDefaultValueand passes unchanged.tsc -bis clean.