Skip to content

Extract Method shows up on import prefix #4029

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
DanTup opened this issue Jun 23, 2022 · 2 comments
Closed

Extract Method shows up on import prefix #4029

DanTup opened this issue Jun 23, 2022 · 2 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
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Jun 23, 2022

Screenshot 2022-06-23 at 10 23 10

@DanTup DanTup added is bug in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server labels Jun 23, 2022
@DanTup DanTup added this to the v3.44.0 milestone Jun 23, 2022
@DanTup
Copy link
Member Author

DanTup commented Jun 23, 2022

Same occurs without the prefix if it's nullable:

import 'dart:io';

File? a;

It also fails if invoked:

[Error - 11:20:19 AM] An error occurred while handling workspace/executeCommand request: Bad state: No type: File
#0      ExpressionExtension.typeOrThrow (package:analyzer/src/dart/ast/extensions.dart:121:7)
#1      ExtractMethodRefactoringImpl._initializeParameters (package:analysis_server/src/services/refactoring/extract_method.dart:724:41)
#2      ExtractMethodRefactoringImpl.checkInitialConditions (package:analysis_server/src/services/refactoring/extract_method.dart:199:24)
#3      AbstractRefactorCommandHandler.getRefactoring (package:analysis_server/src/lsp/handlers/commands/abstract_refactor.dart:56:26)
#4      ValidateRefactorCommandHandler.execute.<anonymous closure> (package:analysis_server/src/lsp/handlers/commands/validate_refactor.dart:42:33)

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jun 23, 2022
…import prefixes

Fixes Dart-Code/Dart-Code#4029 (and maybe #48824).

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

DanTup commented Jun 23, 2022

Fixed by dart-lang/sdk@23f1c54.

@DanTup DanTup closed this as completed Jun 23, 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
Projects
None yet
Development

No branches or pull requests

1 participant