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

Absolute import path generates if long subfolder hierarchy #41947

Open
ghost opened this issue May 18, 2020 · 7 comments
Open

Absolute import path generates if long subfolder hierarchy #41947

ghost opened this issue May 18, 2020 · 7 comments
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P4 type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@ghost
Copy link

ghost commented May 18, 2020

@subzero911 commented on May 16, 2020, 9:48 AM UTC:

image

Steps to Reproduce

  1. Create a new project.
  2. Create 'widgets' folder and any subfolder like 'auth'.
  3. Create a dart file inside this folder with some classes.
  4. Mention these classes in another dart file and press 'Enter'. It should auto-generate an 'import' line.

Expected results:
Project relative path generated:
import 'package:chatapp/widgets/auth/auth_form.dart';

Actual results:
Absolute disk path generated:
import 'file:///D:/Flutter/chat_app/lib/widgets/auth/auth_form.dart';

Obviously if you move your project to the other folder this path would be wrong. Thus it's not a appropriate behaviour.

This issue was moved by devoncarew from flutter/flutter-intellij#4551.

@ghost
Copy link
Author

ghost commented May 18, 2020

@dnfield commented on May 16, 2020, 3:37 PM UTC:

Which IDE are you using?

This seems like a bug in an IDE plugin, or perhaps a bug in the analysis server.

@ghost
Copy link
Author

ghost commented May 18, 2020

@dnfield commented on May 16, 2020, 3:38 PM UTC:

/cc @DanTup @jacob314

@ghost
Copy link
Author

ghost commented May 18, 2020

@subzero911 commented on May 16, 2020, 3:38 PM UTC:

I use Android Studio

@ghost
Copy link
Author

ghost commented May 18, 2020

@DanTup commented on May 18, 2020, 8:23 AM UTC:

If IntelliJ handles this the same as VS Code, this is likely coming from the analysis server. (@bwilkerson @scheglov)

@ghost
Copy link
Author

ghost commented May 18, 2020

@bwilkerson commented on May 18, 2020, 3:10 PM UTC:

Yes, this looks like an issue in the analysis server. Please move this issue to the sdk repository.

@devoncarew devoncarew added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label May 18, 2020
@bwilkerson
Copy link
Member

@scheglov In case you have any insight as to why this might be happening.

@scheglov
Copy link
Contributor

I don't have much to add.
In general we use the URI that SourceFactory restored from the path.

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

No branches or pull requests

4 participants