-
Notifications
You must be signed in to change notification settings - Fork 7
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
import statements not recognized if packages are referenced #4
Comments
Hey, @OlegAlexander I just found out that I had to change how package imports are parsed. In |
Hi @gretzki, Sorry I missed your first post 18 days ago. I'm usually much more responsive. Dart imports work as follows: When importing files from your own internal package, Dart expects these files to be under the import 'package:your_package_name/file1.dart';
import 'package:your_package_name/src/file2.dart'; But what that really means is You can also use relative paths, but the Please keep in mind that Lakos will only visualize internal dependencies. It will not visualize external packages, e.g. Please try the 'package:your_package_name' method above and let me know if that still doesn't work for you. Thanks! |
Hi @OlegAlexander , thanks for the reply. Oddly enough, that's the syntax I'm using and the flutter project compiles; and runs too ;) |
That's strange. Could you please create a minimal example project for me so I can reproduce the problem on my end? |
yes, I'll gladly provide an example in the next days. |
Hi @gretzki, Have you had a chance to make an example project for me to try to reproduce this issue? Or have you solved the issue since then? Thanks. |
Alas, I haven't yet.
The main.dart file lies under root/lib/ The modules are imported from within other modules or the main app as follows:
Hope this helps as a starting point |
Hi @gretzki, I think I understand now. Lakos is designed to graph one package at a time, with only one pubspec.yaml file. It ignores all external packages, even if they are your own. I recommend running Lakos on your main project and each of your subprojects separately. |
Hey @OlegAlexander, but it works fine with this small improvement. |
Hi @gretzki, Actually, I just ran the tests on your pull request and they all passed successfully. If you're saying that this simple change is working for you, and it doesn't break anything else, then there's a good chance I'll merge it. Please give me some time to look at your change more carefully. |
Hi @gretzki, I took a closer look at your pull request and ran the tests again with and without your Can you please update your pull request so that the code works correctly for both the projects in the test suite and also your project? |
Hello @gretzki, Have you had a chance to update your pull request so that it works correctly for both cases, as outlined above? Thank you. |
Hi @OlegAlexander . Alas, I've not really time to work on this. It was just an idea for a quick fix but if it requires more time, I'll not be able to do it. All my spare time goes into a similar project, but for Swift language instead of Flutter/Dart. You might want to take a look at swiftalyzer.com. |
No problem, @gretzki. I will close this issue, but I've added SwiftAlyzer to my Readme. It looks really cool! |
First of all: Thanks for this great tool!
One thing that I observed, when using import
package:...
statements, those are not picked up by your tool, e.g.import 'package:repository/domain_model/status.dart';
Cheers!
The text was updated successfully, but these errors were encountered: