Skip to content

Vscode refactoring: Convert Getter to Method applied to "widget", applies also to all flutter SDK & pub cache files #4221

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

Closed
nicolasmol opened this issue Oct 15, 2022 · 5 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@nicolasmol
Copy link

Quite big warning, since doing this has opened hundreds of files from SDK/pub cache, in my Vscode, and (I don't which mistake I made) saved and corrupted all of them

image


Linux mint 20.3
VS Code version: 1.72.2
Dart SDK version: 2.18.2 (stable) (Tue Sep 27 13:24:11 2022 +0200) on "linux_x64"
Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision eb6d86ee27 (il y a 10 jours) • 2022-10-04 22:31:45 -0700
Engine • revision c08d7d5efc
Tools • Dart 2.18.2 • DevTools 2.15.0

@DanTup
Copy link
Member

DanTup commented Oct 15, 2022

Sorry for the hassle. I think VS Code should still allow you to "undo" changes made by refactors like that (if it doesn't, please file an issue so I can investigate).

Can you confirm exactly where you invoked this refactor? I can't see a code selection/caret in your screenshot and I can't get this refactor to show up in a similar location myself. I can see the server has some special handling to prevent renaming items that are not defined inside your own workspace, but it looks like it might not cover other types of refactors.

@DanTup DanTup added this to the v3.52.0 milestone Oct 15, 2022
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server awaiting info Requires more information from the customer to progress labels Oct 15, 2022
@nicolasmol
Copy link
Author

@DanTup over the "widget" word, in the "State" widget of a "StatefulWidget" one

@DanTup DanTup removed the awaiting info Requires more information from the customer to progress label Oct 17, 2022
@DanTup
Copy link
Member

DanTup commented Oct 17, 2022

Got it, can repro now. Thanks!

@DanTup
Copy link
Member

DanTup commented Oct 17, 2022

Working on a fix at https://dart-review.googlesource.com/c/sdk/+/264480.

@DanTup DanTup added the relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available label Oct 17, 2022
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Oct 18, 2022
…ternal package files

Fixes Dart-Code/Dart-Code#4221.

Change-Id: I1a017f098d3d72bc19c91cead4c68b2666c5fe01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264480
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Oct 18, 2022

Fixed by dart-lang/sdk@ffe4a8c. The fix ships in the SDK so will show up as part of an SDK release rather than a Dart-Code release.

@DanTup DanTup closed this as completed Oct 18, 2022
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 in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

No branches or pull requests

2 participants