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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTL-1332: Add import smarts to codemod #241
INTL-1332: Add import smarts to codemod #241
Changes from all commits
59475a6
f169e23
5e38c29
78fcfe6
afdedc3
2765fc3
fd61b49
6d20e1f
2556824
120193c
ae1c9d5
2563523
b61886a
dc10e48
3f9c44b
fb41781
31586e8
f5a39f2
f0b8d70
32c85b4
9659774
04a2930
0b2cf66
e4e1e70
19a9987
cee0c09
30a4069
dce91a9
440bfe4
951515b
c22d80c
a6453be
b8b9fbc
6ac09fd
2bdc01f
5fa051f
10e38b3
ff158cc
7b8cfa7
8865e1c
8e4228f
4fdcd8a
683240c
d38b84e
cefb0ca
9acf12f
81bb028
6e8156b
1efc33d
a4c3f5f
cc04546
2c70a40
41dcf37
eaa80fd
bf17566
5aea1b7
34187cd
4207f2e
cc34f33
aa6fa7b
f84c1a2
4af088b
5f4096b
29c4829
a926209
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very close. But these lines are not necessary This is taking something that returns a Uri, turning it into a string, then parsing it so you can ask it for its scheme. Just get the uri and check if it's null and check the scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, we are writing code like this
final uriContent = importDirective.uriContent;
but after merge conflicts resolve there is updating in Analyzer 5
uriContent
is archived and we are usingimportDirective.uri.stringValue
and if we check scheme with uri like this
then it's giving error
error: The getter 'scheme' isn't defined for the type 'StringLiteral'. (undefined_getter at [over_react_codemod] lib/src/intl_suggestors/intl_importer.dart:158)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. My mistake. I assumed importDirective.uri was returning a Uri, since we needed to convert it to a string. It's a StringLiteral, so this code is good.