Skip to content

When starting up VSCode with a fresh flutter checkout, analysis of file in active editor fails #5030

@andrewkolos

Description

@andrewkolos

This issue is in service of flutter/flutter#144902. The goal is to make contributing to the flutter tool a better experience.

Repro steps. I did all of this with my local Flutter installation on the master branch, but I don't think this should matter for this issue.

  1. Open your local flutter installation in VSCode. Make sure you have at least one editor active with a dart file. I used packages/flutter_tools/test/general.shard/bundle_builder_test.dart for this example.
  2. Quit VSCode.
  3. With a terminal open at your local Flutter installation, git clean -dfx to effectively clean out any cached files.
  4. Open your local flutter installation in VSCode (I assume that any Dart/Flutter-enabled project should be sufficient for this). VSCode should then download relevant Flutter artifacts and build the flutter tool.

Observed behavior. In VSCode, make sure you have the Explorer tab open (this should include the file explorer and outline by default). Notice that the outline is not populated. You should see a message with the text No symbols found in document 'bundle_builder_test.dart'.

Expected behavior. Analysis of any open documents (bundle_builder.dart in the repro steps) should eventually succeed. The outline should eventually be populated.

Workarounds. 1) After the extension has finished building the flutter tool, run a Developer: Reload Window command in VSCode. Alternatively 2) close and re-open the editor.

Workspace Environment
Dart Code extension: 3.84.0
Flutter extension: 3.85.20240301 (activated)

App: Visual Studio Code
App Host: desktop
Version: mac 1.87.1

Workspace type: Dart, Flutter (LSP)

Dart (3.4.0-190.0.dev): /Users/andrewkolos/Documents/GitHub/flutter/bin/cache/dart-sdk
Flutter (undefined): /Users/andrewkolos/Documents/GitHub/flutter (sdk gphone64 arm64 (android-arm64/android))

Output from 'dart info'

/Users/andrewkolos/Documents/GitHub/flutter/bin/cache/dart-sdk/bin/dart info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.4.0-190.0.dev (dev) (Thu Feb 29 08:14:33 2024 -0800) on "macos_arm64"
  • on macos / Version 14.3.1 (Build 23D60)
  • locale is en

Process info

Memory CPU Elapsed time Command line
6 MB 0.0% 10-22:10:40 dart devtools --machine --allow-embedding
5 MB 0.0% 10-20:41:03 dart devtools --machine --allow-embedding
4 MB 0.0% 10-20:39:28 dart devtools --machine --allow-embedding
4 MB 0.0% 10-22:09:26 dart devtools --machine --allow-embedding
6 MB 0.0% 10-22:08:16 dart devtools --machine --allow-embedding
5 MB 0.0% 10-22:06:46 dart devtools --machine --allow-embedding
6 MB 0.0% 10-22:04:07 dart devtools --machine --allow-embedding
6 MB 0.0% 10-22:01:01 dart devtools --machine --allow-embedding
4 MB 0.0% 10-21:53:39 dart devtools --machine --allow-embedding
5 MB 0.0% 10-21:48:38 dart devtools --machine --allow-embedding
9 MB 0.0% 06-17:36:36 dart devtools --no-launch-browser
6 MB 0.0% 06-17:36:35 dart devtools --no-launch-browser
328 MB 166.0% 00:02 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.84.0
79 MB 0.1% 00:02 dart tooling-daemon --machine
4 MB 0.0% 06-20:35:25 dart tooling-daemon --machine
104 MB 3.7% 00:02 flutter_tools.snapshot daemon
Output from 'flutter doctor'

/Users/andrewkolos/Documents/GitHub/flutter/bin/flutter doctor -v

[!] Flutter (Channel master, 3.21.0-1.0.pre.21, on macOS 14.3.1 23D60 darwin-arm64, locale en)
    • Flutter version 3.21.0-1.0.pre.21 on channel master at /Users/andrewkolos/Documents/GitHub/flutter
    ! The flutter binary is not on your path. Consider adding /Users/andrewkolos/Documents/GitHub/flutter/bin to your path.
    ! The dart binary is not on your path. Consider adding /Users/andrewkolos/Documents/GitHub/flutter/bin to your path.
    ! Upstream repository https://github.com/andrewkolos/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://github.com/andrewkolos/flutter.git to dismiss this error.
    • Framework revision bbb005296c (5 days ago), 2024-03-05 23:55:05 +0000
    • Engine revision 49bc1577f3
    • Dart version 3.4.0 (build 3.4.0-190.0.dev)
    • DevTools version 2.33.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/andrewkolos/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = /Users/andrewkolos/Library/Android/sdk
    • Java binary at: /Users/andrewkolos/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/231.9392.1.2311.11076708/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    ! CocoaPods 1.12.0 out of date (1.13.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods for instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Users/andrewkolos/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/231.9392.1.2311.11076708/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.87.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.85.20240301

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554         • android-arm64  • Android 14 (API 34) (emulator)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.3.1 23D60 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.3.1 23D60 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 122.0.6261.112

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions