Skip to content
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

Duplicate enumeration values in overflow autocomplete #1835

Closed
timsneath opened this issue Jul 5, 2019 · 6 comments
Closed

Duplicate enumeration values in overflow autocomplete #1835

timsneath opened this issue Jul 5, 2019 · 6 comments
Labels
in editor Relates to code editing or language features is bug
Milestone

Comments

@timsneath
Copy link
Contributor

More clips and fades in this screenshot than at a men's hair salon :)

image

Running Dart and Flutter 3.2.0 plug-ins on VSCode 1.36.0. flutter doctor reports:

[√] Flutter (Channel master, v1.8.1-pre.22, on Microsoft Windows [Version 10.0.18362.207], locale en-US)
    • Flutter version 1.8.1-pre.22 at C:\git\flutter
    • Framework revision 93edc014ae (26 hours ago), 2019-07-04 11:26:19 -0700               
    • Engine revision 3c51a7bfff                                                                                     
    • Dart version 2.5.0 (build 2.5.0-dev.0.0 b5aeaa6796)
@DanTup
Copy link
Member

DanTup commented Jul 5, 2019

Do you already have an import that includes them? If not, this may be by design - if TextOverflow is re-exported by material.dart, widgets.dart, cupertino.dart it will appear three times - one as an auto-import for each (if you move your selection down over them, it should show). Once you import one of those files, the others should then no longer show in the completion (this is a recent change in v3.2).

If you still see dupes once you've imported one, that's definitely a bug.

@timsneath
Copy link
Contributor Author

I import just material.dart, not widgets.dart or cupertino.dart.
image

The first four entries are not auto-imported:
image

but the remainder are auto-imported by rendering.dart, cupertino.dart, and widgets.dart:
image

@timsneath
Copy link
Contributor Author

Current file is here: for reference: https://github.com/timsneath/cambridge/commit/6fb6af34da9dbbd52a5694e41b6173a0730c33ff

(and please don't look at the code too much -- it's embarrassing 😃)

@DanTup
Copy link
Member

DanTup commented Jul 6, 2019

Ah yes, I overlooked "values" in the title - the duplicate enum definition (TextOverflow) is being removed, but its values are not.

@scheglov my guess is these aren't in existingImports. Is that a bug, or should we be splitting on the . and only checking for the first segment in existingImports?

@DanTup DanTup closed this as completed in ea7443d Jul 8, 2019
@DanTup
Copy link
Member

DanTup commented Jul 8, 2019

I've put a fix in here since even if it's changed in the server it'll take a while to get out.

I'll also make an equiv fix in LSP shortly.

@DanTup DanTup added this to the v3.3.0 milestone Jul 8, 2019
@DanTup DanTup added in editor Relates to code editing or language features is bug labels Jul 8, 2019
@DanTup
Copy link
Member

DanTup commented Jul 9, 2019

LSP didn't have this issue because its implementation wasn't complete (enum values didn't appear at all). That's fixed, and includes code to avoid hitting this.

(@lambdabaa FYI - not sure whether IntelliJ may need an equiv change - I think it'd affect named constructors as well as enums)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features is bug
Projects
None yet
Development

No branches or pull requests

2 participants