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

Problem with large package and limiting scope #52

Open
mingsai opened this issue Mar 18, 2022 · 4 comments
Open

Problem with large package and limiting scope #52

mingsai opened this issue Mar 18, 2022 · 4 comments

Comments

@mingsai
Copy link

mingsai commented Mar 18, 2022

I have successfully been able to create UML diagrams for many of the packages found at.

https://github.com/julienlebren/flutter_packages

I use dcdg | pbcopy to copy the plantuml output to my clipboard on the Mac. Then I use the PlantUML integration plugin viewer on Android Studio to preview the picture.

With that plugin I am able to copy the SVG code into (.svg) files to achieve a good solution for adding the diagrams to SketchApp for layout. One could also use these on HMTL or other places.

I fail when I attempt to render the signin package as noted below. I did some basic research from other closed issues but I'd appreciate suggestions about how to get this fairly complex package to render.

Thanks for your phenomenal work on this package.

Unhandled exception:
Bad state: Unable to find the context to /Volumes/VPL/Development/flutter-workspace/flutter_packages/packages/sign_in/lib/sign_in.freezed.dart
#0      AnalysisContextCollectionImpl.contextFor (package:analyzer/src/dart/analysis/analysis_context_collection.dart:106:5)
#1      findClassElements (package:dcdg/src/find_class_elements.dart:46:39)
<asynchronous suspension>
#2      main (file:///Users/stan/.pub-cache/hosted/pub.dartlang.org/dcdg-4.0.1/bin/dcdg.dart:35:19)
<asynchronous suspension>

Note:
When I try options to limit the scope of my folder search, I come up empty.

eg.
dcdg -s "lib/services"|pbcopy  

BTW:
Several of the other packages were extremely large and I was successful getting them into SVG files. I do not understand the error message.

P.S.
I was able to achieve 99% of what I want by removing the freezed.dart file outside of the package. My question now becomes; can you explain what the error means and how I might better handle the problem if I have a similar issue in the future? Why the behavior on freezed files? The scope question remains as well. I am obviously missing something as I was not able to scope the output.

@glesica
Copy link
Owner

glesica commented Mar 18, 2022

I'm not sure exactly why it's failing but I see that the freezed package requires a newer version of the analyzer package, so it's possible that is the problem.

@AlexKenbo
Copy link

I'm not sure exactly why it's failing but I see that the freezed package requires a newer version of the analyzer package, so it's possible that is the problem.

dcdg does not work with the new analyzer >=3.0.0 - but it is required for freezed to work.
And freezed is a structured package...
Can this be fixed?

Because tortuga depends on freezed ^2.0.2 which depends on analyzer >=3.0.0 <5.0.0, analyzer >=3.0.0 <5.0.0 is required. So, because tortuga depends on analyzer ^2.6.0, version solving failed. pub get failed (1; So, because tortuga depends on analyzer ^2.6.0, version solving failed.) exit code 1

@glesica
Copy link
Owner

glesica commented Jun 6, 2022

I can try to bump the analyzer dependency, but then we also risk breaking things that depend on an older analyzer version.

@paulkastel
Copy link

paulkastel commented Jan 11, 2023

Hi @glesica!
today I also came on this issue, and I figured out one conclusion: dcdg to not like anything related to code generation: It didn't work with project that had used any kind of annotation: auto_route, freezed, injectable, hive, json_annotation or package that generated translations: localizely. (so pretty popular and widely used packages from pub.dev). The moment I removed all of those dependencies from my code then dcdg correctly generated syntax for PlantUML.

Thats a bummer that it cant ignore *.g.dart or *.freezed.dart files.

This is related to whole bunch of issues here:
#55
#46 (comment)
#43
#41

And on stackoverflow:
https://stackoverflow.com/q/72679594/6229867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants