Skip to content
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

AnalysisServer's 'Move File' refactoring doesn't update URIs in part-files #37121

Closed
alexander-doroshko opened this issue May 30, 2019 · 4 comments
Labels
analyzer-refactoring analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@alexander-doroshko
Copy link

alexander-doroshko commented May 30, 2019

Create foo.dart file

part 'foo_part.dart';

and foo_part.dart file next to it:

part of 'foo.dart';

Move foo.dart file to a subfolder, update files content using Analysis Server "MOVE_FILE" refactoring (supported in IntelliJ IDEA 2019.2 but not yet in publicly available releases).

  • URI in the foo.dart file is correctly updated -- that's ok.
  • Problem: URI in the foo_part.dart file is NOT updated.
@alexander-doroshko alexander-doroshko changed the title AnalysisServer's 'Move File' refactoring doesn't update URL in part-files AnalysisServer's 'Move File' refactoring doesn't update URIs in part-files May 30, 2019
@bwilkerson
Copy link
Member

@jwren

@bwilkerson bwilkerson added analyzer-refactoring analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 30, 2019
@jwren
Copy link
Member

jwren commented Jun 24, 2019

Fail test added in this PR: https://dart-review.googlesource.com/c/sdk/+/106981

@jwren
Copy link
Member

jwren commented Jun 24, 2019

I expected to have the addition of in index.dart have the additional search reference from the index, but it still does not.

@override
  visitPartOfDirective(PartOfDirective node) {
    Element element = node.element;
    if(element is LibraryElement) {
      CompilationUnitElement compilationUnitElement = element.definingCompilationUnit;
      if(compilationUnitElement.source != null) {
        if(node.uri != null) {
          recordUriReference(compilationUnitElement, node.uri);
        }
      }
    }
    super.visitPartOfDirective(node);
  }

@jwren
Copy link
Member

jwren commented Jun 25, 2019

Resolved in master Dart SDK branch with https://dart-review.googlesource.com/c/sdk/+/107200

@jwren jwren closed this as completed Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-refactoring analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants