-
Notifications
You must be signed in to change notification settings - Fork 302
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
Create Missing Overrides produces linked edits with unexpected non-nullable type options #4185
Comments
I agree that we shouldn't be suggesting types (like
I believe that that would solve the problem here, but I'm wondering whether there might not be a deeper problem. @scheglov Given an |
A couple of ideas.
|
I'm guessing that the answer to my question is that |
I actually find this terminology somewhat confusing, maybe because different people mean different things. For me, when I see "class", it means actual "class X {}" or And here we fill the linked group with types. |
I'm assuming that we should not output the In which case, we can't use https://dart-review.googlesource.com/c/sdk/+/261840/ I think we could've done this without updating |
Fixes Dart-Code/Dart-Code#4185. Change-Id: Ic9fcd60ef3eae24e3921c25162ec405a56c62c53 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261840 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Fixed by dart-lang/sdk@3f206da. |
@bwilkerson while fixing #4184 I noticed these edit groups being produced:
Sep-28-2022.16-24-21.mp4
Here, we're creating linked edit groups with suggestions for
Object?
andObject
where it seems like onlyObject?
is allowed. I believe it's because ofwithNullability: false
here:https://github.com/dart-lang/sdk/blob/e08c94a65147aaa3ec8c4e09fd1935f20599eec2/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart#L1936
I think perhaps it should be more like:
However, in the case where there are additional supertypes, that only includes the suffix on the original type. So I think we need to capture the suffix for the original type, and just manually append that onto the result of
getDisplayString(withNullability: false)
for each result.Before I do this, a) do you know if there are any cases where the current behaviour is expected (or the described behaviour above would be worse), or whether there's something existing that's cleaner than manipulating strings here to get
type.superclass
where the result has the nullability suffix propagated?(I'm also not entirely sure we should be adding tabstops on these types/param names.. you can tab through them, but not the bodies of the inserted methods... but that's another issue).
The text was updated successfully, but these errors were encountered: