Skip to content

Export files are not updated when moving folders #30413

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

Open
JFixby opened this issue Aug 11, 2017 · 6 comments
Open

Export files are not updated when moving folders #30413

JFixby opened this issue Aug 11, 2017 · 6 comments
Labels
area-intellij Tracking issues for the Dart IntelliJ plugin.

Comments

@JFixby
Copy link

JFixby commented Aug 11, 2017

So basically when i move one folder to another inside project the export files stay the same and break imports.

@JFixby
Copy link
Author

JFixby commented Aug 11, 2017

Similar to the #30294

@anders-sandholm anders-sandholm added the area-intellij Tracking issues for the Dart IntelliJ plugin. label Aug 11, 2017
@bwilkerson
Copy link
Member

@jwren Can we get IntelliJ to ask server for (and apply) the edits that are needed to fix this kind of problem?

@JFixby
Copy link
Author

JFixby commented Aug 11, 2017

I would suggest to make all public classes exported by default and deprecate the export files.

@bwilkerson
Copy link
Member

An issue like this can either be addressed at the language level or can be addressed at the tooling level. The wording of these two issues made it sound like you were asking for an improvement to the tooling.

If you'd like to propose a language change then I would recommend creating a separate issue explaining what changes you'd like to see to the language. Describe the problem that your proposed change would solve, but phrase the request in terms of the change you're proposing, not the problem that's prompting the request. Be sure to also describe the disadvantages of such a change (such as the backward compatibility issue) and how the changed language would handle the namespace control issues that import and export directives currently solve (including subtleties, such as deferred loading and conditional imports). The more complete the proposal from a language design perspective the more likely it is to be given serious consideration.

@JFixby
Copy link
Author

JFixby commented Aug 11, 2017

I know this is just bug in IDE-plugin and it will probably be fixed.

However the bug wouldn't exist at all if the Dart importing system had a proper design. I'm just referring to the issue mentioned before: #30299

Dart dependencies are managed by specifying a file path in a source file.
In Dart import says: Go find this project, inside there is this folder, and then there is another... at some point you'll find the source file, inside there is a class... What do you mean it's not there? Probably he moved and changed his identity, but who knows...

Actually class that uses import needs only the interface of the imported class. He can't care less about the source file location of the import and it's IDE-project name.

For example in Java import says: I need this class. He is known to the world under the name com.uitl.Stack and that's it.
The import source file location is hidden from class-user behind IDE or a runtime environment.

It is important to understand that dependency class source file location and dependency name are two different concepts. Treating them as the same like Dart does is obviously wrong and leads to problems.

Treating them as different concepts will actually handle backward compatibility, namespace control and other issues. For example you wouldn't need conditional imports at all.

Otherwise there is the whole set of future bugs and long discussions about fixing import-related problems like this one reported here.

@alexander-doroshko
Copy link

This seems to be tracked as https://youtrack.jetbrains.com/issue/WEB-18864.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-intellij Tracking issues for the Dart IntelliJ plugin.
Projects
None yet
Development

No branches or pull requests

4 participants