Conversation
nex3
requested changes
Sep 18, 2024
| } | ||
| } | ||
|
|
||
| final _colorUrl = Uri(scheme: 'sass', path: 'color'); |
Comment on lines
+41
to
+42
| String? _colorModuleNamespace; | ||
| Set<String> _usedNamespaces = {}; |
lib/src/migrators/color.dart
Outdated
| case 'darken': | ||
| _patchAdjust(node, channel: 'lightness', negate: true, space: 'hsl'); | ||
| default: | ||
| isMigrating == false; |
Contributor
There was a problem hiding this comment.
Is this supposed to be
Suggested change
| isMigrating == false; | |
| isMigrating = false; |
Contributor
There was a problem hiding this comment.
You could also just return here
Member
Author
There was a problem hiding this comment.
Yeah, it was supposed to be assigning, but returning makes more sense
lib/src/migrators/color.dart
Outdated
Comment on lines
+100
to
+107
| if (_colorModuleNamespace == null) { | ||
| _colorModuleNamespace = _findColorModuleNamespace(); | ||
| var asClause = _colorModuleNamespace == 'color' | ||
| ? '' | ||
| : ' as $_colorModuleNamespace'; | ||
| addPatch(Patch.insert( | ||
| node.span.file.location(0), '@use "sass:color"$asClause;\n\n')); | ||
| } |
Contributor
There was a problem hiding this comment.
Consider pulling this into a _getOrAddColorModuleNamespace() function.
lib/src/migrators/color.dart
Outdated
| } | ||
|
|
||
| /// Find an unused namespace for the sass:color module. | ||
| String _findColorModuleNamespace() { |
Contributor
There was a problem hiding this comment.
Consider calling this _chooseColorModuleNamespace() to make it clearer that it's choosing a new namespace rather than finding one that's already loaded.
| if (space != null) { | ||
| addPatch(patchAfter(adjustment, ', \$space: $space')); | ||
| } | ||
| case ArgumentInvocation( |
Contributor
There was a problem hiding this comment.
Style nit: empty lines between long cases.
test/migrators/color/global.hrx
Outdated
| @use "sass:color"; | ||
|
|
||
| a { | ||
| b: color.channel(gold, 'red', rgb); |
Contributor
There was a problem hiding this comment.
Can we have an explicit $space: on these as well?
nex3
approved these changes
Sep 19, 2024
This was referenced Sep 19, 2024
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.
No description provided.