question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No usages found for enum despite being used

See original GitHub issue

When using an enum the usage will not be reported when showing usage for type (CTRL + Click).

Steps to Reproduce

  1. flutter create bug
  2. Create a simple enum in a sperate file enum Test{First, Second, Third}
  3. Reference one of the enum values in main.dart like print(Test.First)
  4. Showing usages for Test shows No usages found.

Version info

[√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18363.1082], locale en-DE)
    • Flutter version 1.20.4 at D:\dev\flutter\sdk
    • Framework revision fba99f6cf9 (10 days ago), 2020-09-14 15:32:52 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\User\AppData\Local\Android\sdk
    • Platform android-30, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
devoncarewcommented, Nov 17, 2020

@lzhuor - thanks for the inquiry about a cherry pick. We’re cautious about cherry-picks into our stable releases as they can themselves introduce instability. I think in this instance - while the behavior is incorrect - it doesn’t rise to the level of a cherry pick. An example of something that might would be an issue that prevented all find references operations from working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find usages for enums via Ctrl + left in IntelliJ - Stack Overflow
In the editor, select a symbol for which you want to see the usages. From the main menu, select Edit | Find |...
Read more >
Allow importing both type entity and value entity for "const ...
I can use import type to import pure types without impacting bundle size, but that completely excludes us from being able to use...
Read more >
enum — Support for enumerations — Python 3.11.1 ...
Allows Enum members to have attributes without conflicting with member names. unique(). Enum class decorator that ensures only one name is bound to...
Read more >
Handbook - Enums - TypeScript
Ambient enums are used to describe the shape of already existing enum types. ... One important difference between ambient and non-ambient enums is...
Read more >
PHP 8.1: Enums
Although Enums allow methods declared on them, declaring a method with name cases is not allowed: enum Foo { public function cases(): array{}...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found