Skip to content

Renaming a class by its defined name does not work #5002

Closed

Description

@lukehutch

Describe the bug

If you try to rename a class from its defined name, with the caret at the end of the name, hitting F2 does nothing:

image

You have to put the caret anywhere but the position after the last character, for this to work:

image

I thought this was already filed, but I can't find the dup... sorry if this is in fact a dup!

Workspace Environment
Dart Code extension: 3.83.20240207
Flutter extension: 3.83.20240201 (activated)

App: Visual Studio Code
App Host: desktop
Version: linux 1.86.2

Workspace type: Dart, Flutter (LSP) (Multiroot)

Dart (3.4.0-99.0.dev): /opt/flutter/bin/cache/dart-sdk
Flutter (3.20.0-1.1.pre): /opt/flutter (sdk gphone x86 64 (android-x64/android))

Output from 'dart info'

/opt/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

Project info

  • sdk constraint: '>=3.1.5 <4.0.0'
  • dependencies: auto_size_text, boxy, cached_network_image, carousel_slider, collection, cross_file, cupertino_icons, delayed_display, device_info_plus, dio, dio_smart_retry, email_validator, exif, extended_image, file_picker, flutter, flutter_cache_manager, flutter_email_sender, flutter_localizations, flutter_persistent_value_notifier, flutter_svg, fluttericon, fluttertoast, geocoding, geolocator, getwidget, google_fonts, image_picker, image_picker_android, image_picker_platform_interface, intl, jiffy, line_awesome_flutter, logging, material_dialogs, package_info_plus, path_provider, persistent_bottom_nav_bar_v2, provider, serverpod_auth_apple_flutter, serverpod_auth_client, serverpod_auth_facebook_flutter, serverpod_auth_google_flutter, serverpod_auth_shared_flutter, serverpod_chat_client, serverpod_chat_flutter, serverpod_client, serverpod_flutter, serverpod_serialization, share_plus, shared_preferences, url_launcher, url_launcher_android
  • dev_dependencies: flutter_launcher_icons, flutter_lints, flutter_test, lints
  • elided dependencies: 2

Process info

Memory CPU Elapsed time Command line
491 MB 2.2% 11:19 dart --enable-vm-service=0 --pause_isolates_on_start --disable-dart-dev -DSILENT_VM_SERVICE=true --write-service-info=file:/vm.json --pause_isolates_on_exit --enable-asserts /main.dart
707 MB 0.0% 1-06:27:05 dart ../serverpod_cli.dart generate --watch
698 MB 0.0% 1-05:44:54 dart ../serverpod_cli.dart generate --watch
76 MB 0.1% 11:20 dart debug_adapter
77 MB 0.0% 6-23:59:26 dart devtools --machine --allow-embedding
82 MB 0.0% 15-20:00:04 dart devtools --machine --allow-embedding
75 MB 0.0% 7-20:38:20 dart devtools --machine --allow-embedding --port 9101
89 MB 0.0% 2-22:17:20 dart devtools --machine --allow-embedding --port 9103
72 MB 0.0% 2-22:17:24 dart devtools --machine --allow-embedding --port 9104
2741 MB 0.4% 2-22:17:25 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.83.20240207
3120 MB 0.7% 2-22:17:21 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.83.20240207
101 MB 0.0% 2-22:17:25 flutter_tools.snapshot daemon
122 MB 0.0% 2-22:17:21 flutter_tools.snapshot daemon
100 MB 0.0% 2-19:38:05 flutter_tools.snapshot debug_adapter
262 MB 0.0% 2-19:38:05 flutter_tools.snapshot run --machine --start-paused -d emulator-5554 --devtools-server-address http:/ --target /main.dart
Output from 'flutter doctor'

/opt/flutter/bin/flutter doctor -v

┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
[✓] Flutter (Channel beta, 3.20.0-1.1.pre, on Fedora Linux 39 (Workstation Edition) 6.6.9-200.fc39.x86_64, locale en_US.utf8)
    • Flutter version 3.20.0-1.1.pre on channel beta at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d7e373c6c2 (8 days ago), 2024-02-15 11:34:03 -0800
    • Engine revision 9869d47a27
    • Dart version 3.4.0 (build 3.4.0-99.0.dev)
    • DevTools version 2.31.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /home/luke/Android/Sdk
    • Platform android-34, build-tools 33.0.1
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 17.0.6 (Fedora 17.0.6-1.fc39)
    • cmake version 3.27.7
    • ninja version 1.11.1
    • pkg-config version 1.9.5

[✓] Android Studio (version 2022.2)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 73.0.2
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.86.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.83.20240201

[✓] VS Code (version 1.86.0-insider)
    • VS Code at /usr/share/code-insiders
    • Flutter extension version 3.79.20231130

[✓] Connected device (3 available)
    • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Linux (desktop)            • linux         • linux-x64      • Fedora Linux 39 (Workstation Edition) 6.6.9-200.fc39.x86_64
    • Chrome (web)               • chrome        • web-javascript • Google Chrome 120.0.6099.216

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

• No issues found!

Activity

  1. added this to the v3.84.0 milestone on Feb 26, 2024
  2. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Feb 26, 2024
  3. DanTup commented on Feb 26, 2024

    @DanTup
    Member

    Fixed by dart-lang/sdk@792d500. It's an analysis server change so will show up in a future SDK release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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