Skip to content

Code folding not working for functions where parameters span multiple lines #4931

@andrewkolos

Description

@andrewkolos

Sorry for the vague title. This is on pre-release (more info in the diagnostic info later).

Describe the bug
In a specific file I'm working in, code folding seems to not work for any for loops. Interestingly, upon reloading the window, it works very briefly before breaking.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout this specific commit on my fork of flutter/flutter: https://github.com/andrewkolos/flutter/tree/a0c24d34c0895910b32e4b71cb6aff38a8803c5d
  2. Navigate to packages/flutter_tools/lib/src/asset.dart.
  3. Navigate to any for loop and observe that it cannot be folded. There's no folding chevron on the left, and the Fold All VS command will not fold any for loop.

Expected behavior
Folding works for all blocks.

Screenshots
image

Workspace Environment
Dart Code extension: 3.81.20231227
Flutter extension: 3.81.20231227 (activated)

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

Workspace type: Dart, Flutter (LSP)

Dart (3.3.0-276.0.dev): /Users/andrewkolos/Documents/GitHub/flutter/bin/cache/dart-sdk
Flutter (3.18.0-19.0.pre.59): /Users/andrewkolos/Documents/GitHub/flutter (iPhone 15 Pro Max (ios/ios))

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.3.0-276.0.dev (dev) (Tue Jan 2 12:03:57 2024 -0800) on "macos_arm64"
  • on macos / Version 14.2.1 (Build 23C71)
  • locale is en

Process info

Memory CPU Elapsed time Command line
8 MB 0.0% 01-21:33:55 dart devtools --machine --allow-embedding
48 MB 0.0% 28:14 dart devtools --machine --allow-embedding
15 MB 0.0% 01-21:33:55 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.81.20231227
736 MB 0.0% 28:14 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.81.20231227
80 MB 0.3% 28:14 flutter_tools.snapshot daemon
Output from 'flutter doctor'

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

[!] Flutter (Channel [user-branch], 3.18.0-19.0.pre.59, on macOS 14.2.1 23C71 darwin-arm64, locale en)
    ! Flutter version 3.18.0-19.0.pre.59 on channel [user-branch] at /Users/andrewkolos/Documents/GitHub/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! 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 a0c24d34c0 (2 days ago), 2024-01-09 09:42:05 -0800
    • Engine revision f539acfb8c
    • Dart version 3.3.0 (build 3.3.0-276.0.dev)
    • DevTools version 2.31.0-dev.0
    • 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
    • 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)

[!] Android Studio (version unknown)
    • Android Studio at /Users/andrewkolos/Desktop/Android Studio Preview.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
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

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

[✓] Connected device (3 available)
    • iPhone 15 Pro Max (mobile) • 1F50AF7D-FCB5-4839-81DE-954252A38693 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 14.2.1 23C71 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 120.0.6099.216

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

! Doctor found issues in 3 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 bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions